Ivy
LIVE MARKETS OPEN INTEREST RESIDUAL HAIRCUT H ORACLE PYTH · LIVE
ivy / docs

Ivy Documentation

Everything under the hood of a perpetual-futures DEX that is structurally incapable of insolvency — the balance sheet, the three invariants, the trading mechanics, and the honest line between what runs today and what ships after audit.

ROBINHOOD CHAINPERCOLATOR ENGINEREAL PYTH PRICESTESTNET · PAPER-TRADED

#What is Ivy

Ivy is a permissionless perpetual-futures DEX on Robinhood Chain. You long or short any listed token with leverage. What makes Ivy different is not the trading — it's the settlement layer underneath it.

Most perp exchanges are one bad wick away from a hole in the balance sheet: winners are owed money the exchange doesn't have, and the fix is an ADL queue that picks victims, an "insurance fund" black box, or a socialized-loss email. Ivy ports the percolator risk-engine architecture (originally authored by Anatoly Yakovenko), which makes that entire failure class unrepresentable:

01
Backed exits — the haircut HCapital is senior, profit is junior. Nobody can ever withdraw more than actually exists on the balance sheet.
02
Queue-free ADL — A/K/F indicesWhen a liquidation leaves a hole, the loss socializes pro-rata across the winning side in O(1). No victim queue, no single trader punished.
03
Bounded cranksRepricing is capped per tick, so an oracle wick can never move open interest through more loss than the exchange budgeted for.
Ivy today runs the full engine against real, live Pyth oracle prices — but positions and USDC are paper-traded. There is no custody of real funds. The on-chain program exists and is devnet-next; mainnet is gated on audit. See Trust & status.

#Quickstart

  1. Enter the testnet — hit Enter Testnet. No signup, no wallet signature, no risk.
  2. Load an account — paste any 0x… wallet address. Your paper account is seeded with 10,000 USDC.
  3. Pick a market — 10 live markets in the left rail, each marked to a real oracle price (Pyth for majors, pinned DEX pairs for Robinhood-native tokens).
  4. Open a position — choose Long or Short, set size and leverage, review entry / margin / est. liquidation / fee, execute.
  5. Manage it — watch live PnL, ROE, your liquidation price, your ADL index, and your haircut-adjusted withdrawable value. Close whenever.
tip — the Solvency Engine panel at the bottom of the terminal shows the live balance
sheet: vault V, capital C, insurance I, residual, and the haircut H. Everything in the
docs below is visible there, live, while you trade.

#The engine — structural solvency

Every account and every market settles against one global balance sheet:

TermMeaning
VThe vault — every dollar that has actually entered the system (margin + fees).
C_totTotal trader capital — the sum of everyone's deposited margin. Senior.
IThe insurance buffer — accumulated from trading and liquidation fees.
ΣPnL⁺The sum of all unrealized winning PnL — what winners would like to withdraw. Junior.
Residual = V − (C_tot + I)the only money that can ever pay out profit — what exists beyond returning everyone's capital and the insurance buffer

The entire design follows from one rule: profit can only be paid out of the residual. Capital is always senior to profit. If the residual can't cover every open winner at once, winners are paid at a discount — the haircut — rather than the exchange writing a check it can't cash.

#Invariant 1 · the haircut H

H = clamp( min(Residual, ΣPnL⁺) / ΣPnL⁺ , 0 … 1 )the fraction of open profit the balance sheet can honor right now

When the system is healthy, H = 100% and profits are fully backed — withdrawing a winner pays out in full. If a violent move creates more paper profit than residual (the exact scenario that bankrupts normal exchanges), H drops below 1 and every winner's withdrawable profit scales by H. Losers and capital are untouched.

withdrawable = C + min(0, PnL) + max(0, PnL) · Hyour capital, minus your losses in full, plus your profits at the haircut rate
The terminal shows H at all times, and your positions table has a dedicated Withdraw (H) column — you always see exactly what you could take out right now.

#Invariant 2 · queue-free ADL (A / K / F)

Every market keeps two side-states — one for longs, one for shorts. Each side carries three lazy indices, updated in O(1) per event no matter how many accounts exist:

IndexWhat it accumulates
AThe deleverage factor — starts at 1. When a liquidation shrinks a side, A shrinks proportionally (A ×= OI_after / OI_before). Your effective position is basis × A / A_entry.
KThe mark index — price moves fold in as K += A × ΔP. Your PnL is read from the delta between K now and K at your entry snapshot.
FThe funding index — periodic funding accrues as F ±= A × rate, netted between sides the same lazy way.

When a liquidated account leaves a deficit the insurance buffer can't absorb, the loss socializes into the opposing side's K index — spread pro-rata across every winner on that side:

K_opposing += −Deficit / OI_opposingeveryone on the winning side absorbs a sliver; nobody gets singled out

#Invariant 3 · bounded cranks

Marks move by crank — a permissionless tick that folds the newest oracle price into K. The crank is bounded:

|ΔP| ≤ MAX_MOVE × P_last per ticka single update can never reprice the book by more than the budgeted step

