DexConversionPriceFluidOracle ​
Inherits:DexConversionPriceGetter
returns the reserves conversion price fetched from a separately deployed FluidOracle
State Variables ​
RESERVES_CONVERSION_ORACLE ​
external IFluidOracle used to convert token0 into token1 or the other way around depending on _QUOTE_IN_TOKEN0.
solidity
IFluidOracle internal immutable RESERVES_CONVERSION_ORACLE;
RESERVES_CONVERSION_INVERT ​
solidity
bool internal immutable RESERVES_CONVERSION_INVERT;
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 FluidOracle 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(DexConversionPriceFluidOracleParams memory conversionPriceParams_);
Parameters
Name | Type | Description |
---|---|---|
conversionPriceParams_ | DexConversionPriceFluidOracleParams |
_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 (
address reservesConversionOracle_,
bool reservesConversionInvert_,
uint256 reservesConversionPriceMultiplier_,
uint256 reservesConversionPriceDivisor_
);
Returns
Name | Type | Description |
---|---|---|
reservesConversionOracle_ | address | The address of the reserves conversion oracle. |
reservesConversionInvert_ | bool | A boolean indicating if reserves conversion should be inverted. |
reservesConversionPriceMultiplier_ | uint256 | The multiplier for the reserves conversion price. |
reservesConversionPriceDivisor_ | uint256 | The divisor for the reserves conversion price. |
Structs ​
DexConversionPriceFluidOracleParams ​
solidity
struct DexConversionPriceFluidOracleParams {
address reservesConversionOracle;
bool reservesConversionInvert;
uint256 reservesConversionPriceMultiplier;
uint256 reservesConversionPriceDivisor;
}