Skip to content

Structs ​

DexState ​

solidity
struct DexState {
  uint256 lastToLastStoredPrice;
  uint256 lastStoredPrice;
  uint256 centerPrice;
  uint256 lastUpdateTimestamp;
  uint256 lastPricesTimeDiff;
  uint256 oracleCheckPoint;
  uint256 oracleMapping;
  uint256 totalSupplyShares;
  uint256 totalBorrowShares;
  bool isSwapAndArbitragePaused;
  struct Structs.ShiftChanges shifts;
  uint256 token0PerSupplyShare;
  uint256 token1PerSupplyShare;
  uint256 token0PerBorrowShare;
  uint256 token1PerBorrowShare;
}

ShiftData ​

solidity
struct ShiftData {
  uint256 oldUpper;
  uint256 oldLower;
  uint256 duration;
  uint256 startTimestamp;
  uint256 oldTime;
}

CenterPriceShift ​

solidity
struct CenterPriceShift {
  uint256 shiftPercentage;
  uint256 duration;
  uint256 startTimestamp;
}

ShiftChanges ​

solidity
struct ShiftChanges {
  bool isRangeChangeActive;
  bool isThresholdChangeActive;
  bool isCenterPriceShiftActive;
  struct Structs.ShiftData rangeShift;
  struct Structs.ShiftData thresholdShift;
  struct Structs.CenterPriceShift centerPriceShift;
}

Configs ​

solidity
struct Configs {
  bool isSmartCollateralEnabled;
  bool isSmartDebtEnabled;
  uint256 fee;
  uint256 revenueCut;
  uint256 upperRange;
  uint256 lowerRange;
  uint256 upperShiftThreshold;
  uint256 lowerShiftThreshold;
  uint256 shiftingTime;
  address centerPriceAddress;
  address hookAddress;
  uint256 maxCenterPrice;
  uint256 minCenterPrice;
  uint256 utilizationLimitToken0;
  uint256 utilizationLimitToken1;
  uint256 maxSupplyShares;
  uint256 maxBorrowShares;
}

SwapLimitsAndAvailability ​

solidity
struct SwapLimitsAndAvailability {
  uint256 liquiditySupplyToken0;
  uint256 liquiditySupplyToken1;
  uint256 liquidityBorrowToken0;
  uint256 liquidityBorrowToken1;
  uint256 liquidityWithdrawableToken0;
  uint256 liquidityWithdrawableToken1;
  uint256 liquidityBorrowableToken0;
  uint256 liquidityBorrowableToken1;
  uint256 utilizationLimitToken0;
  uint256 utilizationLimitToken1;
  uint256 withdrawableUntilUtilizationLimitToken0;
  uint256 withdrawableUntilUtilizationLimitToken1;
  uint256 borrowableUntilUtilizationLimitToken0;
  uint256 borrowableUntilUtilizationLimitToken1;
  struct Structs.UserSupplyData liquidityUserSupplyDataToken0;
  struct Structs.UserSupplyData liquidityUserSupplyDataToken1;
  struct Structs.UserBorrowData liquidityUserBorrowDataToken0;
  struct Structs.UserBorrowData liquidityUserBorrowDataToken1;
  struct Structs.OverallTokenData liquidityTokenData0;
  struct Structs.OverallTokenData liquidityTokenData1;
}

DexEntireData ​

solidity
struct DexEntireData {
  address dex;
  struct IFluidDexT1.ConstantViews constantViews;
  struct IFluidDexT1.ConstantViews2 constantViews2;
  struct Structs.Configs configs;
  struct IFluidDexT1.PricesAndExchangePrice pex;
  struct IFluidDexT1.CollateralReserves colReserves;
  struct IFluidDexT1.DebtReserves debtReserves;
  struct Structs.DexState dexState;
  struct Structs.SwapLimitsAndAvailability limitsAndAvailability;
}

UserSupplyData ​

solidity
struct UserSupplyData {
  bool isAllowed;
  uint256 supply;
  uint256 withdrawalLimit;
  uint256 lastUpdateTimestamp;
  uint256 expandPercent;
  uint256 expandDuration;
  uint256 baseWithdrawalLimit;
  uint256 withdrawableUntilLimit;
  uint256 withdrawable;
  struct Structs.UserSupplyData liquidityUserSupplyDataToken0;
  struct Structs.UserSupplyData liquidityUserSupplyDataToken1;
  struct Structs.OverallTokenData liquidityTokenData0;
  struct Structs.OverallTokenData liquidityTokenData1;
}

UserBorrowData ​

solidity
struct UserBorrowData {
  bool isAllowed;
  uint256 borrow;
  uint256 borrowLimit;
  uint256 lastUpdateTimestamp;
  uint256 expandPercent;
  uint256 expandDuration;
  uint256 baseBorrowLimit;
  uint256 maxBorrowLimit;
  uint256 borrowableUntilLimit;
  uint256 borrowable;
  struct Structs.UserBorrowData liquidityUserBorrowDataToken0;
  struct Structs.UserBorrowData liquidityUserBorrowDataToken1;
  struct Structs.OverallTokenData liquidityTokenData0;
  struct Structs.OverallTokenData liquidityTokenData1;
}