Skip to content

ChainlinkCenterPriceL2 ​

Git Source

Inherits:FluidCenterPriceL2, IFluidOracle, ChainlinkOracleImpl

Gets the exchange rate between 2 tokens via Chainlink feeds for Layer 2 (with sequencer uptime feed check)

Also implements IFluidOracle interface

Functions ​

constructor ​

constructor sets the chainlink feeds config & L2 sequencer uptime feed

solidity
constructor(
    string memory infoName_,
    ChainlinkOracleImpl.ChainlinkConstructorParams memory clParams_,
    address sequencerUptimeFeed_
) ChainlinkOracleImpl(clParams_) FluidCenterPriceL2(infoName_, sequencerUptimeFeed_);

centerPrice ​

solidity
function centerPrice() external view override returns (uint256 price_);

infoName ​

solidity
function infoName() public view override(IFluidOracle, FluidCenterPriceL2) returns (string memory);

targetDecimals ​

solidity
function targetDecimals() public pure override(IFluidOracle, FluidCenterPriceL2) returns (uint8);

getExchangeRate ​

Deprecated. Use getExchangeRateOperate() and getExchangeRateLiquidate() instead. Only implemented for backwards compatibility.

solidity
function getExchangeRate() external view virtual returns (uint256 exchangeRate_);

getExchangeRateOperate ​

Get the exchangeRate_ between the underlying asset and the peg asset in 1e27 for operates

solidity
function getExchangeRateOperate() external view virtual returns (uint256 exchangeRate_);

getExchangeRateLiquidate ​

Get the exchangeRate_ between the underlying asset and the peg asset in 1e27 for liquidations

solidity
function getExchangeRateLiquidate() external view virtual returns (uint256 exchangeRate_);