Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

StakedOracle

Git Source

Inherits: IOracle

Title: StakedOracle

Prices ERC4626 vault shares by combining underlying price with exchange rate.

Price = UnderlyingPrice * ExchangeRate. Used for splDXY-BEAR/splDXY-BULL in Morpho.

State Variables

VAULT

The staking vault (splDXY-BEAR or splDXY-BULL).

IERC4626 public immutable VAULT

UNDERLYING_ORACLE

Oracle for the underlying plDXY token.

IOracle public immutable UNDERLYING_ORACLE

UNDERLYING_DECIMALS

Decimal multiplier for the underlying asset.

uint256 public immutable UNDERLYING_DECIMALS

Functions

constructor

Creates staked oracle for a vault.

constructor(
    address _vault,
    address _underlyingOracle
) ;

Parameters

NameTypeDescription
_vaultaddressERC4626 staking vault address.
_underlyingOracleaddressPrice oracle for the underlying plDXY token.

price

Returns price of 1 vault share including accrued yield.

function price() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256Price scaled to 1e36 (underlying price * exchange rate).

Errors

StakedOracle__InvalidPrice

Thrown when underlying oracle returns zero price.

error StakedOracle__InvalidPrice();

StakedOracle__ZeroAddress

Thrown when zero address provided to constructor.

error StakedOracle__ZeroAddress();