VaultT4Oracle ​
Inherits:VaultOracleBase
Title: VaultT4Oracle
Per-vault oracle for T4 vaults (smart collateral + smart debt). Supports both same-pool and different-pool T4 vaults by always storing separate col and debt DEX params. When supply == borrow, immutables are simply duplicated (negligible extra cost: ~24 gas from 8 extra PUSHes).
Constants ​
USD_ORACLE ​
solidity
address internal immutable USD_ORACLECOL_DEX_POOL ​
solidity
address internal immutable COL_DEX_POOLCOL_TOKEN_0 ​
solidity
address internal immutable COL_TOKEN_0COL_TOKEN_1 ​
solidity
address internal immutable COL_TOKEN_1COL_SUPPLY_TOKEN_0_SLOT ​
solidity
bytes32 internal immutable COL_SUPPLY_TOKEN_0_SLOTCOL_SUPPLY_TOKEN_1_SLOT ​
solidity
bytes32 internal immutable COL_SUPPLY_TOKEN_1_SLOTCOL_EXCHANGE_PRICE_TOKEN_0_SLOT ​
solidity
bytes32 internal immutable COL_EXCHANGE_PRICE_TOKEN_0_SLOTCOL_EXCHANGE_PRICE_TOKEN_1_SLOT ​
solidity
bytes32 internal immutable COL_EXCHANGE_PRICE_TOKEN_1_SLOTCOL_TOKEN_0_NUM_PRECISION ​
solidity
uint256 internal immutable COL_TOKEN_0_NUM_PRECISIONCOL_TOKEN_0_DEN_PRECISION ​
solidity
uint256 internal immutable COL_TOKEN_0_DEN_PRECISIONCOL_TOKEN_1_NUM_PRECISION ​
solidity
uint256 internal immutable COL_TOKEN_1_NUM_PRECISIONCOL_TOKEN_1_DEN_PRECISION ​
solidity
uint256 internal immutable COL_TOKEN_1_DEN_PRECISIONDEBT_DEX_POOL ​
solidity
address internal immutable DEBT_DEX_POOLDEBT_TOKEN_0 ​
solidity
address internal immutable DEBT_TOKEN_0DEBT_TOKEN_1 ​
solidity
address internal immutable DEBT_TOKEN_1DEBT_BORROW_TOKEN_0_SLOT ​
solidity
bytes32 internal immutable DEBT_BORROW_TOKEN_0_SLOTDEBT_BORROW_TOKEN_1_SLOT ​
solidity
bytes32 internal immutable DEBT_BORROW_TOKEN_1_SLOTDEBT_EXCHANGE_PRICE_TOKEN_0_SLOT ​
solidity
bytes32 internal immutable DEBT_EXCHANGE_PRICE_TOKEN_0_SLOTDEBT_EXCHANGE_PRICE_TOKEN_1_SLOT ​
solidity
bytes32 internal immutable DEBT_EXCHANGE_PRICE_TOKEN_1_SLOTDEBT_TOKEN_0_NUM_PRECISION ​
solidity
uint256 internal immutable DEBT_TOKEN_0_NUM_PRECISIONDEBT_TOKEN_0_DEN_PRECISION ​
solidity
uint256 internal immutable DEBT_TOKEN_0_DEN_PRECISIONDEBT_TOKEN_1_NUM_PRECISION ​
solidity
uint256 internal immutable DEBT_TOKEN_1_NUM_PRECISIONDEBT_TOKEN_1_DEN_PRECISION ​
solidity
uint256 internal immutable DEBT_TOKEN_1_DEN_PRECISIONFunctions ​
constructor ​
solidity
constructor(
address usdOracle_,
DexParams memory colDex_,
DexParams memory debtDex_,
uint256 supplyEMode_,
uint256 borrowEMode_,
uint256 pegBufferPpmOperate_,
uint256 pegBufferPpmLiquidate_
) VaultOracleBase(supplyEMode_, borrowEMode_, pegBufferPpmOperate_, pegBufferPpmLiquidate_);_getExchangeRate ​
solidity
function _getExchangeRate(bool isOperate_, bool isRaw_) internal view override returns (uint256 exchangeRate_);_colDexParams ​
solidity
function _colDexParams() private view returns (DexParams memory);_debtDexParams ​
solidity
function _debtDexParams() private view returns (DexParams memory);_collateralName ​
solidity
function _collateralName() internal view override returns (string memory);_debtName ​
solidity
function _debtName() internal view override returns (string memory);_collateralDecimals ​
solidity
function _collateralDecimals() internal pure override returns (uint256);_debtDecimals ​
solidity
function _debtDecimals() internal pure override returns (uint256);_oracleConfigAddresses ​
solidity
function _oracleConfigAddresses()
internal
view
override
returns (
address usdOracle_,
address supplyToken0_,
address supplyToken1_,
address borrowToken0_,
address borrowToken1_,
address supplyDexPool_,
address borrowDexPool_
);