Quickstart Guide
Go from zero to depositing native USDC, placing your first on-chain order, authorizing a trade-only API Agent, and verifying fills in 5 minutes.
- Fund your account by calling deposit() on the Base or Arbitrum One bridge contract—never send raw ERC-20 transfers directly to the vault address.
- Keep your master wallet cold: authorize a scoped API Agent for bots so trading servers can never withdraw or transfer funds externally.
- Always resolve asset IDs dynamically from POST /info meta and chain x-vcore-height into minHeight for deterministic read-after-write queries.
Part 1 — Trader Onboarding (4 Steps)
Deposit Official Circle Native USDC
Connect your wallet on Base (8453) or Arbitrum One (42161) and deposit at least 5 USDC via the VPerp bridge interface (deposit() or gasless EIP-2612 depositWithPermit()). Once confirmed, your USDC credits on VCore with zero deposit fee.
Choose Your Margin Mode & Account Structure
New accounts start in Standard Mode with separate spot_usdc and perp_usdc balances. Move funds via usdClassTransfer (toPerp: true), or switch to Unified Account (userSetAbstraction) to share USDC seamlessly across Spot and Perps. For each perpetual market, choose Cross or Isolated margin and set your target leverage (1× up to market maxLeverage).
Place & Protect Your First Order
Use Post-Only (Alo) for guaranteed Maker execution (Class 3 priority), Limit (Gtc) for resting liquidity, or Market (Ioc) for immediate execution inside the ±5% slippage band. Attach Mark-Price TP/SL brackets (normalTpsl / positionTpsl) to protect every position against single-wick manipulation.
Inspect Fills, Funding & VIP Progress
Every fill settles on-chain immediately. Track live fees, 30-day weighted volume, and VIP/MM tier status via POST /info userFees and userRateLimit, or stream fills in real time over /ws (userFills + orderUpdates).
Part 2 — Developer & Bot Quickstart
Follow this minimal flow to connect an algorithmic trading or market-making client cleanly.
Step 1: Discover Markets & Precision (POST /info)
Never hardcode asset IDs (a) or tick decimals—load meta on startup to build your coin -> { assetId, szDecimals, maxLeverage } map:
curl -s -X POST "$RPC_URL/info" \
-H 'Content-Type: application/json' \
-d '{"type":"metaAndAssetCtxs"}' | jq '.[0].universe[0], .[1][0]'Step 2: Authorize a Trade-Only Scoped API Agent (Once)
Generate a fresh keypair on your trading server, then sign approveAgentScoped once from your master wallet. Restrict the agent to the exact markets, sub-accounts, and leverage ceiling your bot needs:
{
"type": "approveAgentScoped",
"vperpChain": "VPerp",
"signatureChainId": "0xa4b1",
"agentAddress": "0x1111111111111111111111111111111111111111",
"agentName": "btc-mm-prod",
"scope": "{\"permissions\":\"trade\",\"allowedMarkets\":[0,1],\"allowMaster\":true,\"maxLeverageCap\":20}",
"nonce": 1700000000000
}Step 3: Submit a Signed Order & Guarantee Read-After-Write
- Format prices and sizes as decimal strings with trailing zeros stripped (respecting
szDecimals, 5 sig figs, and6 - szDecimalsperp decimals). - Compute
connectionId = keccak256(msgpack(action) || nonce_be8 || vault || expires)and sign EIP-712Agentunder{ name: "vperp", version: "1", chainId }withsource: "oc"(Mainnet) or"oc-test"(Testnet). - Submit to
POST /exchange, readx-vcore-heightfrom the response headers, inspect every entry inresponse.data.statuses, and pass"minHeight": <height>on any immediate follow-upPOST /infoquery.
Step 4: Subscribe to Real-Time Order Book & Fills (GET /ws)
Maintain a zero-polling local state by combining l2BookDelta (per-block diffs), orderUpdates, and userFills, and send {"method":"ping"} every 20–30 seconds. If you ever receive {"channel":"lagged"} (more than 4,096 blocks behind), re-fetch snapshots via POST /info and re-subscribe.
Pre-Production Bot Checklist
| Check | Why It Matters |
|---|---|
Dynamic meta lookup | Prevents trading the wrong asset ID if new markets list |
Dedicated Alo batches | Keeps passive quotes in Class 3 ahead of same-block Class 4 takers |
Arm scheduleCancel (DMS) | Automatically clears resting orders if your bot crashes or loses network (zero volume requirement) |
Monitor userRateLimit | Track independent Plan B nRequestsUsed vs nRequestsCap and cancelCap on master and each sub-account |
Monitor exchangeStatus | Detect oracleStale reduce-only windows or market halts immediately |
Respect 429 & minHeight | Isolate Read (1,200/min) and Write (2,400/min) traffic; keep minHeight <= tip + 20 |