Skip to main content

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 Client composition 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

1

Initialize the client

2

Fetch active markets

3

Check your positions

Authentication

Authentication uses scoped API tokens with HMAC-SHA256 request signing:
  • A scoped API token is a token ID plus a one-time secret, generated at limitless.exchange → profile menu → Api keys
  • 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.
Never hardcode API keys, HMAC secrets, or raw wallet private keys in source code or commit them to version control. Use environment variables or a secrets manager.

Root Client

The recommended entrypoint is the root Client, which composes all domain services:
For signing orders, create an OrderClient from the root client:
For streaming, create a WebSocketClient from the root client:

HttpClient Builder Options

The SDK uses a builder pattern on Client::builder():

Logging

The SDK provides a pluggable Logger trait with a built-in ConsoleLogger:
Use LogLevel::Debug during development when integrating signing, partner flows, or WebSockets. Switch to Info or Warn in production.

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.

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