Skip to main content

Idea — Delta-Neutral Vault + Trading Terminal

ETHGlobal Mumbai (Nov 2026). Classic (from-scratch) track. Max 3 partner prizes. Code: https://github.com/snehendu098/maas · Chain: Base Sepolia (84532).

What we build​

  1. Trading terminal — spot + perp, markets BTC, ETH, HYPE, ZEC (all vs USDC). ✅ mostly done (#1–#11).
    • Spot = own Uniswap v4 pools (1 per market) + VaultFeeHook.
    • Perp = own orderbook: offchain matching (Rust engine/), onchain settlement (PerpExchange), cross margin, Pyth oracle.
  2. Vault — one USDC vault, delta-neutral across 4 markets. 🚧 in progress (#29–#34).

Vault rules​

  • Per market: long spot + equal perp short → earns funding.
  • Vault pays 0 fees in both markets.
    • Spot: hook returns fee 0 when sender == vault, 0.3% else.
    • Perp: PerpExchange.feeExempt[vault]. Counterparty still pays.
  • Mode per market: HEDGED ⇄ FLAT.
    • → FLAT: funding < 0 for whole last 3h (every print in window). Close short first, then sell spot.
    • → HEDGED: funding > 0 again. Buy spot first, then open short.
    • Window configurable (short for demo).
  • Rebalancing free. 0.1% fee only on user withdrawal (instant + queued).
  • Withdraw: instant from idle USDC buffer; remainder queued → keeper unwinds pro-rata → fulfills.
  • Configurable (owner): per-market weights, spot/short capital split (short leverage), idle buffer %, fee, window, cooldown.

Tracks (3 picks)​

#TrackRoleDoc
1Uniswap — Build with UniswapSpot pools + vault 0-fee swaps (v4 hook)tracks/uniswap.md
2Chainlink — Best workflow with CRERebalancer decision → vault setModetracks/chainlink-cre.md
3Arkiv — Build on Arkiv (from scratch)Public vault recordstracks/arkiv.md

Architecture​

Terminal (client/, Next.js)
├─ spot tab ──swap──▶ Uniswap v4 pools + VaultFeeHook
├─ perp tab ──signed orders──▶ gateway ─▶ engine (CLOB) ─▶ settler ─▶ PerpExchange
└─ vault tab ──reads──▶ vault contract + Arkiv (funding, decisions, snapshots)

keeper ── Pyth price, funding prints, liquidations ──▶ PerpExchange
recorder ── hourly batch (funding, decisions, snapshots) ──▶ Arkiv
CRE rebalancer (cron) ── reads funding (Arkiv / gateway) ── decides ── onReport → setMode ──▶ Vault
vault-keeper ── on ModeChanged / drift / withdraw queue ── executes legs (CLOB short + v4 swap)

Where data lives​

DataHomeWhy
Matching, live bookengine memoryspeed
Margin, positions, vault fundscontractsmoney = onchain
TradesPerpExchange events → indexer → Postgresalready onchain
Funding rates, vault decisions, vault snapshotsArkivpublic + verifiable, not otherwise onchain

Team + issues (vault phase)​

WhoIssues
snehendu098#29 vault contract, #31 CRE rebalancer
debanjannnn#10 perp terminal (finish), #33 vault page, #30 vault-keeper
Dragoon4002#32 Arkiv recorder, #34 sponsor docs + demo

Sync: #29 pushes IDeltaNeutralVault + ABI first → unblocks #30, #31, #33. #32 live → #31 + #33 switch from fallback/mock to Arkiv.