KANONELYSIUMElysium

How Kanon works

An AMM that quotes the market instead of discovering it. The price comes from HyperCore through Iris. The pool only decides the spread.

The price

Kanon reads Iris.getPriceNoOlderThan(asset, 20): the Hyperliquid oracle price, signed by the Iris signer set, at most 20 seconds old. A swap can carry a fresh signed payload. The vault applies it first, in the same transaction, then reads. A price older than 20 seconds reverts the swap. Asset ids are Hyperliquid mainnet perps: HYPE 159, BTC 0, ETH 1.

The spread

spread = a floor + recent move + up to a skew charge for skew, capped at a hard cap.

  • Recent move. The largest change in the oracle price since the last trade, decaying with a 60 second half-life. A trade after a 1% jump pays at least 1% more spread than a trade in a calm minute.
  • Skew. Only charged when a trade pushes inventory further from 50/50: a skew charge times how far it goes. Trades that rebalance the pool pay the floor.

Limits

  • Inventory stays between set bounds of pool value in the base token. A trade that would go past that reverts; trades back toward balance always go through.
  • One trade can take at most a set share of the output side of the pool.
  • The router enforces a minimum output and a deadline on every swap, deposit and withdrawal.

Liquidity

Deposits mint vault shares worth the deposit at the oracle price, in either token or both. Fees stay in the pool and raise the value of every share. Withdrawals pay both tokens pro rata, need no oracle, and stay open while the market is paused. The first 1,000 share units are locked forever so the first depositor cannot skew share prices.

Roles

  • Owner sets fee and risk parameters within hard bounds, unpauses, and can turn on the protocol fee switch (up to 50% of fees, 0 by default).
  • Guardian can pause swaps and deposits. Nothing else. It cannot unpause, change parameters or move funds.
  • Protocol fees, if switched on, are set aside per vault and can only be sent to the factory's fee recipient.

Why LPs lose less

In an x*y=k pool the price only moves when someone trades. After the market moves, the first arbitrageur buys the stale side and LPs pay the difference. Kanon already quotes the new price, so there is nothing stale to buy. In the test suite, over the same 300 price moves, arbitrage took $937.69 from x*y=k LPs and $0 from Kanon LPs, and every arbitrage attempt on Kanon lost to the spread.

Powered by Iris

Kanon gets every price from Iris, the HyperCore oracle for Elysium. On Elysium mainnet that is IrisOracle:

IrisOracle0xb2067D3D691477749d35a29bAe226b71ff3326E9
  • Each swap and deposit carries a signed Iris pull payload. The vault checks it and applies the price in the same transaction, then quotes from it.
  • A stale price makes the swap or deposit revert. No fill ever uses an old price.
  • Withdrawals need no price, so they always work.

More at irisoracle.xyz.

ELYSIUM Contracts