PtSpotOracle

Git Source

Inherits: SpotOracle

Spot Oracle for PT MARKETs

This contract assumes that the SY is pegged 1:1 with the underlying asset of IonPool. This is a major assumption to be aware of since this oracle will return a valuation in SY, which may or may not be the same as the underlying in the IonPool.

State Variables

MARKET

IPMarketV3 public immutable MARKET;

TWAP_DURATION

uint32 public immutable TWAP_DURATION;

Functions

constructor

Construct a new PtSpotOracle instance

constructor(
    IPMarketV3 _market,
    uint32 _twapDuration,
    uint256 _ltv,
    address _reserveOracle
)
    SpotOracle(_ltv, _reserveOracle);

Parameters

getPrice

Gets the price of the collateral asset in ETH.

Overridden by collateral specific spot oracle contracts.

function getPrice() public view override returns (uint256 price);

Returns

Errors

InsufficientOracleSlots

error InsufficientOracleSlots(uint256 currentSlots);