Structs

Git Source

Structs

Configs

struct Configs {
    uint16 supplyRateMagnifier;
    uint16 borrowRateMagnifier;
    uint16 collateralFactor;
    uint16 liquidationThreshold;
    uint16 liquidationMaxLimit;
    uint16 withdrawalGap;
    uint16 liquidationPenalty;
    uint16 borrowFee;
    address oracle;
    uint256 oraclePrice;
    address rebalancer;
}

ExchangePricesAndRates

struct ExchangePricesAndRates {
    uint256 lastStoredLiquiditySupplyExchangePrice;
    uint256 lastStoredLiquidityBorrowExchangePrice;
    uint256 lastStoredVaultSupplyExchangePrice;
    uint256 lastStoredVaultBorrowExchangePrice;
    uint256 liquiditySupplyExchangePrice;
    uint256 liquidityBorrowExchangePrice;
    uint256 vaultSupplyExchangePrice;
    uint256 vaultBorrowExchangePrice;
    uint256 supplyRateVault;
    uint256 borrowRateVault;
    uint256 supplyRateLiquidity;
    uint256 borrowRateLiquidity;
    uint256 rewardsRate;
}

TotalSupplyAndBorrow

struct TotalSupplyAndBorrow {
    uint256 totalSupplyVault;
    uint256 totalBorrowVault;
    uint256 totalSupplyLiquidity;
    uint256 totalBorrowLiquidity;
    uint256 absorbedSupply;
    uint256 absorbedBorrow;
}

LimitsAndAvailability

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

CurrentBranchState

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

VaultState

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

VaultEntireData

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

UserPosition

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 Two will always be >= One. Sometimes One can provide better swaps, sometimes Two can provide better swaps. But available in Two will always be >= One

struct LiquidationStruct {
    address vault;
    address tokenIn;
    address tokenOut;
    uint256 tokenInAmtOne;
    uint256 tokenOutAmtOne;
    uint256 tokenInAmtTwo;
    uint256 tokenOutAmtTwo;
}

Properties

NameTypeDescription
vaultaddressaddress of vault
tokenInaddress
tokenOutaddress
tokenInAmtOneuint256
tokenOutAmtOneuint256
tokenInAmtTwouint256
tokenOutAmtTwouint256