Skip to content

IFluidVault ​

common Fluid vaults interface, some methods only available for vaults > T1 (type, simulateLiquidate, rebalance is different)

VAULT_ID ​

solidity
function VAULT_ID() external view returns (uint256)

returns the vault id

TYPE ​

solidity
function TYPE() external view returns (uint256)

returns the vault id

readFromStorage ​

solidity
function readFromStorage(bytes32 slot_) external view returns (uint256 result_)

reads uint256 data result_ from storage at a bytes32 storage slot_ key.

Tokens ​

solidity
struct Tokens {
  address token0;
  address token1;
}

ConstantViews ​

solidity
struct ConstantViews {
  address liquidity;
  address factory;
  address operateImplementation;
  address adminImplementation;
  address secondaryImplementation;
  address deployer;
  address supply;
  address borrow;
  struct IFluidVault.Tokens supplyToken;
  struct IFluidVault.Tokens borrowToken;
  uint256 vaultId;
  uint256 vaultType;
  bytes32 supplyExchangePriceSlot;
  bytes32 borrowExchangePriceSlot;
  bytes32 userSupplySlot;
  bytes32 userBorrowSlot;
}

constantsView ​

solidity
function constantsView() external view returns (struct IFluidVault.ConstantViews constantsView_)

returns all Vault constants

fetchLatestPosition ​

solidity
function fetchLatestPosition(int256 positionTick_, uint256 positionTickId_, uint256 positionRawDebt_, uint256 tickData_) external view returns (int256, uint256, uint256, uint256, uint256)

fetches the latest user position after a liquidation

updateExchangePrices ​

solidity
function updateExchangePrices(uint256 vaultVariables2_) external view returns (uint256 liqSupplyExPrice_, uint256 liqBorrowExPrice_, uint256 vaultSupplyExPrice_, uint256 vaultBorrowExPrice_)

calculates the updated vault exchange prices

updateExchangePricesOnStorage ​

solidity
function updateExchangePricesOnStorage() external returns (uint256 liqSupplyExPrice_, uint256 liqBorrowExPrice_, uint256 vaultSupplyExPrice_, uint256 vaultBorrowExPrice_)

calculates the updated vault exchange prices and writes them to storage

LIQUIDITY ​

solidity
function LIQUIDITY() external view returns (address)

returns the liquidity contract address

FluidLiquidateResult ​

solidity
error FluidLiquidateResult(uint256 colLiquidated, uint256 debtLiquidated)

rebalance ​

solidity
function rebalance(int256 colToken0MinMax_, int256 colToken1MinMax_, int256 debtToken0MinMax_, int256 debtToken1MinMax_) external returns (int256 supplyAmt_, int256 borrowAmt_)

simulateLiquidate ​

solidity
function simulateLiquidate(uint256 debtAmt_, bool absorb_) external

reverts with FluidLiquidateResult