Skip to content

FluidDexResolver ​

Git Source

Inherits:Variables, DexFactoryViews, DexActionEstimates, DexUserViews

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

Functions ​

constructor ​

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

getDexState ​

Get the current state of a DEX

solidity
function getDexState(address dex_) public view returns (DexState memory state_);

Parameters

NameTypeDescription
dex_addressThe address of the DEX

Returns

NameTypeDescription
state_DexStateA struct containing the current state of the DEX

getDexConfigs ​

Get the current configurations of a DEX

solidity
function getDexConfigs(address dex_) public view returns (Configs memory configs_);

Parameters

NameTypeDescription
dex_addressThe address of the DEX

Returns

NameTypeDescription
configs_ConfigsA struct containing the current configurations of the DEX

getDexSwapLimitsAndAvailability ​

Get the swap limits and availability for a DEX

solidity
function getDexSwapLimitsAndAvailability(address dex_)
    public
    view
    returns (SwapLimitsAndAvailability memory limitsAndAvailability_);

Parameters

NameTypeDescription
dex_addressThe address of the DEX

Returns

NameTypeDescription
limitsAndAvailability_SwapLimitsAndAvailabilityA struct containing the swap limits and availability for the DEX

getDexEntireData ​

Get the entire data for a DEX

expected to be called via callStatic

solidity
function getDexEntireData(address dex_) public returns (DexEntireData memory data_);

Parameters

NameTypeDescription
dex_addressThe address of the DEX

Returns

NameTypeDescription
data_DexEntireDataA struct containing all the data for the DEX

getDexEntireDatas ​

Get the entire data for multiple DEXes

expected to be called via callStatic

solidity
function getDexEntireDatas(address[] memory dexes_) public returns (DexEntireData[] memory datas_);

Parameters

NameTypeDescription
dexes_address[]An array of DEX addresses

Returns

NameTypeDescription
datas_DexEntireData[]An array of structs containing all the data for each DEX

getAllDexEntireDatas ​

Get the entire data for all DEXes

expected to be called via callStatic

solidity
function getAllDexEntireDatas() external returns (DexEntireData[] memory datas_);

Returns

NameTypeDescription
datas_DexEntireData[]An array of structs containing all the data for all DEXes

_getDexSwapLimitsAndAvailability ​

get the swap limits and availability for a DEX

solidity
function _getDexSwapLimitsAndAvailability(
    address dex_,
    address token0_,
    address token1_,
    uint256 utilizationLimitToken0Percent_,
    uint256 utilizationLimitToken1Percent_
) internal view returns (SwapLimitsAndAvailability memory limitsAndAvailability_);

Parameters

NameTypeDescription
dex_addressThe address of the DEX
token0_addressThe address of token0
token1_addressThe address of token1
utilizationLimitToken0Percent_uint256The utilization limit percentage for token0
utilizationLimitToken1Percent_uint256The utilization limit percentage for token1

Returns

NameTypeDescription
limitsAndAvailability_SwapLimitsAndAvailabilityA struct containing the swap limits and availability for the DEX