FluidVaultResolver

Git Source

Inherits:Helpers

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

Functions

getVaultAddress

function getVaultAddress(uint256 vaultId_) public view returns (address vault_);

getVaultId

function getVaultId(address vault_) public view returns (uint256 id_);

getTokenConfig

function getTokenConfig(uint256 nftId_) public view returns (uint256);

getVaultVariablesRaw

function getVaultVariablesRaw(address vault_) public view returns (uint256);

getVaultVariables2Raw

function getVaultVariables2Raw(address vault_) public view returns (uint256);

getAbsorbedLiquidityRaw

function getAbsorbedLiquidityRaw(address vault_) public view returns (uint256);

getPositionDataRaw

function getPositionDataRaw(address vault_, uint256 positionId_) public view returns (uint256);

getTickHasDebtRaw

function getTickHasDebtRaw(address vault_, int256 key_) public view returns (uint256);

getTickDataRaw

function getTickDataRaw(address vault_, int256 tick_) public view returns (uint256);

getTickIdDataRaw

function getTickIdDataRaw(address vault_, int256 tick_, uint256 id_) public view returns (uint256);

getBranchDataRaw

function getBranchDataRaw(address vault_, uint256 branch_) public view returns (uint256);

getRateRaw

function getRateRaw(address vault_) public view returns (uint256);

getRebalancer

function getRebalancer(address vault_) public view returns (address);

getTotalVaults

function getTotalVaults() public view returns (uint256);

getAllVaultsAddresses

function getAllVaultsAddresses() public view returns (address[] memory vaults_);

getVaultConstants

function getVaultConstants(address vault_) internal view returns (IFluidVaultT1.ConstantViews memory constants_);

getVaultConfig

function getVaultConfig(address vault_) internal view returns (Configs memory configs_);

getExchangePricesAndRates

function getExchangePricesAndRates(
    address vault_,
    Configs memory configs_,
    LiquidityStructs.OverallTokenData memory liquiditySupplytokenData_,
    LiquidityStructs.OverallTokenData memory liquidityBorrowtokenData_
) internal view returns (ExchangePricesAndRates memory exchangePricesAndRates_);

getTotalSupplyAndBorrow

function getTotalSupplyAndBorrow(
    address vault_,
    ExchangePricesAndRates memory exchangePricesAndRates_,
    IFluidVaultT1.ConstantViews memory constantsVariables_
) internal view returns (TotalSupplyAndBorrow memory totalSupplyAndBorrow_);

getLimitsAndAvailability

function getLimitsAndAvailability(
    TotalSupplyAndBorrow memory totalSupplyAndBorrow_,
    ExchangePricesAndRates memory exchangePricesAndRates_,
    IFluidVaultT1.ConstantViews memory constantsVariables_,
    Configs memory configs_
) internal view returns (LimitsAndAvailability memory limitsAndAvailability_);

getVaultState

function getVaultState(address vault_) public view returns (VaultState memory vaultState_);

getVaultEntireData

function getVaultEntireData(address vault_) public view returns (VaultEntireData memory vaultData_);

getVaultsEntireData

function getVaultsEntireData(address[] memory vaults_) external view returns (VaultEntireData[] memory vaultsData_);

getVaultsEntireData

function getVaultsEntireData() external view returns (VaultEntireData[] memory vaultsData_);

positionByNftId

function positionByNftId(uint256 nftId_)
    public
    view
    returns (UserPosition memory userPosition_, VaultEntireData memory vaultData_);

positionsNftIdOfUser

function positionsNftIdOfUser(address user_) public view returns (uint256[] memory nftIds_);

vaultByNftId

function vaultByNftId(uint256 nftId_) public view returns (address vault_);

positionsByUser

function positionsByUser(address user_)
    external
    view
    returns (UserPosition[] memory userPositions_, VaultEntireData[] memory vaultsData_);

totalPositions

function totalPositions() external view returns (uint256);

getVaultLiquidation

fetches available liquidations

function getVaultLiquidation(address vault_, uint256 tokenInAmt_)
    public
    returns (LiquidationStruct memory liquidationData_);

Parameters

NameTypeDescription
vault_addressaddress of vault for which to fetch
tokenInAmt_uint256token in aka debt to payback, leave 0 to get max

Returns

NameTypeDescription
liquidationData_LiquidationStructliquidation related data. Check out structs.sol

getMultipleVaultsLiquidation

function getMultipleVaultsLiquidation(address[] memory vaults_, uint256[] memory tokensInAmt_)
    external
    returns (LiquidationStruct[] memory liquidationsData_);

getAllVaultsLiquidation

function getAllVaultsLiquidation() external returns (LiquidationStruct[] memory liquidationsData_);

constructor

constructor(address factory_, address liquidity_, address liquidityResolver_)
    Helpers(factory_, liquidity_, liquidityResolver_);