Skip to main content

Oracle-Based AMM

HyperAMM uses a hybrid oracle system instead of x*y=k to price trades. No bonding curve means no arbitrage-driven impermanent loss.

Why Oracles?

In traditional AMMs, prices come from pool reserves. When the market moves, arbitrageurs extract value from the pool — that's IL. Concentrated liquidity (Uni V3) makes it worse.

HyperAMM sidesteps this by pricing trades from external oracle data. The pool's own reserves don't determine price.

Hybrid Oracle Architecture

Different operations use different oracle sources:

Deposits & Withdrawals: Pyth Pull Oracle

Deposits and withdrawals use Pyth Network pull oracles with:

  • Strict staleness checks — Prices must be fresh within a tight age threshold
  • Confidence bands — Pyth's confidence intervals protect LPs from price manipulation

Pricing always favors existing LPs:

  • Deposits get the less favorable end of the confidence band
  • Withdrawals get the less favorable end for the withdrawer

This prevents arb bots from exploiting stale or uncertain prices to drain the pool.

Swaps: HyperCore Prices

Swaps use HyperCore's native price data:

  1. Perpetual BBO — Real-time order book prices
  2. Mark price — Fair value from the exchange
  3. Oracle price — Hyperliquid's aggregate oracle
  4. Pyth push oracle — For stablecoin pairs (e.g., USDC/USDT0), maintained by the protocol's oracle updater

This enables atomic swap settlement — the swap completes in a single transaction, no waiting for oracle updates.

Why different oracles for swaps vs. deposits?

Swaps need to settle atomically in one tx — waiting for a pull oracle update would make them async. Core's built-in prices are available instantly via L1 state reads. Deposits and withdrawals are already async (executed by keepers next block), so they can use the pull oracle.

Comparison

x*y=k AMM (Uniswap)HyperAMM
Price sourcePool reservesExternal oracles
IL riskHigh (especially concentrated)Zero (hedged atomically)
Price discoveryVia arbitrage (LPs pay the cost)Via oracles (no LP cost)
Capital efficiencyModerate (V3 concentrated)High (oracle-driven)
MEV exposureSandwich attacks, JIT liquidityReduced (oracle-based pricing)