Skip to content

VaultT3Oracle ​

Git Source

Inherits:VaultOracleBase

Title: VaultT3Oracle

Per-vault oracle for T3 vaults (normal collateral + smart debt via DEX LP shares). All DEX data and supply token are cached as immutables.

Constants ​

USD_ORACLE ​

solidity
address internal immutable USD_ORACLE

SUPPLY_TOKEN ​

solidity
address internal immutable SUPPLY_TOKEN

DEX_POOL ​

solidity
address internal immutable DEX_POOL

TOKEN_0 ​

solidity
address internal immutable TOKEN_0

TOKEN_1 ​

solidity
address internal immutable TOKEN_1

BORROW_TOKEN_0_SLOT ​

solidity
bytes32 internal immutable BORROW_TOKEN_0_SLOT

BORROW_TOKEN_1_SLOT ​

solidity
bytes32 internal immutable BORROW_TOKEN_1_SLOT

EXCHANGE_PRICE_TOKEN_0_SLOT ​

solidity
bytes32 internal immutable EXCHANGE_PRICE_TOKEN_0_SLOT

EXCHANGE_PRICE_TOKEN_1_SLOT ​

solidity
bytes32 internal immutable EXCHANGE_PRICE_TOKEN_1_SLOT

TOKEN_0_NUM_PRECISION ​

solidity
uint256 internal immutable TOKEN_0_NUM_PRECISION

TOKEN_0_DEN_PRECISION ​

solidity
uint256 internal immutable TOKEN_0_DEN_PRECISION

TOKEN_1_NUM_PRECISION ​

solidity
uint256 internal immutable TOKEN_1_NUM_PRECISION

TOKEN_1_DEN_PRECISION ​

solidity
uint256 internal immutable TOKEN_1_DEN_PRECISION

Functions ​

constructor ​

solidity
constructor(
    address usdOracle_,
    address supplyToken_,
    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_);

_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 view 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_
    );