Price Oracle
The Price Oracle component is a critical part of the Unstable Protocol, providing price data for collateral assets that is used to calculate collateralization ratios, determine liquidation events, and facilitate redemptions.
Oracle Interface
All oracles in the Unstable Protocol implement the IZkOracle
interface:
Get Market Rate
Get current market rate
getMarketRate()
Get Redemption Rate
Get redemption rate
getRedemptionRate()
Check Depeg Status
Check if asset is depegged
isDepegged()
Example: Get Asset Prices
Redemption Rate vs. Market Rate
Redemption Rate: The contract rate at which the collateral can be redeemed for the underlying asset.
Market Rate: The current market price of the collateral, which may differ from the redemption rate.
The protocol can be configured to use either rate through the useMarketRate
setting in the UnstableConfigurator.
Depeg Detection
The oracle system includes a mechanism to detect when a collateral asset has depegged from its expected value:
Depeg Threshold: A parameter that determines the maximum allowed divergence between redemption and market rates.
If the divergence exceeds this threshold, minting with that collateral can be automatically paused.
Oracle Implementation
Oracles can be implemented in various ways:
Direct Integration: For assets with on-chain price data
Chainlink Oracles: For reliable, decentralized price feeds
Custom ZkOracles: For assets requiring more complex verification
Last updated