DexPublicViews ​
Inherits:DexStorageVars
Functions ​
getDexPricesAndExchangePrices ​
Get the prices and exchange prices for a DEX
expected to be called via callStatic
solidity
function getDexPricesAndExchangePrices(address dex_) public returns (IFluidDexT1.PricesAndExchangePrice memory pex_);
Parameters
Name | Type | Description |
---|---|---|
dex_ | address | The address of the DEX |
Returns
Name | Type | Description |
---|---|---|
pex_ | IFluidDexT1.PricesAndExchangePrice | A struct containing prices and exchange prices |
getDexCollateralReserves ​
Get the collateral reserves for a DEX
expected to be called via callStatic
solidity
function getDexCollateralReserves(address dex_) public returns (IFluidDexT1.CollateralReserves memory reserves_);
Parameters
Name | Type | Description |
---|---|---|
dex_ | address | The address of the DEX |
Returns
Name | Type | Description |
---|---|---|
reserves_ | IFluidDexT1.CollateralReserves | A struct containing collateral reserve information |
getDexDebtReserves ​
Get the debt reserves for a DEX
expected to be called via callStatic
solidity
function getDexDebtReserves(address dex_) public returns (IFluidDexT1.DebtReserves memory reserves_);
Parameters
Name | Type | Description |
---|---|---|
dex_ | address | The address of the DEX |
Returns
Name | Type | Description |
---|---|---|
reserves_ | IFluidDexT1.DebtReserves | A struct containing debt reserve information |
getDexOraclePrice ​
get Dex oracle price TWAP data
solidity
function getDexOraclePrice(address dex_, uint256[] memory secondsAgos_)
external
view
returns (IFluidDexT1.Oracle[] memory twaps_, uint256 currentPrice_);
Parameters
Name | Type | Description |
---|---|---|
dex_ | address | |
secondsAgos_ | uint256[] | array of seconds ago for which TWAP is needed. If user sends [10, 30, 60] then twaps_ will return [10-0, 30-10, 60-30] |
Returns
Name | Type | Description |
---|---|---|
twaps_ | IFluidDexT1.Oracle[] | twap price, lowest price (aka minima) & highest price (aka maxima) between secondsAgo checkpoints |
currentPrice_ | uint256 | price of pool after the most recent swap |