Skip to main content

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

Quick Start

1

Configure environment variables

Create a .env file in your project root (and add it to .gitignore):
Pass 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 root Client 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 use HttpClient 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: Required scopes for apiToken auth: trading for redeem and withdrawal for withdraw. Allowlist add/delete calls use a Privy identity token instead of API-token/HMAC auth.
Set 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.

Disclaimer

USE AT YOUR OWN RISK. This SDK and the Limitless Exchange protocol are provided as-is with no warranties. You are solely responsible for any funds used or lost. By using this SDK, you acknowledge that prediction markets involve financial risk. The Limitless Exchange is not available to users in the United States or other restricted jurisdictions. Ensure compliance with your local laws before trading.