Overview
What the Grvt API is, how it is laid out, and where to start.
On this page
Help me with: Overview. What the Grvt API is, how it is laid out, and where to start.
Target environment: {environment} (chain ID {chainId}). Recorded signing cases keep their original environment.
{executionGuidance}
Read this first: {origin}/bundle/overview.md (~17 KB, plain Markdown: this page plus the AGENTS.md rules, Environments).
Fetch other pages from the index at {origin}/llms.txt only as you need them. {origin}/downloads/contract.json is a machine-readable contract for tools, not for reading.
Rules: follow AGENTS.md; do not send requests without the user asking you to; read credentials from environment variables; never retry writes automatically; show me the code and how to run it. Grvt is a crypto derivatives exchange. Its API lets you read market data, trade and move funds, with an SDK (Python, TypeScript, Go or Rust) or with plain HTTP and WebSocket calls.
Preview. The SDKs are in preview: any 0.x release can change them. The HTTP and WebSocket API is not affected.
Start here
To place your first order on testnet (the test exchange, with free funds):
- Install the SDK from your SDK's page (Python, TypeScript, Go, Rust), then run the Quickstart: one example reads market data, then one places and cancels an order.
- Back on your SDK's page: create a client, then place, track and cancel an order.
- Errors and retries: what to do when a call fails, above all when you don't know whether an order was placed.
Read these when you need them: Environments (testnet or production), Authentication, Accounts and permissions and Rate limits.
Advanced: WebSocket protocol details, Recovery recipes, Signing by hand, and the C++ signing core and reference: C++ has no client, so your app handles networking, sessions, streams and recovery itself.
Topics: Strategies, Stable funding perps (SFP), Builders, Deposits and withdrawals and Referrals.
Other ways in:
- Writing code with an AI agent: give it Notes for coding agents and llms.txt.
- Looking for a call: All calls lists every RPC and stream.
- Trading several exchanges through one library: CCXT supports Grvt.
- Questions about your account or the Grvt web app: the Help Center.
Glossary
| Term | What it is |
|---|---|
| Main account | Your account on Grvt, identified by a 0x address (main_account_id). Deposits arrive here and withdrawals leave from here; it does not trade. The Grvt web app calls it the Funding Account, and some calls say "funding account". |
| Sub-account | A trading account under your main account, identified by a number, the sub-account ID (sub_account_id). Orders, positions and margin live here. The Grvt web app calls it a Trading Account. Move funds between the main account and its sub-accounts with transfer. |
| API key | Logs you in: exchanged for a session (Authentication). |
| Signing key | Signs orders, transfers and withdrawals and never leaves your machine (Two keys, two jobs). |
| Session | The gravity cookie and X-Grvt-Account-Id header a login returns. Every call to the trading host sends them. |
How the API is laid out
| Part | Host | What it does |
|---|---|---|
| Market data | market-data. | Instruments, tickers, order books, trades, candles. Public, no login. |
| Trading | trades.<domain> | Orders, positions, fills, accounts, transfers. Needs a session. |
| Edge | edge.<domain> | Login (API key or wallet signature). |
<domain> is testnet.grvt.io or grvt.io (Environments).
The market data and trading hosts speak the same two protocols:
- HTTP:
POST /full/v1/<route>with a JSON body. The response body is the result object. - WebSocket: JSON-RPC 2.0 on
/ws/full. Every RPC works here too (method: "v1/<route>"), and streams are subscribed withmethod: "subscribe".
Writes that move money or create orders carry an EIP-712 signature made with your signing key. The SDKs sign for you; Signing explains the bytes if you sign yourself.
Contract and signing test cases
The reference pages and the SDKs are generated from the same API contract (contract.json), so they agree on names and types. signing.json holds signing test cases to check your own signing code against.