Overview
The Limitless Exchange Rust SDK (limitless-exchange-rust-sdk) is a typed async client for interacting with both CLOB and NegRisk prediction markets. It provides:
- Strongly typed request and response models
- Built-in EIP-712 order building and signing
- Root
Clientcomposition for markets, portfolio, navigation, partner flows, and WebSockets - Pluggable logging and retry helpers
- Async WebSocket streaming with auto-reconnect
The SDK requires Rust 1.74+ and uses
async / await throughout. The examples below assume a Tokio runtime.Installation
Quick Start
Authentication
The SDK supports both authentication modes:- Legacy API key (
X-API-Key) - Scoped token HMAC (
lmts-api-key,lmts-timestamp,lmts-signature) for partner/programmatic integrations
- Environment variable (recommended)
- HMAC (partner/programmatic)
- Explicit API key
Set
LIMITLESS_API_KEY and let Client::new() or HttpClientBuilder load it automatically: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.Root Client
The recommended entrypoint is the rootClient, which composes all domain services:
OrderClient from the root client:
WebSocketClient from the root client:
HttpClient Builder Options
The SDK uses a builder pattern onClient::builder():
| Method | Type | Default | Description |
|---|---|---|---|
base_url(url) | String | https://api.limitless.exchange | API base URL |
timeout(duration) | Duration | 30s | HTTP request timeout |
api_key(key) | String | Reads LIMITLESS_API_KEY env | Legacy API key authentication |
hmac_credentials(creds) | HmacCredentials | — | HMAC credentials for scoped API-token auth |
additional_headers(map) | HashMap<String, String> | empty | Extra headers merged into every request |
logger(logger) | SharedLogger | NoopLogger | Logger for request/response tracing |
Logging
The SDK provides a pluggableLogger trait with a built-in ConsoleLogger:
| Level | Description |
|---|---|
LogLevel::Debug | Verbose request/response output, venue cache behavior, and WebSocket lifecycle |
LogLevel::Info | General operational messages |
LogLevel::Warn | Warnings about missing auth, cache misses, or retry behavior |
LogLevel::Error | Errors only |
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-exchange-rust-sdk