Skip to content

FluidDexReservesResolver ​

Git Source

Inherits:DexFactoryViews, DexActionEstimates

Fluid Dex Reserves resolver Implements various view-only methods to give easy access to Dex protocol reserves data.

Functions ​

constructor ​

solidity
constructor(address factory_, address liquidity_, address liquidityResolver_)
    Variables(factory_, liquidity_, liquidityResolver_);

getPool ​

Get a Pool's address and its token addresses

solidity
function getPool(uint256 poolId_) public view returns (Pool memory pool_);

Parameters

NameTypeDescription
poolId_uint256The ID of the Pool

Returns

NameTypeDescription
pool_PoolThe Pool data

getPoolFee ​

Get a Pool's fee

solidity
function getPoolFee(address pool_) public view returns (uint256 fee_);

Parameters

NameTypeDescription
pool_addressThe Pool address

Returns

NameTypeDescription
fee_uint256The Pool fee as 1% = 10000

getAllPools ​

Get an array of all Pool addresses and their token addresses

solidity
function getAllPools() public view returns (Pool[] memory pools_);

Returns

NameTypeDescription
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

solidity
function getPoolReserves(address pool_) public returns (PoolWithReserves memory poolReserves_);

Parameters

NameTypeDescription
pool_addressThe Pool address

Returns

NameTypeDescription
poolReserves_PoolWithReservesThe 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

solidity
function getPoolsReserves(address[] memory pools_) public returns (PoolWithReserves[] memory poolsReserves_);

Parameters

NameTypeDescription
pools_address[]The array of Pool addresses

Returns

NameTypeDescription
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

solidity
function getAllPoolsReserves() public returns (PoolWithReserves[] memory poolsReserves_);

Returns

NameTypeDescription
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

solidity
function getPoolReservesAdjusted(address pool_) public returns (PoolWithReserves memory poolReserves_);

Parameters

NameTypeDescription
pool_addressThe Pool address

Returns

NameTypeDescription
poolReserves_PoolWithReservesThe 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

solidity
function getPoolsReservesAdjusted(address[] memory pools_) public returns (PoolWithReserves[] memory poolsReserves_);

Parameters

NameTypeDescription
pools_address[]The array of Pool addresses

Returns

NameTypeDescription
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

solidity
function getAllPoolsReservesAdjusted() public returns (PoolWithReserves[] memory poolsReserves_);

Returns

NameTypeDescription
poolsReserves_PoolWithReserves[]An array containing all Pool data with adjusted reserves scaled to 1e12