Mento Protocol
  • Mento Protocol
    • Home
    • What, why, who Mento?
    • Quick Links
  • HOW TO SOURCE MENTO STABLES
    • Overview
    • CEXs, DEXs, Pools
    • From other Chains
    • On-ramp Providers
    • Automation via MATE
  • Protocol Concepts
    • Stability
    • Reserve
    • Asset exchanges
      • Broker
      • Trading Limits
      • Exchange Providers
      • BiPoolManager
    • Oracles
    • On-Chain Circuit Breaker
    • Governance
      • Verification
  • Developers
    • Repository Overview
    • Integrate Mento Stables
    • Smart Contracts
      • Broker
      • TradingLimits
      • BiPoolManager
      • Pricing Modules
      • SortedOracles
      • BreakerBox
      • Reserve
      • StableToken
      • Audits
    • Deployments
      • Addresses
      • Verification
      • Parameters
    • Mento SDK
      • Installation
      • Guides
        • Getting Exchange Pairs
        • Getting a Quote
        • Initiating a Swap
    • Oracles
      • Oracle Client
        • Price Sources
      • Becoming an Oracle Provider
  • Economics
    • Stability
    • Risks
    • Research
  • Governance & Token
    • Overview
    • Governance Components
    • Governance Scope
    • MENTO Token
      • Listing information
    • Airdrop
    • Governance Watchdogs
Powered by GitBook
On this page
  • MedianDeltaBreaker
  • ValueDeltaBreaker
Edit on GitHub
  1. Developers
  2. Smart Contracts

BreakerBox

PreviousSortedOraclesNextReserve

Last updated 1 year ago

BreakerBox is an on-chain circuit breaker for oracles. It maintains a state for each price feed, whether trading is allowed or suspended. It is modular by design and allows for flexible addition and deletion of price feeds and individual breaking logic. Its conditions are checked and breakers are triggered if necessary by newly reported rates in SortedOracles.sol. For each requested swap, BiPoolManager.sol checks against this contract whether trading a specific pair is currently allowed or suspended.

MedianDeltaBreaker

MedianDeltaBreaker is a circuit breaker that trips when the current median oracle rate compared to an exponential moving average over previous median rates exceeds a configured relative threshold.

ValueDeltaBreaker

ValueDeltaBreaker is a circuit breaker that trips when the current median oracle rate compared to a fixed reference rate exceeds a configured relative threshold.

https://github.com/mento-protocol/mento-core/blob/main/contracts/oracles/BreakerBox.sol
BreakerBox.sol
https://github.com/mento-protocol/mento-core/blob/main/contracts/oracles/breakers/MedianDeltaBreaker.sol
MedianDeltaBreaker.sol
https://github.com/mento-protocol/mento-core/blob/main/contracts/oracles/breakers/ValueDeltaBreaker.sol
ValueDeltaBreaker.sol