Limitless Exchange Rust SDK
v1.0.9 | Rust SDK parity with the existing Limitless SDK surface
Rust SDK for interacting with the Limitless Exchange API.
This crate is a parity-driven Rust port of the existing Limitless SDK surface. The current implementation includes:
- shared HTTP client with API key, identity-header, and HMAC auth support
- typed API errors and retry helpers
- root
Client - markets, portfolio, and market-pages services
- partner api-token, partner-account, and server-wallet services
- order builder, validator, EIP-712 signer, and order client
- delegated-order service
- websocket types and socket.io client surface
USE AT YOUR OWN RISK
This SDK is provided "as-is" without any warranties or guarantees. Trading on prediction markets involves financial risk. By using this SDK, you acknowledge that:
- You are responsible for testing the SDK thoroughly before using it in production
- The SDK authors are not liable for any financial losses or damages
- You should review and understand the code before executing any trades
- It is recommended to test all functionality on testnet or with small amounts first
- The SDK may contain bugs or unexpected behavior despite best efforts
ALWAYS TEST BEFORE USING IN PRODUCTION WITH REAL FUNDS
For production use, we strongly recommend:
- Running comprehensive tests with your specific use case
- Starting with small transaction amounts
- Monitoring all transactions carefully
- Having proper error handling and recovery mechanisms
Geographic Restrictions
Important: Limitless restricts order placement from US locations due to regulatory requirements and compliance with international sanctions. Before placing orders, builders should verify their location complies with applicable regulations.
Status
This is the first full-surface parity pass. The crate is implemented against the Go SDK shape and verified locally with:
cargo fmtcargo check --examplescargo test
Installation
[]
= "1.0.9"
Authentication Modes
- Public read-only endpoints: no authentication required. Use these for active markets, market pages, and orderbooks.
- API key authentication: required for portfolio and standard order-placement flows.
- HMAC-scoped authentication: used for partner/delegated/server-wallet flows and can also authenticate websocket position streams.
The SDK reads LIMITLESS_API_KEY automatically when present, or you can configure credentials explicitly with Client::builder().
Quick Start
Public Market Data
use ;
async
Authenticated Portfolio Access
use env;
use Client;
async
Signed Order Placement
use env;
use ;
async
Workflow Guide
- Public market discovery: examples/active_markets.rs
- Custom client builder and logging: examples/custom_client.rs
- Market-page discovery and filtered browsing: examples/market_pages.rs
- Portfolio and cursor-based history: examples/portfolio.rs
- User-order retrieval and market cancel-all: examples/user_orders.rs
- Signed CLOB orders:
- NegRisk order flow: examples/negrisk_order.rs
- Delegated partner flows:
- delegated order: examples/delegated_order.rs
- delegated FOK order: examples/delegated_fok_order.rs
- Partner allowance recovery: examples/partner_account_allowances.rs
- API-token revoke flow: examples/api_token_revoke.rs
- Server-wallet redeem/withdraw flow: examples/server_wallet_redeem_withdraw.rs
- WebSocket subscriptions:
- orderbook: examples/websocket_orderbook.rs
- positions and transactions: examples/websocket_positions.rs
Partner Server-Wallet Allowances
Use partner_accounts.check_allowances(profile_id) and partner_accounts.retry_allowances(profile_id) only for partner child profiles created with create_server_wallet = true. These endpoints require scoped HMAC credentials derived with SCOPE_ACCOUNT_CREATION and SCOPE_DELEGATED_SIGNING.
use ;
let sdk = from_http_client?;
let profile_id = 12345;
let mut allowances = sdk.partner_accounts.check_allowances.await?;
if !allowances.ready
println!;
Poll check_allowances first. If ready is false and one or more targets are missing or failed with retryable = true, call retry_allowances, then poll check_allowances again after a short delay. Retry 429 and 409 responses are returned as LimitlessError::Api; inspect err.status, and for 429 read retryAfterSeconds from err.data.