TAI
  • How does TAI work?
    • Overview
    • Supported Collaterals
    • Liquidations and Auctions
    • Tokenomics
    • Governance
      • Goverance Process
      • Governance Parameters
    • Rewards
    • Audits
  • TAI Protocol: In-depth
    • Contracts
      • System Contracts
        • Core Module
          • SAFE Engine
          • Liquidation Engine
          • Accounting Engine
        • Auction Module
          • Increasing Discount Collateral Auction House
          • Debt Auction House
          • Surplus Auction House
        • Oracle Module
          • Oracle Relayer
          • Medianizer
            • DSValue
            • Governance Led Median
            • Chainlink Median
          • FSM
            • Oracle Security Module
        • Token Module
          • Token Adapters
          • System Coin: TAI
          • Protocol Token: RATE
          • Protocol Token Authority
        • Money Market Module
          • Tax Collector
        • Sustainability Module
          • Stability Fee Treasury
          • FSM Wrapper
          • Increasing Treasury Reimbursement
          • Mandatory Fixed Treasury Reimbursement
        • Automation Module
          • Collateral Auction Throttler
          • Single Spot Debt Ceiling Setter
          • ESM Threshold Setter
        • Governance Module
          • DSPause
        • Shutdown Module
          • Global Settlement
          • ESM
      • Proxy Infrastructure
        • DSProxy
        • Proxy Registry
      • Helper Contracts
        • SAFE Manager
      • Contract Addresses
    • Data APIs
      • API Endpoints
Powered by GitBook
On this page
  • 1. Summary
  • 2. Contract Variables & Functions
  • 3. Walkthrough
  • 4. Gotchas
  • 5. Failure Modes (Bounds on Operating Conditions & External Risk Factors)
  1. TAI Protocol: In-depth
  2. Contracts
  3. System Contracts
  4. Oracle Module
  5. Medianizer

DSValue

Simple price feed setter and getter

PreviousMedianizerNextGovernance Led Median

Last updated 2 years ago

1. Summary

This is a simple contract where authorized addresses can set a price and anyone can read it.

2. Contract Variables & Functions

Variables

  • isValid - boolean that signals whether the currently stored value is valid (greater than zero) or not

  • medianPrice - the current price feed

Modifiers

  • auth - modifier that checks whether an address can set the result. Inherited from .

Functions

  • getResultWithValidity() external view returns (bytes32, bool) - returns result and isValid

  • read() external view returns (uint256) - getter that only returns the result

  • updateResult(newResult: bytes32) - set a new result

  • restartValue() - set isValid to false

3. Walkthrough

Authorized functions can set a new medianPrice by calling updateResult. Anyone can read the medianPrice or read both the medianPrice and whether it isValid by calling read orgetResultWithValidity.

4. Gotchas

This oracle is entirely dependent on authed addresses to update them. They will not flag if they are stale.

5. Failure Modes (Bounds on Operating Conditions & External Risk Factors)

Authed address can set any arbitrary price. This will impact other components reading from the oracle.

ds-thing