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
- API Key: Generate at limitless.exchange → profile menu → Api keys. Keys start with
lmts_. - Private Key: Your wallet’s private key for EIP-712 order signing. Never share or commit it.
Authentication
All API requests require theX-API-Key header. Cookie-based session auth is deprecated.
Your private key is used only for EIP-712 order signing. The API key handles request authentication. Both are required for trading.
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 →
positionIds[0] for YES, positionIds[1] 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
Ensure
X-API-Key is set correctly and the key starts with lmts_. Check that the key is active in the Limitless UI.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.