limitless
limitless prediction-market exchange — CCXT unified API: methods, parameters and endpoints.
limitless
Kind: global class
Extends: Exchange
- fetchMarkets
- fetchEvent
- fetchTicker
- fetchTickers
- fetchTrades
- fetchOrderBook
- fetchOHLCV
- fetchOrders
- fetchOpenOrders
- fetchClosedOrders
- fetchOrdersByIds
- fetchOrder
- fetchAccounts
- createOrder
- approve
- cancelOrder
- redeem
- cancelOrders
- cancelAllOrders
- fetchMyTrades
- fetchPositions
- fetchEvents
fetchMarkets
fetches all active limitless markets paginated and returns one CCXT market per child market, each containing a list of outcome objects (YES/NO)
Kind: instance method of limitless
Returns: Array<object> - an array of objects representing market data
See: https://docs.limitless.exchange/api-reference/markets/get-active-markets
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.query | string | No | a single search query string to filter markets by |
| params.queries | Array<string> | No | multiple search query strings (alternative to query) |
| params.limit | int | No | max number of markets to collect (defaults to options.fetchMarketsLimit, 1000); caps the pages fetched |
limitless.fetchMarkets (params?)fetchEvent
fetches a single prediction-market event by its market slug or address
Kind: instance method of limitless
Returns: object - a prediction event structure
See: https://docs.limitless.exchange/api-reference/markets/get-market
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the market slug or address |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchEvent (id, params?)fetchTicker
fetches the current price and best bid/ask for a single outcome token, combining the market detail and order book endpoints
Kind: instance method of limitless
Returns: object - a ticker structure
See
- https://docs.limitless.exchange/api-reference/markets/get-market
- https://docs.limitless.exchange/api-reference/trading/orderbook
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | unified outcome like TRUMP_OUT_PRESIDENT_2027:YES or an outcome token id |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchTicker (outcome, params?)fetchTickers
fetches tickers for multiple outcome tokens, grouping requested outcomes by their parent market (two requests per market: detail + order book)
Kind: instance method of limitless
Returns: object - a dictionary of ticker structures indexed by outcome
See
- https://docs.limitless.exchange/api-reference/markets/get-market
- https://docs.limitless.exchange/api-reference/trading/orderbook
| Param | Type | Required | Description |
|---|---|---|---|
| outcomes | Array<string> | Yes | unified outcomes or outcome token ids — required: limitless has no endpoint returning all tickers at once, so an unscoped call is not supported |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchTickers (outcomes, params?)fetchTrades
fetches recent public trades for a single outcome token from the market events feed
Kind: instance method of limitless
Returns: Array<object> - a list of trade structures
See: https://docs.limitless.exchange/api-reference/trading/market-events
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | unified outcome like TRUMP_OUT_PRESIDENT_2027:YES or an outcome token id |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum number of trades to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchTrades (outcome, since?, limit?, params?)fetchOrderBook
fetches the order book for a single outcome token, converting 6-decimal USDC sizes to whole units, no outcomes are quoted at 1 - price with the sides swapped
Kind: instance method of limitless
Returns: object - an order book structure
See: https://docs.limitless.exchange/api-reference/trading/orderbook
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | unified outcome like TRUMP_OUT_PRESIDENT_2027:YES or an outcome token id |
| limit | int | No | not used by limitless fetchOrderBook |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchOrderBook (outcome, limit?, params?)fetchOHLCV
fetches historical prices for a single limitless market outcome and maps them to OHLCV format, uses the interval query parameter and selects the YES/NO series that matches the requested outcome
Kind: instance method of limitless
Returns: Array<Array<int>> - a list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.limitless.exchange/api-reference/trading/historical-price
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | outcome, e.g. "TRUMP_OUT:YES" |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum number of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchOHLCV (outcome, timeframe, since?, limit?, params?)fetchOrders
fetches orders for the authenticated user for a single outcome
Kind: instance method of limitless
Returns: Array<object> - a list of order structures
See: https://docs.limitless.exchange/api-reference/orders/get-user-orders
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | outcome, e.g. "TRUMP_OUT:YES" |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchOrders (outcome?, since?, limit?, params?)fetchOpenOrders
fetches open orders for the authenticated user for a single outcome
Kind: instance method of limitless
Returns: Array<object> - a list of order structures
See: https://docs.limitless.exchange/api-reference/orders/get-user-orders
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | outcome, e.g. "TRUMP_OUT:YES" |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchOpenOrders (outcome?, since?, limit?, params?)fetchClosedOrders
fetches closed orders for the authenticated user for a single outcome
Kind: instance method of limitless
Returns: Array<object> - a list of order structures
See: https://docs.limitless.exchange/api-reference/orders/get-user-orders
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | outcome, e.g. "TRUMP_OUT:YES" |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchClosedOrders (outcome?, since?, limit?, params?)fetchOrdersByIds
fetch orders by the list of order id
Kind: instance method of limitless
Returns: Array<object> - a list of order structures
See: https://docs.limitless.exchange/api-reference/trading/order-status-batch
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | list of order id |
| outcome | string | No | market outcome, e.g. "TRUMP_OUT:YES" |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchOrdersByIds (ids, outcome?, params?)fetchOrder
fetches information on an order made by the user
Kind: instance method of limitless
Returns: object - an order structure
See: https://docs.limitless.exchange/api-reference/trading/order-status-batch
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the order id |
| outcome | string | No | market outcome, e.g. "TRUMP_OUT:YES" |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchOrder (id, outcome?, params?)fetchAccounts
query for account id and info
Kind: instance method of limitless
Returns: Array<object> - a list of [account structures]
See: https://docs.limitless.exchange/api-reference/portfolio/get-current-profile
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchAccounts (params?)createOrder
places a limit or market order on limitless for the given outcome token
Kind: instance method of limitless
Returns: object - an order structure
See: https://docs.limitless.exchange/api-reference/orders/create-order
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | outcome, e.g. "TRUMP_OUT:YES" |
| type | string | Yes | 'limit' or 'market' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | amount of outcome tokens |
| price | float | No | limit price (0–1 range) |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.createOrder (outcome, type, side, amount, price?, params?)approve
sets the on-chain ERC20 collateral (USDC) allowance for the limitless exchange contract on Base, which is required before an EOA maker can place orders ("Insufficient collateral allowance" otherwise). Sends a real on-chain transaction signed with the privateKey and waits for the receipt
Kind: instance method of limitless
Returns: object - the transaction receipt
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters |
| params.token | string | No | the collateral token address (default USDC on Base) |
| params.spender | string | No | the exchange contract to approve (default the limitless CTF exchange); read from a market's venue when omitted |
| params.owner | string | No | the token holder address (default this.walletAddress or the address derived from the privateKey) |
| params.amount | float | No | the allowance in USDC (default: unlimited / maxUint256) |
| params.rpcUrl | string | No | the Base RPC url to broadcast through |
| params.gasLimit | string | No | gas limit hex for the approve tx (default '0x186a0') |
limitless.approve (params?)cancelOrder
cancels a single open order by id
Kind: instance method of limitless
Returns: object - an order structure
See: https://docs.limitless.exchange/api-reference/orders/cancel-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| outcome | string | No | outcome, e.g. "TRUMP_OUT:YES" |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.cancelOrder (id, outcome?, params?)redeem
redeem a resolved winning position back to collateral (gasless — the operator settles on-chain)
Kind: instance method of limitless
Returns: object - the raw redemption response
See: https://docs.limitless.exchange/api-reference/portfolio/redeem
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | a unified outcome on the resolved market to redeem (used to resolve the market conditionId) |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.conditionId | string | No | the CTF condition id (bytes32 hex) to redeem directly, instead of resolving it from an outcome |
limitless.redeem (outcome?, params?)cancelOrders
cancel multiple orders at the same time
Kind: instance method of limitless
Returns: Array<object> - a list of order structures
See: https://docs.limitless.exchange/api-reference/trading/cancel-batch
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| outcome | string | No | unified market outcome, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.cancelOrders (ids, outcome?, params?)cancelAllOrders
cancels all open orders for one market slug
Kind: instance method of limitless
Returns: Array<object> - a list of order structures
See: https://docs.limitless.exchange/api-reference/orders/cancel-all-orders
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | outcome, e.g. "TRUMP_OUT:YES" |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.slug | string | No | the market slug to cancel all orders for |
limitless.cancelAllOrders (outcome?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of limitless
Returns: Array<object> - a list of trade structures
See: https://docs.limitless.exchange/api-reference/trades/get-trades
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | outcome, e.g. "TRUMP_OUT:YES" |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchMyTrades (outcome?, since?, limit?, params?)fetchPositions
fetches open positions for the authenticated limitless user from the portfolio endpoint
Kind: instance method of limitless
Returns: Array<object> - a list of position structures
See: https://docs.limitless.exchange/api-reference/portfolio/get-positions
| Param | Type | Required | Description |
|---|---|---|---|
| outcomes | Array<string> | No | filter by outcome ids or outcomes |
| params | object | No | extra parameters specific to the exchange API endpoint |
limitless.fetchPositions (outcomes?, params?)fetchEvents
fetches prediction-market events matching the given scope (query/queries/tags/eventId/slug — required) and caches their markets and outcomes on the instance
Kind: instance method of limitless
Returns: Array<object> - an array of event structures
See: https://docs.limitless.exchange/api-reference/markets/search
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra exchange-specific parameters |
| params.query | string | No | a single search term; an eventId/slug does a direct lookup and tags resolve to limitless categories, paging only those categories' listings |
| params.queries | Array<string> | No | multiple search terms (alternative to query) |
| params.tags | Array<string> | No | category names to scope by (matched against GET /categories, e.g. ['crypto']) |
| params.eventId | string | No | direct lookup by market address or slug |
| params.limit | int | No | maximum number of markets per query, defaults to 50 |
limitless.fetchEvents (params?)