🔮Price Oracle
Maximally Trustless Prices
According to Chainlink,
Blockchain oracles are entities that connect blockchains to external systems, thereby enabling smart contracts to execute based upon inputs and outputs from the real world.
As evident in Liquidity and Leverage, for every vault, SIR requires accurate price data between the collateral and the debt token. SIR integrates the Uniswap v3 Oracle to ensure its price data is as trustless as possible. A wrapper contract around the Uniswap v3 oracle extends its functionality, enabling SIR to:
Selecting the most liquid fee tier: When SIR retrieves the price for a particular token pair from Uniswap v3, it can fetch it from different fee tiers. These are Uniswap v3 pools with the same pair of tokens but different fee structure. SIR selects the fee tier with the highest liquidity—a figure directly provided by Uniswap v3. The premise here is that pools with more liquidity are less likely to be manipulated.
Autonomous TWAP management: SIR autonomously handles adjustments to the Time-Weighted Average Price (TWAP), ensuring it selects the most liquid fee tier for accurate pricing. Although SIR typically employs a 15-minute TWAP, it recognizes that not all Uniswap v3 pairs have their price buffers fully initialized. To address this, the system incrementally extends the TWAP duration each time a mint/burn transaction occurs. This gradual extension distributes the initialization cost of the price buffer among many users.
Defense against multi-block price manipulation: The shift from Proof of Work (PoW) to Proof of Stake (PoS) in Ethereum introduced new attack surfaces for oracles. SIR addresses this risk by coupling its 15-minute TWAP with a price truncation mechanism. This strategy sets a cap on the maximum allowable price change per block, effectively neutralizing the impact of such attacks.
The Uniswap V3 Oracle
SIR's hypothesis is that any protocol can only be as trustless as its underlying layers of technology. For this reason SIR uses the Uniswap v3 oracle which is, in our opinion, the most trustless on-chain price oracle for the following reasons:
Oracle on Other Chains
SIR applies the same oracle principles on every chain it deploys to. The Oracle contract is configured per-chain with the appropriate DEX factory:
HyperEVM — uses HyperSwap pools for TWAP price data. HyperSwap follows the Uniswap V3 design, so the same fee-tier selection, TWAP management, and multi-block manipulation defenses apply.
MegaETH — uses Kumbaya pools for TWAP price data, again following the same Uniswap V3 oracle interface.
The core mechanism is identical: SIR selects the most liquid fee tier, autonomously manages the TWAP window, and applies price truncation to defend against manipulation. Only the DEX factory address differs between chains. See Deployments for the specific factory addresses.
Last updated