FluidCappedRateL2 ​
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 ​
constructor(CappedRateConstructorParams memory params_, address sequencerUptimeFeed_)
FluidCappedRateBase(params_)
FluidCenterPriceL2(params_.infoName, sequencerUptimeFeed_);centerPrice ​
function centerPrice() external override(IFluidCappedRate, FluidCenterPriceL2) returns (uint256 price_);infoName ​
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
function targetDecimals() public pure override(IFluidOracle, FluidCenterPriceL2) returns (uint8);getExchangeRate ​
Returns the raw underlying exchange rate in 1e27 precision, without applying collateral/debt caps.
Heartbeat-aware read: if a heartbeat refresh is due, computes and returns the fresh rate without requiring a storage write.
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
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
function getExchangeRateLiquidate() public view virtual override returns (uint256 exchangeRate_);getExchangeRateOperateDebt ​
Operate exchange rate for the debt asset side
function getExchangeRateOperateDebt() public view virtual override returns (uint256 exchangeRate_);getExchangeRateLiquidateDebt ​
Liquidate exchange rate for the debt asset side
function getExchangeRateLiquidateDebt() public view virtual override returns (uint256 exchangeRate_);getExchangeRateOperateRaw ​
Same as getExchangeRateOperate(), for resolver/UI reads only. May bypass checks that can revert on the guarded getter.
L2 "Raw" = skips only _ensureSequencerUpAndValid(). The rate is still the capped operate rate (delegates to the base getExchangeRateOperate()); caps are NOT removed.
function getExchangeRateOperateRaw() public view virtual override returns (uint256 exchangeRate_);getExchangeRateLiquidateRaw ​
Same as getExchangeRateLiquidate(), for resolver/UI reads only. May bypass checks that can revert on the guarded getter.
L2 "Raw" = skips only _ensureSequencerUpAndValid(). The rate is still the capped liquidate rate (delegates to the base getExchangeRateLiquidate()); caps are NOT removed.
function getExchangeRateLiquidateRaw() public view virtual override returns (uint256 exchangeRate_);getExchangeRateRaw ​
Same as getExchangeRate(), for resolver/UI reads only. May bypass checks that can revert on the guarded getter.
L2: skips _ensureSequencerUpAndValid(); delegates to the uncapped base rate logic (getExchangeRate()).
function getExchangeRateRaw() public view virtual override returns (uint256 exchangeRate_);