Skip to content

Structs ​

Git Source

Structs ​

Configs ​

solidity
struct Configs {
    uint16 supplyRateMagnifier;
    uint16 borrowRateMagnifier;
    uint16 collateralFactor;
    uint16 liquidationThreshold;
    uint16 liquidationMaxLimit;
    uint16 withdrawalGap;
    uint16 liquidationPenalty;
    uint16 borrowFee;
    address oracle;
    uint256 oraclePriceOperate;
    uint256 oraclePriceLiquidate;
    address rebalancer;
    uint256 lastUpdateTimestamp;
}

ExchangePricesAndRates ​

solidity
struct ExchangePricesAndRates {
    uint256 lastStoredLiquiditySupplyExchangePrice;
    uint256 lastStoredLiquidityBorrowExchangePrice;
    uint256 lastStoredVaultSupplyExchangePrice;
    uint256 lastStoredVaultBorrowExchangePrice;
    uint256 liquiditySupplyExchangePrice;
    uint256 liquidityBorrowExchangePrice;
    uint256 vaultSupplyExchangePrice;
    uint256 vaultBorrowExchangePrice;
    uint256 supplyRateLiquidity;
    uint256 borrowRateLiquidity;
    int256 supplyRateVault;
    int256 borrowRateVault;
    int256 rewardsRateSupply;
    int256 rewardsRateBorrow;
}

TotalSupplyAndBorrow ​

solidity
struct TotalSupplyAndBorrow {
    uint256 totalSupplyVault;
    uint256 totalBorrowVault;
    uint256 totalSupplyLiquidityOrDex;
    uint256 totalBorrowLiquidityOrDex;
    uint256 absorbedSupply;
    uint256 absorbedBorrow;
}

LimitsAndAvailability ​

solidity
struct LimitsAndAvailability {
    uint256 withdrawLimit;
    uint256 withdrawableUntilLimit;
    uint256 withdrawable;
    uint256 borrowLimit;
    uint256 borrowableUntilLimit;
    uint256 borrowable;
    uint256 borrowLimitUtilization;
    uint256 minimumBorrowing;
}

CurrentBranchState ​

solidity
struct CurrentBranchState {
    uint256 status;
    int256 minimaTick;
    uint256 debtFactor;
    uint256 partials;
    uint256 debtLiquidity;
    uint256 baseBranchId;
    int256 baseBranchMinima;
}

VaultState ​

solidity
struct VaultState {
    uint256 totalPositions;
    int256 topTick;
    uint256 currentBranch;
    uint256 totalBranch;
    uint256 totalBorrow;
    uint256 totalSupply;
    CurrentBranchState currentBranchState;
}

VaultEntireData ​

solidity
struct VaultEntireData {
    address vault;
    IFluidVault.ConstantViews constantVariables;
    Configs configs;
    ExchangePricesAndRates exchangePricesAndRates;
    TotalSupplyAndBorrow totalSupplyAndBorrow;
    LimitsAndAvailability limitsAndAvailability;
    VaultState vaultState;
    FluidLiquidityResolverStructs.UserSupplyData liquidityUserSupplyData;
    FluidLiquidityResolverStructs.UserBorrowData liquidityUserBorrowData;
}

UserPosition ​

solidity
struct UserPosition {
    uint256 nftId;
    address owner;
    bool isLiquidated;
    bool isSupplyPosition;
    int256 tick;
    uint256 tickId;
    uint256 beforeSupply;
    uint256 beforeBorrow;
    uint256 beforeDustBorrow;
    uint256 supply;
    uint256 borrow;
    uint256 dustBorrow;
}

LiquidationStruct ​

liquidation related data

Liquidity in with absirb will always be >= without asborb. Sometimes without asborb can provide better swaps, sometimes with absirb can provide better swaps. But available in with absirb will always be >= One

solidity
struct LiquidationStruct {
    address vault;
    address token0In;
    address token0Out;
    address token1In;
    address token1Out;
    uint256 inAmt;
    uint256 outAmt;
    uint256 inAmtWithAbsorb;
    uint256 outAmtWithAbsorb;
    bool absorbAvailable;
}

Properties

NameTypeDescription
vaultaddressaddress of vault
token0Inaddressaddress of token in
token0Outaddressaddress of token out
token1Inaddressaddress of token in (if smart debt)
token1Outaddressaddress of token out (if smart col)
inAmtuint256(without absorb liquidity) minimum of available liquidation
outAmtuint256(without absorb liquidity) expected token out, collateral to withdraw
inAmtWithAbsorbuint256(absorb liquidity included) minimum of available liquidation. In most cases it'll be same as inAmt but sometimes can be bigger.
outAmtWithAbsorbuint256(absorb liquidity included) expected token out, collateral to withdraw. In most cases it'll be same as outAmt but sometimes can be bigger.
absorbAvailablebooltrue if absorb is available

AbsorbStruct ​

solidity
struct AbsorbStruct {
    address vault;
    bool absorbAvailable;
}