A flash wick on the oracle therefore can't teleport the mark through a canyon of liquidations in one step — the price walks there tick by tick, each tick settling PnL, liquidations and funding inside a bounded loss budget. Combined with H, this is what makes the worst case slow and solvent instead of instant and bankrupt. It also doubles as a bad-tick guard against oracle glitches.

#Side recovery

If cascading liquidations grind one side's A factor down, that side walks a state machine instead of dying:

StateTriggerBehavior
NormalA ≥ 0.25Business as usual — opens and closes allowed.
DrainOnlyA < 0.25The side is winding down: closes only, no new exposure. Shown as a badge in the market rail.
ResetPending → NormalOI reaches 0Indices snapshot, the epoch increments, A resets to 1, and the side reopens fresh. Stale positions from the old epoch settle at their snapshot.

#Markets & leverage

MarketMax leverageOracle feed
SOL-PERP50×Pyth · SOL/USD
BONK-PERP20×Pyth · BONK/USD
WIF-PERP20×Pyth · WIF/USD
POPCAT-PERP20×Pyth · POPCAT/USD
PNUT-PERP20×Pyth · PNUT/USD
GOAT-PERP20×Pyth · GOAT/USD
MOODENG-PERP20×Pyth · MOODENG/USD
FARTCOIN-PERP20×Pyth · FARTCOIN/USD
CASHCAT-PERP20×DEX · pinned Robinhood pair
JUGGERNAUT-PERP10×DEX · pinned Robinhood pair

Listing is permissionless by design — any token with a reliable live price can carry a market, because the engine never takes directional risk it can't socialize safely. Majors mark to Pyth; Robinhood-native tokens with no Pyth feed mark to a pinned, deep-liquidity DEX pair (a fixed pool address, not a token search — so a thin copycat pool can never become the price). Robinhood natives carry tighter max leverage to reflect their oracle thinness. More markets ship as feeds are added.

#Positions, PnL & liquidation

Positions are isolated sub-accounts: each carries its own collateral C, entry snapshot, and liquidation price. One position blowing up never touches your others.

#Fees & funding

FeeRateWhere it goes
Trading fee0.06% of notionalInsurance buffer I → the residual that backs H
Liquidation fee0.50% of notionalInsurance buffer I
Fundingbilateral, periodicPaid between sides via the F index — only accrues when both sides have open interest

There is no fee switch pointed at a team wallet in the engine: fees exist to keep the balance sheet solvent. Fee capture for $IVY is a protocol-layer decision that ships with mainnet.

#Withdrawals & H

Your withdrawable balance is always computed under the haircut:

withdraw = C + min(0, PnL) + max(0, PnL) · H

#The oracle

#API reference

The testnet exposes a public read/write JSON API — the same one the terminal uses. Base URL: https://ivyrobinhood.xyz

EndpointMethodReturns
/api/configGETToken, network, markets, leverage caps, maintenance bps, oracle status.
/api/marketsGETAll markets: price, 24h move, funding, OI, per-side A/mode.
/api/market/:symGETOne market: price history + full long/short side-state (A, K, F, OI, epoch, mode).
/api/metricsGETThe balance sheet: V, I, C_tot, ΣPnL⁺, residual, haircut H, OI, leaderboard.
/api/accountPOST{wallet} → balances, positions with pnl / liq / withdraw(H) / adl.
/api/openPOST{wallet, sym, side, size, lev} → opens a position, returns the fill.
/api/closePOST{wallet, id} → closes a position, settles PnL under H.
# watch the balance sheet live
curl -s https://ivyrobinhood.xyz/api/metrics | jq '{residual, haircut, oi}'

# open a paper long: 2,500 USDC at 10× on WIF
curl -s -X POST https://ivyrobinhood.xyz/api/open \
  -H 'content-type: application/json' \
  -d '{"wallet":"0xYourAddress","sym":"WIF","side":"long","size":2500,"lev":10}'

#$IVY token

#Trust & status — what's real today

LayerStatus
Risk engineReal & running — the full percolator port (H, A/K/F, bounded cranks, side recovery) settles every trade on this site.
PricesReal — live Pyth oracle feeds, ~2.5s cadence.
Positions & USDCPaper — simulated balances, no deposits, no custody, zero real-fund risk.
On-chain programBuilt — the engine exists as a chain program (fixed-point, on-chain oracle, permissionless liquidation); deploying to testnet next.
MainnetGated on audit — the reference engine is experimental and unaudited; we will not custody real funds before an audit.
Perpetual futures with leverage are extremely high-risk instruments — positions can liquidate to zero. Ivy's testnet is deliberately paper-traded so you can learn the engine with none of that risk. Nothing on this site is financial advice.

#Road to mainnet

PhaseScopeStatus
P0 · TestnetFull engine + terminal on live Pyth prices, paper-tradedLIVE
P1 · ProgramThe engine as an on-chain program: custody, on-chain oracle, permissionless crank & liquidationBuilt — devnet next
P2 · HardeningPublic testnet of the program, keeper network, $IVY fee routingNext
P3 · MainnetAudited deployment, real collateral, permissionless listingsGated on audit

Enter the testnet →  Read the FAQ