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
Configure environment variables
Create a The SDK automatically reads
.env file in your project root (and add it to .gitignore):LIMITLESS_API_KEY from the environment if no apiKey is passed to the constructor.Environment Variables
| Variable | Required | Description |
|---|---|---|
LIMITLESS_API_KEY | For authenticated endpoints | Auto-loaded by the SDK. Generate at limitless.exchange under profile menu. |
PRIVATE_KEY | For order signing | Ethereum private key used for EIP-712 order signatures. Never commit to version control. |
Client constructor
The recommended entrypoint is the rootClient class, which composes all domain services (markets, portfolio, orders, API tokens, partner accounts, delegated orders):
| Option | Type | Default | Description |
|---|---|---|---|
baseURL | string | — | API base URL |
apiKey | string | process.env.LIMITLESS_API_KEY | API key for authentication |
hmacCredentials | { tokenId, secret } | — | HMAC credentials for scoped API token auth (see Programmatic API) |
timeout | number | 30000 | Request timeout in milliseconds |
additionalHeaders | Record<string, string> | {} | Additional headers sent with every request |
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.