FluidDexReservesResolver ​
Inherits:DexFactoryViews, DexActionEstimates
Fluid Dex Reserves resolver Implements various view-only methods to give easy access to Dex protocol reserves data.
Functions ​
constructor ​
constructor(address factory_, address liquidity_, address liquidityResolver_)
Variables(factory_, liquidity_, liquidityResolver_);
getPool ​
Get a Pool's address and its token addresses
function getPool(uint256 poolId_) public view returns (Pool memory pool_);
Parameters
Name | Type | Description |
---|---|---|
poolId_ | uint256 | The ID of the Pool |
Returns
Name | Type | Description |
---|---|---|
pool_ | Pool | The Pool data |
getPoolFee ​
Get a Pool's fee
function getPoolFee(address pool_) public view returns (uint256 fee_);
Parameters
Name | Type | Description |
---|---|---|
pool_ | address | The Pool address |
Returns
Name | Type | Description |
---|---|---|
fee_ | uint256 | The Pool fee as 1% = 10000 |
getAllPools ​
Get an array of all Pool addresses and their token addresses
function getAllPools() public view returns (Pool[] memory pools_);
Returns
Name | Type | Description |
---|---|---|
pools_ | Pool[] | An array containing all Pool data |
getPoolReserves ​
Get the token addresses, collateral reserves, and debt reserves for a given Pool address
expected to be called via callStatic
function getPoolReserves(address pool_) public returns (PoolWithReserves memory poolReserves_);
Parameters
Name | Type | Description |
---|---|---|
pool_ | address | The Pool address |
Returns
Name | Type | Description |
---|---|---|
poolReserves_ | PoolWithReserves | The Pool data with reserves. |
getPoolsReserves ​
Get an array of Pool addresses, their token addresses, collateral reserves, and debt reserves for a given array of Pool addresses
expected to be called via callStatic
function getPoolsReserves(address[] memory pools_) public returns (PoolWithReserves[] memory poolsReserves_);
Parameters
Name | Type | Description |
---|---|---|
pools_ | address[] | The array of Pool addresses |
Returns
Name | Type | Description |
---|---|---|
poolsReserves_ | PoolWithReserves[] | An array containing all Pool data with reserves |
getAllPoolsReserves ​
Get an array of all Pool addresses, their token addresses, collateral reserves, and debt reserves
expected to be called via callStatic
function getAllPoolsReserves() public returns (PoolWithReserves[] memory poolsReserves_);
Returns
Name | Type | Description |
---|---|---|
poolsReserves_ | PoolWithReserves[] | An array containing all Pool data with reserves |
getPoolReservesAdjusted ​
Get the token addresses, adjusted collateral reserves, and adjusted debt reserves for a given Pool address
expected to be called via callStatic
function getPoolReservesAdjusted(address pool_) public returns (PoolWithReserves memory poolReserves_);
Parameters
Name | Type | Description |
---|---|---|
pool_ | address | The Pool address |
Returns
Name | Type | Description |
---|---|---|
poolReserves_ | PoolWithReserves | The Pool data with adjusted reserves scaled to 1e12. balanceTokens are in token decimals. |
getPoolsReservesAdjusted ​
Get an array of Pool addresses, their token addresses, adjusted collateral reserves, and adjusted debt reserves for a given array of Pool addresses
expected to be called via callStatic
function getPoolsReservesAdjusted(address[] memory pools_) public returns (PoolWithReserves[] memory poolsReserves_);
Parameters
Name | Type | Description |
---|---|---|
pools_ | address[] | The array of Pool addresses |
Returns
Name | Type | Description |
---|---|---|
poolsReserves_ | PoolWithReserves[] | An array containing all Pool data with adjusted reserves scaled to 1e12 |
getAllPoolsReservesAdjusted ​
Get an array of all Pool addresses, their token addresses, adjusted collateral reserves, and adjusted debt reserves
expected to be called via callStatic
function getAllPoolsReservesAdjusted() public returns (PoolWithReserves[] memory poolsReserves_);
Returns
Name | Type | Description |
---|---|---|
poolsReserves_ | PoolWithReserves[] | An array containing all Pool data with adjusted reserves scaled to 1e12 |