About SVX
SVX is a fully-automated cross-venue volatility arbitrage bot for the DeepBook Predict track. It captures pricing disagreements between Predict's continuous SVI surface and Polymarket's discrete-strike order book, then delta-hedges the residual exposure on Hyperliquid. Three venues, one bot, pure-vol PnL.
SVI-parameterized vol surface gives the continuous fair probability for every BTC strike. On testnet we also execute against the surface directly with dUSDC; on mainnet (pending Sui mainnet) we use Predict only as our quote engine.
Live on Polygon mainnet. Buys Yes/No outcome shares when Predict's fair value disagrees with Polymarket's book by > threshold. Auto-redeems winning shares via the NegRiskAdapter once UMA settles.
Every Polymarket fill triggers a delta-sized BTC perp on Hyperliquid — short when we bought Yes, long when we bought No. Closes on settlement. Strips directional BTC exposure.
How it works
- 1Pull oracles + Polymarket books (every 15s)Predict gives
w(k) = a + b · (ρ(k − m) + √((k − m)² + σ²))for every oracle; we extract IV at each Polymarket strike and reprice the binary at the Polymarket expiry (flat-vol-across-expiries reprice — extends the trading window). - 2Compute spread, decide sideIf
P_predict − P_poly_ask > thresholdwe buy Yes on Poly (cheap). The opposite spread side buys No. Default threshold is 3 percentage points. - 3Risk-gate → execute Polymarket legPer-trade pUSD cap, open-position count cap, daily-loss limit, book-depth floor, and a manual kill switch. Submit market-buy via the Polymarket CLOB.
- 4Delta-sized HL hedgeCompute
|Δ| = φ(d₂) / (S · √w)at the matched strike + Poly expiry. Open a BTC perp of size|Δ| × shareson the opposite side. Risk gates: per-trade cap, total exposure cap, daily HL-loss limit. - 5Settlement + auto-redeemEvery 5 min the bot polls Polymarket gamma for UMA resolution. On settlement: mark PnL, call CTF redeem (NegRiskAdapter / ConditionalTokens), close the HL hedge with a reduce-only IOC. Combined PnL lands on the dashboard.
Safety posture
Single-operator. No users, no pooled funds, no tokenized shares, no on-chain Move package shipped by SVX itself — we compose with existing protocols only.
Every risk gate is mandatory: per-trade caps, daily loss limits (separate dUSDC / pUSD / HL stacks), staleness checks, book-depth floor, consecutive-loss circuit breaker, filesystem kill switch. Auto-pauses on breach; resume is explicit operator action.
Edge sources
Polymarket stickiness: their books update in human time; SVI moves faster. Most early edge is Predict re-pricing while Polymarket lags.
Cross-expiry repricing: Predict's IV is expiry-invariant under flat-vol, so we can compare to any Polymarket expiry (not just ±1h).
Edge decays as more bots run this systematically. Built into the spec.
Hackathon spec — Idea #7, verbatim
From the DeepBook Predict problem statement: "the single most realistic mainnet-day-one strategy — and it doubles as live stress test of the SVI feeder."
| Spec requirement | What SVX built |
|---|---|
Back-solves Predict's implied vol from OracleSVI | SVI evaluator + Newton/bisection IV inversion, validated against Python reference vectors. 36 math tests pass. |
Compares against Polymarket BTC option smile at matching expiry | Cross-expiry SVI reprice in signal/spread.ts — flat-vol assumption lets us compare to any Polymarket expiry, not just ±1h. |
Trades the spread when it exceeds a threshold | Live on Polygon mainnet via POLY_1271 Deposit Wallet flow. Default spread threshold 3pp; tunable in tunables.ts. |
stretch Stretch: delta-hedge the binary on Hyperliquid perps | Every Polymarket fill triggers a binary-delta-sized BTC perp on the opposite side. PnL becomes pure-vol edge instead of directional bet. |
Handle stale SVI updates gracefully | maxSviStalenessSec gate. Stale oracle → signal filtered with reason svi_stale, visible on /signals. |
Kill switch on feeder lag | Filesystem flag (/tmp/svx-paused), ledger-persisted pause, and three independent daily-loss circuit breakers (dUSDC / pUSD / HL). |
Minimum requirement: works end-to-end | Predict mint (testnet), Polymarket fill + auto-redeem (mainnet), HL perp hedge + close (mainnet). All four legs settle on-chain. |
Why two networks?
The dashboard shows a testnet bot and a mainnet bot side-by-side. They're not redundant — each demonstrates a piece the other can't.
DeepBook Predict has no mainnet deployment yet — testnet is the only place the protocol lives today. The testnet bot mints binary positions with predict::mint, settles via predict::redeem_permissionless, and reads the SVI surface from the live oracle feed. It exists to prove the entire Predict integration path works end-to-end on real Move calls, with real (faucet) dUSDC. That's the minimum-requirement bar from the spec: "Work end-to-end if you are building a product, we will test the entire flow."
The mainnet bot uses Predict (testnet) as its pricing brain — the SVI surface drives every signal — while executing the resulting trades on Polymarket (Polygon mainnet) and hedging on Hyperliquid (mainnet). PnL on this bot is real money. This is what "mainnet-day-one" actually means: the cross-venue logic, the SVI-driven spread detection, the order submission, the settlement reconciliation, and the delta-hedge are all live today against real liquidity. The only piece waiting on Predict's Sui-mainnet launch is the on-chain Sui mint — that's a single config flip (MAINNET_PAPER_TRADING=false), not a code change.
What SVX becomes on Predict mainnet
Phase 1 today → Phases 2–4 on Predict mainnet-day-one. The single-operator architecture exists so each subsequent phase is additive — never a rewrite. No promises beyond the time-scale words below; no signup, no pooled funds, no tokenised shares today.
- 1Single-operator bot — live todayTrades the operator's own dUSDC + pUSD + HL margin. No users, no pooled funds, no tokenised shares. Proves the end-to-end strategy works under real liquidity.
- 2Public SVI calibration feeder (Predict mainnet, week 1)The bot already back-solves Predict's IV from the SVI surface and compares it to Polymarket's implied vol every 15s. We publish that comparison as a free read-only feed — other Predict strategies, vaults, and risk dashboards can subscribe to "is the SVI surface currently consistent with external venues, by how much, in which direction." Zero trust, just data.
- 3Open-source template (Predict mainnet, month 1)One operator can clone the repo and stand up their own SVX in <30 min (Quickstart + Mainnet runbook are already there for this reason). The more independent SVX instances run, the tighter Predict's surface stays calibrated against external venues. This is exactly the "live stress test of the SVI feeder" the spec asks for, run by many parties.
- 4Tokenised cross-venue arb vault (post-audit)A future Move package wraps the bot in a vault: LPs deposit dUSDC, receive a transferable share token (composable with
deepbook_margin/iron_bank/ structured products), and the bot trades on the vault's behalf. Combined PnL distributed pro-rata. This phase requires a Move audit + legal review (security-token classification depends on jurisdiction). Deliberately out of scope for the hackathon — the single-operator architecture exists so this is an additive evolution, not a rewrite.
Phases 2–4 are commitments to direction, not dates beyond the time-scale words above. They drop out the moment they would require pooling user funds before audit and legal sign-off.
Limitations & honest tradeoffs
Where we knowingly cut scope or accepted a structural constraint. Worth saying out loud rather than papering over.
- Vol-arb on perps isn't classical vol-arbClassical vol-arb captures vol mispricing via gamma (long/short options). Perps are linear — they only profit on direction. So the Hyperliquid vol-arb strategy is more accurately "directional perp triggered by IV-RV divergence + surface skew." On the Polymarket leg we DO capture vol edge (binaries have curvature), but the standalone HL vol-arb relies on directional conviction. Calling it out so judges read the strategy correctly.
- Predict positions can't exit before settlementThe protocol exposes
mintandredeem_permissionlessonly — noburnor secondary market. Once minted, a position is locked until the oracle settles. We compensate by adding mid-life exit on the Polymarket leg (sells back when mark P&L crosses +20% of cost), so we capture the spread the moment the markets converge instead of waiting hours for UMA. The Predict leg still rides to expiry — that's a protocol property, not a bot bug. - Cross-expiry reprice assumes flat-volPredict oracles have short expiries (sub-hour); Polymarket markets are typically end-of-day or end-of-week. To compare them we treat Predict's IV as expiry-invariant (flat-vol assumption) and reprice the binary at the Polymarket expiry. This is exact under the assumption and approximate when the term structure has slope. Accepted as a simplification — adding a full term-structure model is future work.
- POLY_1271 Deposit-Wallet setup is manualPolymarket's May 2026 rollout requires a smart-contract Deposit Wallet for new accounts. The bot supports POLY_1271 mode (the only mode that works for new signups), but deploying the DW + re-deriving the L2 API key against it is a one-time manual step at polymarket.com. Documented in the runbook; not automatable today.
- No Move package shipped by SVXDeliberate — every line of Move ships an audit surface. SVX composes with
predict::*andpredict_manager::*via Sui RPC only, no custom contracts. Trade-off: we can't ship tokenized vault shares or pool-with-others primitives. For the hackathon-bot category that's the right call; for a full-vault product it'd be a future iteration with proper audit. - Edge decays as more bots run thisCross-venue convergence trades have finite edge by construction — every additional bot tightens the spread. The spec acknowledges this. Once Predict has full mainnet deployment, the bot's per-trade PnL will compress as other arbs enter. Building this strategy now is about being one of the first feeders helping calibrate Predict's surface against external venues, not about long-term cash-printing.
Judging criteria mapping
Fork & run your own
Walkthrough for a fresh operator wanting to clone the repo and stand up their own instance.
- 1Clone + install
git clone https://github.com/Econmartin/svx && pnpm install. Monorepo:svx-bot,svx-dashboard,svx-shared. Node 18+, pnpm 8+. - 2Generate operator wallets (one per venue)
pnpm --filter svx-bot setup-managerfor Sui;generate-poly-walletfor Polygon;generate-hl-walletfor Hyperliquid. Each prints the keypair once — copy the private keys into your env. - 3(Mainnet only) Polymarket Deposit Wallet setupLog in to polymarket.com with the EOA, complete one tiny manual trade to deploy the Deposit Wallet (POLY_1271 mode), then run
pnpm --filter svx-bot derive-poly-api-key-1271to re-derive the L2 API key against the DW. See runbook §1.4.5. - 4Fund the walletsTestnet dUSDC from the Mysten faucet (form linked in the spec). Mainnet pUSD: Kraken USDC → Polygon → wrap via
wrap-usdce-to-pusd→send-pusd-to-proxy. HL USDC: Kraken USDC → Arbitrum → bridge into HL via app.hyperliquid.xyz Portfolio → Deposit. - 5Boot the stack (Docker Compose)
docker compose up -d. The compose file wires three services:bot(testnet),bot-mainnet, anddashboard. Coolify handles secrets + routing in production; locally just set env vars in a.envat the workspace root. - 6Tune the strategyOpen
packages/svx-bot/src/tunables.ts. All non-secret knobs — thresholds, position caps, daily loss limits, intervals — live there as plain TS constants. Edit, redeploy, done. No env-var roulette. - 7Verify end-to-end
force-mint --quantity 0.1 --direction up(Sui),force-poly-trade --usdc 0.5(Polygon),force-hl-trade --size 0.0001 --side short --round-trip(HL). Each is a single-tx flush that proves the wallet, the API auth, and the bot's parser are all wired correctly.
Repo layout
Three packages in a pnpm workspace; docs at the root.
packages/svx-bot/Trading bot — TypeScript, Node 18+, runs both networks.src/tunables.tsAll strategy knobs as plain TS constants.src/config.tsEnv-driven gates + zod validation.src/index.tsMain loop + IV-RV ticker + margin-lever ticker.src/pricing/{svi,svi-arb,bs,…}SVI eval, arb-free checker, BS binary, IV inversion.src/signal/{match,spread,filter}Cross-venue spread + filters.src/exec/{ptb,risk,sizer,polymarket-client,hyperliquid-client,deepbook-margin-client,iron-bank-client}Order construction + risk gates for all four venues.src/ledger/store.tsSQLite + additive migrations.src/strategy/vol-arb.tsStandalone HL IV-RV divergence strategy.src/strategy/margin-lever.tsPaper-mode Predict × deepbook_margin × iron_bank composition.src/api/server.tsRead-only HTTP for the dashboard.scripts/Operator scripts (setup, force-*, redeem, generate-wallet).tests/Vitest — 150+ tests covering math vectors + integration paths.packages/svx-dashboard/This site. Next.js 14 (app router), static-exportable for Walrus.app/{,overview,signals,positions,poly-arb,vol-arb,margin-lever,wallets,surface,about}/One route per page; network-aware via header toggle.components/PageIntro, OperatorBanner, StatRow, SurfaceArbPanel, SviHistoryChart, charts.lib/API client, network context, polling hook.ws-resources.jsonWalrus Sites routing + cache headers.packages/svx-shared/Types + addresses + constants.docs/Runbooks, strategy spec, math validation, Coolify deploy notes.