Configure AsyncPolyester / Polyester with API/WS URLs, credentials, default account/subaccount,
catalog hydration, timeouts, and wire format (binary Protobuf default).
Recommended constructor
from polyester import AsyncPolyester
async with AsyncPolyester(
api_key_id="ak_...",
api_private_key="...", # 64-char hex from key creation
default_account_id="...", # Profile โ Account ID
# api_url="https://api-devnet.polyester.ai",
# ws_url="wss://api-devnet.polyester.ai",
# default_sub_account_id=None,
# timeout=10.0,
# wire_format="binary", # or "json"
# hydrate_catalogs=True,
) as client:
await client.wait_for_catalogs()Python ships async (AsyncPolyester) and sync (Polyester) clients with the same service
tree. Prefer async for bots with streams. Unary ConnectRPC responses are limited to 4 MiB after
decompression.
Options
| Option | Default | Notes |
|---|---|---|
api_key_id / api_private_key | unset | Required for private RPCs / private WS |
api_url | https://api-devnet.polyester.ai | ConnectRPC base |
ws_url | wss://api-devnet.polyester.ai | Centrifugo WebSocket |
default_account_id | unset | Private channel scoping |
default_sub_account_id | unset | Default trading scope |
timeout | 10.0 | HTTP timeout seconds |
wire_format | "binary" | "binary" or "json" |
hydrate_catalogs | True | Background spot + Zipper hydration attempt |
Aliases
| Alias | Points to |
|---|---|
client.candles | client.market_data |
client.trading_withdraws | client.withdraw |
From environment
AsyncPolyester.from_env() / Polyester.from_env() load:
POLYESTER_API_KEY_IDPOLYESTER_API_PRIVATE_KEYPOLYESTER_ACCOUNT_ID
They do not load POLYESTER_API_URL / POLYESTER_WS_URL. Pass api_url / ws_url as
constructor kwargs (or via from_env(**overrides)). Prefer explicit credentials in production.
Catalog readiness
With
hydrate_catalogs=True, call await client.wait_for_catalogs() before
decimal order writes that need symbol scales. The wait fails if either required
catalog cannot be hydrated or validated.Retries are application-controlled
The SDK does not automatically retry unary calls. Retry only transport and rate-limit failures
with backoff and stable idempotency keys. Reconcile mutation outcomes before retrying.
Related
Related Topics
Address book Saved destinations and whitelist views. API keys List, get, subscribe, and generate local API key material (no create on API-key SDKs). Auth Auth service helpers including nested profile access. Balances Read ledger balances, history, holds, and stream live balance updates. Candles Read and stream public spot OHLCV candles via market data (candles alias). Catalog Spot and Zipper catalog hydration, symbol lookups, and quantity scales used by decimal order writes. Chain helpers On-chain Funding โ Trading and Funding withdraw helpers. Chain analytics Chain analytics read APIs. Deposit Create and list per-account chain deposit addresses for funding your Polyester account. Errors Python SDK error types, MFA auth codes, realtime overflow, and retry guidance. Guard signer Guard signer approval helpers. Heatmap L2 order book heatmap reads. Internal transfers Move trading balances between Polyester accounts without touching a chain. Layout Layout collaboration APIs (reference-only). Lifecycle Deposit/withdraw lifecycle flows and subscribe. Market overview List and subscribe to per-market stats with optional snapshot-then-stream merge. Order book Depth snapshots and a stateful live order book that reconstructs the book for you. Orders Place, modify, cancel, batch, and stream spot orders, with optional attached take-profit, stop-loss, and trailing-stop risk. Policies Realtime API-key and subaccount-policy updates. Polychart Polychart collaboration APIs (reference-only). Profile Profile identity reads and subscribe helpers. Public trades Public trade tape reads and subscribe via market data. Realtime Shared Centrifugo WebSocket client, subscription contract, handshake-before-return, and fail-closed overflow. Social verification Social verification APIs (reference-only). Subaccounts Subaccount reads, members, invites, activity. User trades List and stream your private spot fills (not the public tape). Transfers Transfer history reads. Triggers Create, manage, pause/resume, and stream standalone automations that place a child order when a market condition fires. Whiteboard Whiteboard collaboration APIs (reference-only). Withdrawals Trading withdraw intents to funding or external chain destinations (signed payload). Zipper Deposit/withdraw config and related Zipper reads.