synthetix-sdk
The official Python client for the Synthetix V4 perpetual futures exchange. Provides REST and WebSocket access for market data, trading, and account management, with EIP-712 signing built in.
Full API docs: developers.synthetix.io.
Get going in 30 seconds with Claude Code
The fastest way to try the SDK is the bundled Claude Code skill. Clone the repo, run /synthetix in a Claude Code session, and Claude will set up the environment, write and run example scripts, and explain the SDK as you go — no reading docs first.
git clone https://github.com/Synthetixio/synthetix-sdk
cd synthetix-sdk
Then in Claude Code:
/synthetix stream live prices for ETH-USDT
/synthetix place a limit order
/synthetix check my open positions
/synthetix watch my positions in real time
Claude does the wiring — .venv setup, dependency install, script generation, running, and walking you through the output. Pass any natural-language goal after the slash command.
Installation
To use the SDK in your own project:
pip install synthetix-sdk
Three runtime dependencies: requests, eth-account, websockets. Python 3.10+.
Quick Start
from synthetix import Synthetix
# Public market data — no private key needed
snx = Synthetix()
markets = snx.get_markets()
for m in markets:
print(m["symbol"], m["description"])
# Authenticated — required for trading and account queries
snx = Synthetix(private_key="0x...")
print(snx.get_positions())
print(snx.get_portfolio())
For WebSocket streaming and async trading:
import asyncio
from synthetix import Synthetix
async def main():
snx = Synthetix(private_key="0x...")
# Stream real-time prices (no auth required)
sub = await snx.subscribe(
"marketPrices",
lambda d: print(d),
symbol="ETH-USDT",
)
# Place an order over WebSocket
result = await snx.ws_place_order(
symbol="BTC-USDT",
side="buy",
amount="0.001",
price="90000",
)
await asyncio.sleep(10)
await snx.unsubscribe(sub)
await snx.close()
asyncio.run(main())
Features
Market data (public, no key required)
- List markets, fees, funding rates, open interest
- Tickers, mark prices, mids
- Order books at multiple depths
- Recent trades, candles, funding rate history
Trading
- Market, limit (GTC/GTD/IOC/post-only), TWAP, stop-loss, and take-profit orders
- Modify and cancel orders (single, batch, by client order ID, or all)
- Update leverage per market
- Schedule deferred cancellations as a kill-switch
Account management
- Positions, P&L, balance, portfolio, performance history
- Trade and order history, open orders, fills
- Funding payments and rate-limit status
- Sub-accounts: create, query, transfer collateral
- Delegated signers for ops accounts
WebSocket (async)
- Live subscriptions: prices, orderbook (snapshot/diff/managed), trades, positions, orders, fills, balances
- WS-native trading methods (
ws_place_order,ws_cancel_order,ws_modify_order, …) — same signing, lower latency than REST - Auto-reconnect with auth re-handshake and subscription replay
- Per-callback error handlers; sync and async callbacks both supported
Configuration
Synthetix(
private_key=None, # Omit for read-only mode
subaccount_id=None, # Auto-discovered if not set
timeout=None, # Request timeout in seconds
expires_after_ms=60000, # Signed-message expiry window
)
Examples
The repo includes standalone scripts for every endpoint under examples/rest/ and examples/ws/. Each is runnable on its own:
# Market data (no key)
python examples/rest/fetch-markets.py
python examples/rest/fetch-orderbook.py
# Trading (requires PRIVATE_KEY env var)
python examples/rest/create-limit-gtc-order.py
python examples/rest/cancel-order.py
# WebSocket
python examples/ws/async-watch-ticker.py
python examples/ws/async-market-order.py
python examples/ws/async-watch-positions.py
API reference
- Full HTTP/WS protocol docs: developers.synthetix.io
- REST API —
MarketAPI(public) andAccountAPI(authenticated) - WebSocket API — subscriptions, channels, and async trading methods
Metadata
Release files for synthetix-sdk 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| synthetix_sdk-0.6.0.tar.gz | 78.4 kB | Without provenance | Details for synthetix_sdk-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| synthetix_sdk-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for synthetix_sdk-0.6.0-py3-none-any.whl |
Total release size: 130.5 kB
Release files / synthetix_sdk-0.6.0.tar.gz
| Download URL | synthetix_sdk-0.6.0.tar.gz |
|---|---|
| Size | 78.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57c08bbcd6b3cf3068f534779689c421bda68d14eac75699e0033adfbd0f0118
|
|
BLAKE2b-256 checksum How to use checksums |
66f500e5409554fae3feeed06bdd9b4a2526f58adaf3ffdf90b2e60b60cd3695
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / synthetix_sdk-0.6.0-py3-none-any.whl
| Download URL | synthetix_sdk-0.6.0-py3-none-any.whl |
|---|---|
| Size | 52.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8e688440bf40df2ccb2b833f41f4d13a434c0bcb9c79443f5690557a1fc863a
|
|
BLAKE2b-256 checksum How to use checksums |
64fbcac77a42601ddda9170953f23bc9a957293611d11630fcf4165a590c4362
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for synthetix-sdk 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.