Skip to main content

Overview

The Limitless Exchange Python SDK (limitless-sdk) is an async-first Python client built on top of aiohttp. It provides:
  • Fully asynchronous HTTP and WebSocket clients
  • Pydantic models for type-safe request and response handling
  • Automatic venue caching for EIP-712 order signing
  • Built-in retry logic for transient API failures
  • WebSocket streaming with auto-reconnect
The SDK requires Python 3.9+ and uses async/await throughout. All network calls must be awaited inside an asyncio event loop.

Installation

Quick Start

1

Initialize the HTTP client

2

Fetch active markets

3

Check your positions

Authentication

Authentication uses scoped API tokens with HMAC-SHA256 request signing. Generate one at limitless.exchange → profile menu → Api keys; you receive a token ID and a one-time secret (base64-encoded). Store the secret securely — it is shown only once.
  • HMAC headers lmts-api-key, lmts-timestamp, lmts-signature — the SDK builds and signs them for you when you pass HMAC credentials
With hmac_credentials set, the SDK automatically generates and sends lmts-api-key, lmts-timestamp, and lmts-signature. 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. Prefer a scoped API token. If you must use it, pass HttpClient(api_key="lmts_your_key_here") or set the LIMITLESS_API_KEY environment variable.
Never hardcode API keys in source code or commit them to version control. Use environment variables or a secrets manager.

Client constructor

The recommended entrypoint is the root Client class, which composes all domain services (markets, portfolio, orders, API tokens, partner accounts, delegated orders):
For partner integrations using HMAC authentication:

HttpClient (lower-level)

You can also use HttpClient directly for more control:
Always call await http_client.close() when you are finished to cleanly shut down the underlying aiohttp session.

Logging

The SDK provides a ConsoleLogger with configurable log levels for debugging:
Set LogLevel.DEBUG during development to see request headers, venue cache hits/misses, and full API responses. Switch to INFO or WARN in production.

Source Code

The SDK is open source. Contributions and issue reports are welcome.

GitHub Repository

Browse the source, report issues, and contribute at github.com/limitless-labs-group/limitless-sdk

Disclaimer

USE AT YOUR OWN RISK. This SDK is provided as-is with no guarantees. You are solely responsible for any trading activity conducted through this software. Limitless Exchange is not available to users in the United States or other restricted jurisdictions. By using this SDK, you confirm compliance with all applicable local laws and regulations.

Next Steps

Markets

Discover markets, fetch orderbooks, and understand venue caching.

Market Pages

Browse markets by category with navigation, filters, and pagination.

Trading & Orders

Place GTC and FOK orders, cancel orders, and manage token approvals.

Portfolio & Positions

Track your open positions and trading 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

Subscribe to real-time orderbook and price updates.

Error Handling & Retry

Retry logic, error types, and debugging strategies.

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 on_behalf_of 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 on_behalf_of only when withdrawing the authenticated caller’s own server wallet to an explicit destination. See the full flow and scope guidance in Programmatic API.