Clients & SDKs
Choose a client for market data, trading, or Deposit Wallet actions
Use an SDK when you want typed models, authentication helpers, and order signing. Use the REST and WebSocket APIs directly when your runtime is unsupported or you need lower-level control.
Download configured bundles
Open Settings → SDKs to download a bundle configured for your operator's environment.
Choose a client
| Client | Languages | Best for |
|---|---|---|
| Unified SDK | TypeScript, Python | Market data, CLOB orders, and Deposit Wallet relayer actions in one client |
| Separate CLOB and relayer clients | Rust | Market data, trading, and Deposit Wallet actions with separate Rust packages |
| REST API | Any | Raw JSON access and unsupported runtimes |
| WebSocket | Any | Order-book, order, trade, and live-data updates |
| Task | Use |
|---|---|
| Discover events and market metadata | Gamma API |
| Read books, prices, spreads, and tick sizes | Unified SDK, Rust CLOB client, or REST |
| Create credentials and place orders | Secure SDK client or Rust CLOB client |
| Deploy a Deposit Wallet or batch approvals | SDK relayer or Rust relayer client |
| Track live market changes | Market WebSocket |
| Track private order and trade changes | User WebSocket |
Unified TypeScript and Python quickstart
For registry installs, the packages are @kuest/sdk (TypeScript) and kuest-sdk
(Python, imported as market_sdk). Downloaded operator bundles use neutral package
names: @market-sdk/client in the TypeScript workspace and market-sdk as the
Python distribution. A bundle includes .sdk/site-config.json for its
public builder attribution, market scope, and optional geoblock settings. Keep signing
keys and API credentials outside that file. Supply approved service URLs and a Polygon
RPC URL explicitly; the SDKs do not include live endpoint defaults.
These examples only read an order book. TypeScript users working from a downloaded
bundle should run pnpm install --frozen-lockfile and pnpm build first. Python users
can run python3 -m pip install -e . from the extracted bundle.
import { createPublicClient, forkEnvironmentConfig } from '@market-sdk/client'
import { loadSiteConfig } from '@market-sdk/client/node'
const environment = forkEnvironmentConfig({
name: 'operator',
clob: { rest: process.env.SDK_CLOB_URL! },
gamma: { rest: process.env.SDK_GAMMA_URL! },
data: { rest: process.env.SDK_DATA_URL! },
relayer: { rest: process.env.SDK_RELAYER_URL! },
rpc: process.env.SDK_RPC_URL!,
})
const client = createPublicClient({ environment, siteConfig: loadSiteConfig() })
const book = await client.fetchOrderBook({ assetId: process.env.SDK_TOKEN_ID! })
console.log(book)If installed from npm instead, use @kuest/sdk and @kuest/sdk/node for these imports.
For trading, create a secure client with a signer and Deposit Wallet address. Orders
use signature type 3 and require CLOB API credentials. Pass the downloaded
siteConfig to the TypeScript secure client so its public builder_code and
order_metadata enter the signed order. The Python bundle reads the same overlay
from its extracted project. Neither bundle contains private keys or API secrets.
Keep signing server-side
Never place private keys, CLOB API secrets, relayer credentials, or builder credentials in browser-exposed code. The frontend should call a protected service when privileged signing is required.
Deposit Wallet relayer workflow
The unified TypeScript and Python SDKs include relayer methods. Rust uses its separate relayer client. These methods submit Deposit Wallet actions without requiring the end user to hold the network gas token.
Required configuration:
RELAYER_URL=<operator_relayer_url>
KUEST_BUILDER_API_KEY=...
KUEST_BUILDER_SECRET=...
KUEST_BUILDER_PASSPHRASE=...
PRIVATE_KEY=...A typical workflow is:
- Derive the expected Deposit Wallet address.
- Check whether its contract is deployed.
- Deploy it when necessary.
- Build the calls, such as collateral approval and
splitPosition. - Sign the Deposit Wallet batch with a short deadline.
- Submit through the relayer and wait for the transaction receipt.
Configure the relayer and Polygon RPC endpoints explicitly. Builder credentials stay
on the server and are separate from the order's public builder_code.
Market-maker workflow
A market-making service usually:
- discovers active markets through Gamma;
- checks CLOB token IDs, tick size, negative-risk status, and trading state;
- prepares outcome-token inventory;
- reads the order book and calculates fair value;
- posts non-crossing, post-only bid and ask ladders;
- cancels or replaces stale quotes as price, inventory, or risk limits change.
Protect against stale or crossed quotes
Confirm the best buy is below the best sell, cap inventory and notional exposure, and cancel quotes when your data stream is stale or the strategy loses connectivity.
Authentication and updates
- CLOB trading uses Deposit Wallet orders with signature type
3. - Secure SDK clients use L2 CLOB credentials derived from a wallet signature.
- Relayer requests use separate
KUEST_BUILDER_*credentials. - Server time should be synchronized before signing authenticated requests.
Check for updates from the extracted bundle directory. Back up local changes before applying an update, then reinstall dependencies for the downloaded project:
./.sdk/update --check
./.sdk/update --latest