Migrating from grvt-pysdk
How calls in the old Python SDK (GrvtRaw*, GrvtCcxt*) map to the new SDK, with a short note for the old JS client.
On this page
Help me with: Migrating from grvt-pysdk. How calls in the old Python SDK (GrvtRaw*, GrvtCcxt*) map to the new SDK, with a short note for the old JS client.
Target environment: {environment} (chain ID {chainId}). Recorded signing cases keep their original environment.
{executionGuidance}
Read this first: {origin}/bundle/guides/migrating.md (~16 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. The old SDKs (grvt-pysdk, @grvt/client, @grvt/sdk) are replaced, not wrapped. The new SDK is generated
from the same contract as these docs, so every method name matches a reference page.
What changes
| Old | New | |
|---|---|---|
| Client | GrvtRawSync(config), GrvtRawAsync, GrvtCcxt, GrvtCcxtPro | Grvt(env) (blocking) or AsyncGrvt(env) |
| Method names | get_all_instruments_v1(, ccxt fetch_ticker( | client.: client.<method>, request fields as keyword args |
| Environment | GrvtEnv.TESTNET + endpoint config | env="testnet" (or your own Environment) |
| Signing | grvt_raw_signing / ccxt utils, called by you | automatic for signed calls when you pass signer=PrivateKeySigner( |
| Field names | full names, plus a lite variant | full names in your code; lite on the wire by default (encoding) |
| Numbers | floats in places (ccxt) | decimal strings and quoted 64-bit ints, as on the wire |
| Errors | GrvtError dataclass returned in place of a result | exceptions: ApiError, RateLimitError, TransportError, OrderStateUnknown |
| Retries | varied | reads retried, writes never (why) |
| Streams | GrvtCcxtWS. | async with client. |
| Sequence gaps | handled by you | detected and re-synced by the SDK |
Side by side
Old (raw, sync):
api = GrvtRawSync(GrvtApiConfig(env=GrvtEnv.TESTNET, trading_account_id=..., private_key=..., api_key=...))
resp = api.get_all_instruments_v1(types.ApiGetAllInstrumentsRequest(is_active=True))
New:
from grvt import Grvt
with Grvt(env="testnet") as client:
resp = client.get_all_instruments(is_active=True)
print(len(resp.result or []))
Old (ccxt-style order):
api = GrvtCcxt(env=GrvtEnv.TESTNET, parameters={"api_key": ..., "trading_account_id": ..., "private_key": ...})
api.create_order(symbol="BTC_USDT_Perp", order_type="limit", side="buy", amount=0.01, price=64000)
New: build the order with the wire fields (time_in_force, legs[].size, legs[].limit_price,
legs[].is_buying_asset) as in create_order. There is no ccxt layer;
use CCXT itself if you want one.
Method name lookup
The old raw method foo_v1 usually becomes client.foo. When it does not, search
llms.txt or the API reference for the HTTP path you used
(e.g. /full/v1/all_instruments); each page shows its SDK method.
From the old JS client
@grvt/client and @grvt/sdk had two clients: new GRVT.MDG({host}) for market data and
new GRVT.TDG(...) for trading. The TypeScript SDK replaces both with one
client, new Grvt({ env: "testnet" }). Its methods follow the same reference pages as the Python names above,
in camelCase.