Skip to content

Structs ​

PricesAndExchangePrice ​

solidity
struct PricesAndExchangePrice {
  uint256 lastStoredPrice;
  uint256 centerPrice;
  uint256 upperRange;
  uint256 lowerRange;
  uint256 geometricMean;
  uint256 supplyToken0ExchangePrice;
  uint256 borrowToken0ExchangePrice;
  uint256 supplyToken1ExchangePrice;
  uint256 borrowToken1ExchangePrice;
}

ExchangePrices ​

solidity
struct ExchangePrices {
  uint256 supplyToken0ExchangePrice;
  uint256 borrowToken0ExchangePrice;
  uint256 supplyToken1ExchangePrice;
  uint256 borrowToken1ExchangePrice;
}

CollateralReserves ​

solidity
struct CollateralReserves {
  uint256 token0RealReserves;
  uint256 token1RealReserves;
  uint256 token0ImaginaryReserves;
  uint256 token1ImaginaryReserves;
}

CollateralReservesSwap ​

solidity
struct CollateralReservesSwap {
  uint256 tokenInRealReserves;
  uint256 tokenOutRealReserves;
  uint256 tokenInImaginaryReserves;
  uint256 tokenOutImaginaryReserves;
}

DebtReserves ​

solidity
struct DebtReserves {
  uint256 token0Debt;
  uint256 token1Debt;
  uint256 token0RealReserves;
  uint256 token1RealReserves;
  uint256 token0ImaginaryReserves;
  uint256 token1ImaginaryReserves;
}

DebtReservesSwap ​

solidity
struct DebtReservesSwap {
  uint256 tokenInDebt;
  uint256 tokenOutDebt;
  uint256 tokenInRealReserves;
  uint256 tokenOutRealReserves;
  uint256 tokenInImaginaryReserves;
  uint256 tokenOutImaginaryReserves;
}

SwapInMemory ​

solidity
struct SwapInMemory {
  address tokenIn;
  address tokenOut;
  uint256 amtInAdjusted;
  address withdrawTo;
  address borrowTo;
  uint256 price;
  uint256 fee;
  uint256 revenueCut;
  bool swap0to1;
  int256 swapRoutingAmt;
  bytes data;
}

SwapOutMemory ​

solidity
struct SwapOutMemory {
  address tokenIn;
  address tokenOut;
  uint256 amtOutAdjusted;
  address withdrawTo;
  address borrowTo;
  uint256 price;
  uint256 fee;
  uint256 revenueCut;
  bool swap0to1;
  int256 swapRoutingAmt;
  bytes data;
  uint256 msgValue;
}

DepositColMemory ​

solidity
struct DepositColMemory {
  uint256 token0AmtAdjusted;
  uint256 token1AmtAdjusted;
  uint256 token0ReservesInitial;
  uint256 token1ReservesInitial;
}

WithdrawColMemory ​

solidity
struct WithdrawColMemory {
  uint256 token0AmtAdjusted;
  uint256 token1AmtAdjusted;
  uint256 token0ReservesInitial;
  uint256 token1ReservesInitial;
  address to;
}

BorrowDebtMemory ​

solidity
struct BorrowDebtMemory {
  uint256 token0AmtAdjusted;
  uint256 token1AmtAdjusted;
  uint256 token0DebtInitial;
  uint256 token1DebtInitial;
  address to;
}

PaybackDebtMemory ​

solidity
struct PaybackDebtMemory {
  uint256 token0AmtAdjusted;
  uint256 token1AmtAdjusted;
  uint256 token0DebtInitial;
  uint256 token1DebtInitial;
}

OraclePriceMemory ​

solidity
struct OraclePriceMemory {
  uint256 lowestPrice1by0;
  uint256 highestPrice1by0;
  uint256 oracleSlot;
  uint256 oracleMap;
  uint256 oracle;
}

Oracle ​

solidity
struct Oracle {
  uint256 twap1by0;
  uint256 lowestPrice1by0;
  uint256 highestPrice1by0;
  uint256 twap0by1;
  uint256 lowestPrice0by1;
  uint256 highestPrice0by1;
}

Implementations ​

solidity
struct Implementations {
  address shift;
  address admin;
  address colOperations;
  address debtOperations;
  address perfectOperationsAndSwapOut;
}

ConstantViews ​

solidity
struct ConstantViews {
  uint256 dexId;
  address liquidity;
  address factory;
  struct Structs.Implementations implementations;
  address deployerContract;
  address token0;
  address token1;
  bytes32 supplyToken0Slot;
  bytes32 borrowToken0Slot;
  bytes32 supplyToken1Slot;
  bytes32 borrowToken1Slot;
  bytes32 exchangePriceToken0Slot;
  bytes32 exchangePriceToken1Slot;
  uint256 oracleMapping;
}

ConstantViews2 ​

solidity
struct ConstantViews2 {
  uint256 token0NumeratorPrecision;
  uint256 token0DenominatorPrecision;
  uint256 token1NumeratorPrecision;
  uint256 token1DenominatorPrecision;
}