VaultT2Oracle ​
Inherits:VaultOracleBase
Title: VaultT2Oracle
Per-vault oracle for T2 vaults (smart collateral via DEX LP shares + normal debt). All DEX data and borrow token are cached as immutables.
Constants ​
USD_ORACLE ​
solidity
address internal immutable USD_ORACLEBORROW_TOKEN ​
solidity
address internal immutable BORROW_TOKENDEX_POOL ​
solidity
address internal immutable DEX_POOLTOKEN_0 ​
solidity
address internal immutable TOKEN_0TOKEN_1 ​
solidity
address internal immutable TOKEN_1SUPPLY_TOKEN_0_SLOT ​
solidity
bytes32 internal immutable SUPPLY_TOKEN_0_SLOTSUPPLY_TOKEN_1_SLOT ​
solidity
bytes32 internal immutable SUPPLY_TOKEN_1_SLOTEXCHANGE_PRICE_TOKEN_0_SLOT ​
solidity
bytes32 internal immutable EXCHANGE_PRICE_TOKEN_0_SLOTEXCHANGE_PRICE_TOKEN_1_SLOT ​
solidity
bytes32 internal immutable EXCHANGE_PRICE_TOKEN_1_SLOTTOKEN_0_NUM_PRECISION ​
solidity
uint256 internal immutable TOKEN_0_NUM_PRECISIONTOKEN_0_DEN_PRECISION ​
solidity
uint256 internal immutable TOKEN_0_DEN_PRECISIONTOKEN_1_NUM_PRECISION ​
solidity
uint256 internal immutable TOKEN_1_NUM_PRECISIONTOKEN_1_DEN_PRECISION ​
solidity
uint256 internal immutable TOKEN_1_DEN_PRECISIONFunctions ​
constructor ​
solidity
constructor(
address usdOracle_,
address borrowToken_,
DexParams memory dex_,
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);_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 view 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_
);