Overview
This guide walks you through a complete Python implementation for trading on Limitless Exchange: authentication, fetching market data, building and signing orders with EIP-712, and submitting them via the REST API.Prerequisites
Install dependencies
Install the required packages:
- eth-account: EIP-712 signing and key management
- requests: HTTP client for the REST API
- web3: Address checksumming and utilities
Obtain credentials
- Scoped API Token: Derive a token at limitless.exchange → profile menu → API Tokens → Derive. You get a token ID and a secret (base64-encoded). The secret is shown once — store it securely. See Authentication for the full flow.
- Private Key: Your wallet’s private key for EIP-712 order signing. Never share or commit it.
Authentication
Authenticated API requests (e.g. submitting orders) are signed with HMAC-SHA256 using your scoped API token. Each request carries three headers —lmts-api-key, lmts-timestamp, and lmts-signature — computed over a canonical message. See Authentication for the full reference.
Your private key is used only for EIP-712 order signing. The scoped API token (token ID + secret) handles request authentication. Both are required for trading. Public market data (browsing markets, orderbooks) needs no authentication.
Fetching Market Data
UseGET /markets/:slug to retrieve market details, including venue addresses and position IDs. Cache this data per market; it is static.
Building Order Payloads
Orders require specific fields. Key values:| Field | Value | Description |
|---|---|---|
side | 0 | BUY |
side | 1 | SELL |
signatureType | 0 | EOA wallet |
orderType | GTC | Good Till Cancelled |
orderType | FOK | Fill or Kill |
- BUY order
- SELL order
You pay USDC, receive shares. Use Example: BUY 10 YES shares at $0.65 →
tokens.yes for YES, tokens.no for NO.makerAmount = 6,500,000, takerAmount = 10,000,000EIP-712 Signing
Sign orders using EIP-712 with the venue’s exchange address asverifyingContract.
See EIP-712 Order Signing for the full type definition and field reference.
All addresses must be checksummed (EIP-55). Use
Web3.to_checksum_address().Submitting Orders
Send the signed order toPOST /orders:
Complete Working Example
Troubleshooting
401 Unauthorized
- Verify
LMTS_TOKEN_IDandLMTS_TOKEN_SECRETare set and the token is active in the Limitless UI. - Ensure
lmts-timestampis within 30 seconds of server time (check your clock). - Confirm the signed
pathmatches the request path including any query string, and the signed body is the exact bytes you send.
400 Invalid order / signature mismatch
- Verify
verifyingContractis the market’svenue.exchangeaddress. - Ensure all addresses are checksummed (EIP-55).
- Confirm
makerAmountandtakerAmountuse 1e6 scaling for USDC and shares.
Insufficient balance or allowance
- Ensure you have enough USDC on Base for BUY orders.
- Approve USDC to
venue.exchangefor BUY; Conditional Tokens tovenue.exchange(andvenue.adapterfor NegRisk SELL) for SELL.
Next Steps
EIP-712 Signing
Full order type definition and field reference.
Venue System
Understanding venue contracts and token approvals.
API Reference
Complete endpoint documentation.
Authentication
Scoped API token setup and HMAC request signing.