Skip to content

FluidCappedRateL2 ​

Git Source

Inherits:FluidCappedRateBase, FluidCenterPriceL2

This contract stores an exchange rate in intervals to optimize gas cost for an L2

Properly implements all interfaces for use as IFluidCenterPrice and IFluidOracle.

Functions ​

constructor ​

solidity
constructor(CappedRateConstructorParams memory params_, address sequencerUptimeFeed_)
    FluidCappedRateBase(params_)
    FluidCenterPriceL2(params_.infoName, sequencerUptimeFeed_);

centerPrice ​

solidity
function centerPrice() external override(IFluidCappedRate, FluidCenterPriceL2) returns (uint256 price_);

infoName ​

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

targetDecimals ​

target decimals of the returned oracle rate when scaling to 1e27. E.g. for ETH / USDC it would be 15 because diff of ETH decimals to 1e27 is 9, and USDC has 6 decimals, so 6+9 = 15, e.g. 2029,047772120364926 For USDC / ETH: 21 + 18 = 39, e.g. 0,000492842018675092636829357843847601646

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() public view virtual override returns (uint256 exchangeRate_);

getExchangeRateOperate ​

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

solidity
function getExchangeRateOperate() public view virtual override returns (uint256 exchangeRate_);

getExchangeRateLiquidate ​

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

solidity
function getExchangeRateLiquidate() public view virtual override returns (uint256 exchangeRate_);

getExchangeRateOperateDebt ​

Get the operate() exchange rate for debt asset side, with no cap upwards and capped decrease

solidity
function getExchangeRateOperateDebt() public view virtual override returns (uint256 exchangeRate_);

getExchangeRateLiquidateDebt ​

Get the liquidate() exchange rate for debt asset side, with max APR cap upwards, and capped decrease

solidity
function getExchangeRateLiquidateDebt() public view virtual override returns (uint256 exchangeRate_);