Overview
The Limitless Exchange TypeScript SDK provides a type-safe client for interacting with both CLOB and NegRisk prediction markets. It handles authentication, EIP-712 order signing, market data fetching, portfolio tracking, and real-time WebSocket streaming out of the box.Source code and issue tracker are available on GitHub.
Installation
- npm
- yarn
- pnpm
Quick Start
1
Configure environment variables
Create a Pass
.env file in your project root (and add it to .gitignore):LMTS_TOKEN_ID / LMTS_TOKEN_SECRET to the client as hmacCredentials. The legacy LIMITLESS_API_KEY is auto-loaded if no credentials are passed, but a scoped API token is preferred.2
Initialize the HTTP client
3
Fetch active markets
4
Authenticate for trading
For operations that require authentication (placing orders, fetching portfolio), supply your scoped API token credentials and wallet:
Environment Variables
Client constructor
The recommended entrypoint is the rootClient class, which composes all domain services (markets, portfolio, orders, API tokens, partner accounts, delegated orders):
With
hmacCredentials set, the SDK automatically generates and sends lmts-api-key, lmts-timestamp, and lmts-signature on each request. Do not manually build HMAC headers when using the SDK client.Legacy: an older API key (
LIMITLESS_API_KEY, sent as the X-API-Key header) still works but is not recommended for new integrations. To use it, pass apiKey: 'lmts_...' or set the LIMITLESS_API_KEY env var instead of hmacCredentials. Prefer a scoped API token.HttpClient (lower-level)
You can also useHttpClient directly for more control:
What You Can Build
Markets
Discover markets, fetch orderbooks, and query NegRisk groups.
Market Pages
Browse markets by category with navigation, filters, and pagination.
Trading and Orders
Create GTC and FOK orders, manage approvals, and cancel orders.
Portfolio and Positions
Track CLOB and AMM positions, PnL, and trade history.
API Tokens
Derive, list, and revoke scoped HMAC tokens for partner integrations.
Partner Accounts
Create sub-accounts with server wallets or EOA verification.
Delegated Orders
Place orders on behalf of sub-accounts with server-side signing.
WebSocket Streaming
Real-time orderbook, price, position, and transaction events.
Server Wallet Redemption and Withdrawal
For partner server-wallet sub-accounts, the SDK provides helper methods for payout settlement and treasury movement:POST /portfolio/redeem— claim resolved positionsPOST /portfolio/withdraw— transfer ERC20 funds from managed sub-accountsPOST /portfolio/withdrawal-addresses— allowlist an explicit treasury destination with Privy identity authDELETE /portfolio/withdrawal-addresses/:address— remove an allowlisted destination with Privy identity auth
apiToken auth: trading for redeem and withdrawal for withdraw. Allowlist add/delete calls use a Privy identity token instead of API-token/HMAC auth.
onBehalfOf when withdrawing from a child server-wallet profile. destination is optional for child withdrawals; when omitted, the API defaults to the authenticated partner smart wallet when present, otherwise the authenticated partner account. You can omit onBehalfOf only when withdrawing the authenticated caller’s own server wallet to an explicit destination.
See the full flow and scope guidance in Programmatic API.