Oracle

Oracle forms the bedrock of Sable Finance. It provides the essential price feed that correctly values users' collateral and safeguards the USDS borrowing and liquidation system.

Given the critical role of the oracle module, Sable Finance employs a dual oracle structure, using Pyth Network as the primary oracle and Chainlink as a secondary safeguard. Both oracles ensure a secure, reliable price feed for the Sable Finance ecosystem.

Design principles for Sable include:

  • Immutability: Oracle addresses are unchangeable

  • Redundancy: Two reputable, dependable oracle providers are used to avoid a single point of failure.

  • Reliability: Oracles must offer fast, accurate, and secure services.

Our use of the Pyth Network Oracle

Pyth Network provides an "always-available" price feed, updating every second. This rapid price feed enhances collateral valuation accuracy and efficiency, reducing protocol risks such as delayed liquidations and redemption frontrunning.

Unlike traditional oracles, which push prices from off-chain to on-chain at specific intervals, Pyth Network updates prices on-demand, i.e., whenever a user transaction on Sable that necessitates an oracle takes place.

When a user initiates a transaction requiring an oracle, the transaction incorporates a bundle of the latest price feed data. Wormhole nodes, who are responsible for bridging the price data from the Pyth Oracle Network, sign this data for verification on Pyth's contract on the BNB Chain. Only after verifying the price feed data signatures on-chain can the price feed be employed in Sable's system, ensuring security. The Pyth Network Oracle design provides two significant benefits: quick price updates and cost-efficiency. By avoiding the high gas consumption and potential unavailability during network congestion typically associated with regular on-chain price pushes in traditional oracles, we ensure a more efficient and reliable service.

Our usage of Chainlink oracle

Chainlink serves as our system's backup oracle. We selected Chainlink due to its proven reliability and its BNB/USD price feed update speed on the BNB Chain (27 sec/update).

Under normal circumstances, the Pyth Network oracle is the default choice. However, our price feed smart contract module verifies the freshness of Pyth's prices, taking into account the time lapse between the price feed data being included in the user's transaction and the time the transaction is executed on-chain. If the price feed is found to be older than Chainlink oracle's update frequency, Chainlink prices are used instead. This design ensures the price feed is always fresh, thereby maintaining the protocol's security.

Dynamic oracle fees

The protocol charges a minimal base fee rate for USDS borrowing and redemptions. To ensure a fair fee system and discourage frontrunning due to price feed delays, we have implemented a dynamic oracle rate design.

This dynamic oracle rate increases linearly for every second since the last price feed update, up to a maximum of 0.25%. Therefore, the dynamic oracle rate is dependent on network conditions, the time between transaction initiation and execution, and the oracle used (Pyth or Chainlink). In general, this one-off rate is considerably lower than other stablecoin products in the market, while still retaining essential guardrails to ensure protocol stability.

Last updated