Mellow Protocol
  • 💡Overview
  • 🎛️MELLOW LRT PRIMITIVE
    • Overview
    • MultiVault
    • Simple-LRT
    • Interoperable vaults
    • Contract deployments
    • Security
    • Loyalty Points
      • Points in Symbiotic pre-deposit contracts
      • DeFi points integration instructions
    • User Tutorials
      • Deposit guide
      • Withdrawal guide
      • Emergency withdrawal guide (advanced)
    • API
  • 💧DVstETH vault
    • Overview
    • Contracts
      • 🏦Vault
      • 🔧VaultConfigurator
      • ⚖️Validators
        • ManagedValidator
        • ERC20SwapValidator
        • DefaultBondValidator
        • AllowAllValidator
      • 🧬Strategies
        • DefaultBondStrategy
        • SimpleDVTStakingStrategy
      • 🔎Oracles
        • ChainlinkOracle
        • ManagedRatiosOracle
      • 🧱Modules
        • DelegateModules
          • ERC20SwapModule
          • DefaultBondModule
          • StakingModule
        • ExternalModules
        • TvlModules
          • DefaultBondTvlModule
          • ERC20TvlModule
          • ManagedTvlModule
      • 🪛Utils
        • DepositWrapper
        • DefaultAccessControl
      • 🔐Security
        • AdminProxy
  • 🤖MELLOW ALM
    • Mellow permissionless vaults
      • Overview
      • Core
      • Contracts API
      • Strategies
        • Fearless Gearbox strategy
        • LStrategy
        • Uni V3 Boosted strategy
        • Pulse strategy
        • Pulse strategy V2
        • Tamper strategy
      • Governance parameters
      • Contracts specs
      • Tutorials
        • Contracts deployments
        • Deploy your own strategy
        • wstETH strategies deposit guide
      • Mellow contracts addresses
        • Mellow Protocol Addresses (Polygon)
        • Mellow Protocol Addresses (Mainnet)
        • Gearbox Fearless Strategy
        • Tamper Strategy
        • UniV3 Pulse wstETH-USDC
        • UniV3 Pulse V2 wstETH-USDC
        • Velodrome CL strategies
        • Aerodrome CL strategies
      • Glossary
      • FAQ
    • Mellow ALM Toolkit
      • Overview
      • 📘Domain objects
      • 🧩Components
      • 🍜Processes
      • 💎Core
      • 🔮Oracles
        • VeloOracle
      • 🎯Strategy
        • PulseStrategyModule
      • 🔌AMM Adapters
        • VeloAmmModule
      • 🚙Utility contracts
        • AmmDepositWithdrawModule
        • Counter
        • LpWrapper
        • VeloDeployFactory
    • Mellow Backtesting SDK
  • 🗄️Resources
    • Media kit
    • Twitter
    • Discord
Powered by GitBook
On this page
  • Overview
  • Key Features
  • Error Definitions
  • Constants
  • Methods:
  • Event
  1. DVstETH vault
  2. Contracts
  3. Oracles

ManagedRatiosOracle

ManagedRatiosOracle is a RatiosOracle

Overview

The ManagedRatiosOracle contract provides ratio management for underlying tokens within a vault. It allows updating and retrieving target ratios for the vault's assets using a 96-bit fixed-point precision system.

Key Features

  • Ratio Management: Sets and retrieves target ratios for vault tokens.

Error Definitions

  • InvalidLength: Raised if the number of ratios doesn't match the number of underlying tokens or if data is absent.

  • InvalidToken: The token hash does not match the stored ratios data hash.

  • InvalidCumulativeRatio: The cumulative sum of ratios does not match the expected value.

Constants

  • Q96: Fixed-point scaling constant (2^96) used for precise ratio calculations.

Methods:

  1. Ratio Management

    • updateRatios(address, bool, uint128[]): Updates the target ratios for a specific vault.

      • vault: The address of the vault.

      • isDeposit: A boolean indicating whether the ratios are for a deposit or a withdrawal.

      • ratiosX96: An array of ratios, each with 96-bit precision.

      • Errors:

        • InvalidLength: The number of ratios does not match the number of tokens.

        • InvalidCumulativeRatio: Cumulative ratio sum does not match Q96.

    • getTargetRatiosX96(address, bool): Retrieves the target ratios for a given vault.

      • vault: The address of the vault.

      • isDeposit: A boolean indicating whether the ratios are for a deposit or a withdrawal.

      • Errors:

        • InvalidLength: Data is missing.

        • InvalidToken: The stored token hash does not match the current hash.

Data Structures

  • Data

    • tokensHash (bytes32): Keccak256 hash of the tokens array to ensure consistency.

    • ratiosX96 (uint128[]): An array of ratios with 96-bit precision.

Event

  • ManagedRatiosOracleUpdateRatios(address, bool, uint128[]): Emitted when the target ratios are updated for a vault.

    • vault: The address of the vault.

    • isDeposit: A boolean indicating whether the ratios are for a deposit or a withdrawal.

    • ratiosX96: An array of updated target ratios.

PreviousChainlinkOracleNextModules
💧
🔎