Tiered Oracle
Moar Market uses a robust on-chain Tiered Oracle system to fetch secure and up-to-date prices for all supported assets. These prices are central to maintaining solvency, enforcing LTVs, and executing liquidations.
The system prioritizes safety and uptime through tiered resolution, timestamp-based freshness validation, and fallback logic.
π§± Oracle Sources and Tiers
Moarβs Tiered Oracle architecture supports multiple providers, ordered by trust and reliability. Each asset is assigned two tiers:
Tier 1 (Primary) β
Pyth
Tier 2 (Fallback) β
Switchboard
Prices are fetched from the primary source first. If the price is stale or unavailable, the fallback is used β but only if it's valid and fresh.
If both tiers are invalid or stale, the asset's price is marked broken, and any operation that depends on that price is blocked.
π Price Freshness & Enforcement
Each asset has two timing thresholds:
staleness_seconds
β the price is still usable but flagged as stalebroken_seconds
β the price is rejected entirely and marked broken
These ensure that only fresh and secure prices are used during:
Health checks
Borrowing
Liquidations
Strategy valuation
Price freshness is validated on-chain using timestamps provided by the oracle feeds. If a price exceeds its thresholds, the protocol either falls back to the secondary source or blocks the operation.
βοΈ How Price Resolution Works
When fetching the price of an asset, the Tiered Oracle resolves it using the following logic:
Query Tier 1
If the price is fresh β use it
If the price is stale or invalid β move to Tier 2
Query Tier 2
If the price is fresh β use it
If also stale or invalid β the oracle is marked broken, and price resolution fails
There is no fallback to stale data β either Tier 1 or Tier 2 must return a valid, fresh price for the asset to be considered priced.
This strict design ensures all health checks, liquidations, and borrowing operations are executed using only up-to-date oracle data, reducing risk from manipulation or downtime.
π§ Role in Protocol Operations
Prices returned by the Tiered Oracle are used throughout the Moar protocol:
Health checks β to evaluate whether Credit Accounts remain solvent
Liquidations β to determine asset and debt valuations
Strategy valuation β to calculate the real-time value of LP tokens or staked assets
Borrow caps β to ensure LTV enforcement across all pools
All pricing is enforced on-chain β ensuring transparency, verifiability, and resistance to manipulation.
Last updated