Skip to content

DexConversionPriceCL ​

Git Source

Inherits:DexConversionPriceGetter, ChainlinkOracleImpl

returns the reserves conversion price fetched from Chainlink feeds

State Variables ​

RESERVES_CONVERSION_PRICE_MULTIPLIER ​

solidity
uint256 internal immutable RESERVES_CONVERSION_PRICE_MULTIPLIER;

RESERVES_CONVERSION_PRICE_DIVISOR ​

solidity
uint256 internal immutable RESERVES_CONVERSION_PRICE_DIVISOR;

Functions ​

constructor ​

for multiplier and divisor: a Fluid ChainlinkOracle returns the price in token decimals scaled to 1e27 e.g. for USDC per ETH it would be 3400e15 USDC if price is 3400$ per ETH. But the Dex internally would have a price of 3400e27. So for that example the multiplier would have to be 1e12 and the divisor 1.

solidity
constructor(
    ChainlinkOracleImpl.ChainlinkConstructorParams memory reservesConversion_,
    uint256 reservesConversionPriceMultiplier_,
    uint256 reservesConversionPriceDivisor_
) ChainlinkOracleImpl(reservesConversion_);

Parameters

NameTypeDescription
reservesConversion_ChainlinkOracleImpl.ChainlinkConstructorParams
reservesConversionPriceMultiplier_uint256The multiplier to bring the fetched price to token1/token0 form as used internally in Dex.
reservesConversionPriceDivisor_uint256The divisor to bring the fetched price to token1/token0 form as used internally in Dex.

_getDexReservesConversionPriceOperate ​

solidity
function _getDexReservesConversionPriceOperate() internal view override returns (uint256 conversionPrice_);

_getDexReservesConversionPriceLiquidate ​

solidity
function _getDexReservesConversionPriceLiquidate() internal view override returns (uint256 conversionPrice_);

getDexConversionPriceFluidOracleData ​

Returns the configuration data of the DexConversionPriceFluidOracle.

solidity
function getDexConversionPriceFluidOracleData()
    public
    view
    returns (uint256 reservesConversionPriceMultiplier_, uint256 reservesConversionPriceDivisor_);

Returns

NameTypeDescription
reservesConversionPriceMultiplier_uint256The multiplier for the reserves conversion price.
reservesConversionPriceDivisor_uint256The divisor for the reserves conversion price.