---
title: "Migrating from grvt-pysdk"
description: "How calls in the old Python SDK (GrvtRaw*, GrvtCcxt*) map to the new SDK, with a short note for the old JS client."
order: 10
llms: trading, market-data
---

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(ApiGetAllInstrumentsRequest(...))`, ccxt `fetch_ticker("BTC_USDT_Perp")` | `client.get_all_instruments(...)`: `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(key)` |
| 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](errors-and-retries.md)) |
| Streams | `GrvtCcxtWS.subscribe(stream, callback)` | `async with client.<stream>_stream(...) as sub: async for frame in sub` |
| Sequence gaps | handled by you | detected and re-synced by the SDK |

## Side by side

Old (raw, sync):

```python nocheck
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:

```python
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):

```python nocheck
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](../reference/rpc/create_order.md). 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](../llms.txt) or the [API reference](../reference/index.md) 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](../sdks/typescript.md) replaces both with one
client, `new Grvt({ env: "testnet" })`. Its methods follow the same reference pages as the Python names above,
in camelCase.
