# Event actions Source: https://docs.futuur.com/api-reference/events/actions List all actions (trades) for a specific event. Retrieve a list of all trading actions that have occurred on a specific event. Real money actions have user information anonymized. ## Endpoint ``` GET https://api.futuur.com/v2.0/events/{id}/actions/ ``` ## Authentication > [!NOTE] > > This endpoint supports HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers for user-specific filters. See the [authentication guide](/authentication) for signing instructions. ## Request **id** `integer` *required* A unique integer value identifying this event. **aggregate\_by\_orders** `boolean` (default: true) When `true`, aggregates actions by order. **currency\_mode** `string` Filter by currency mode. One of `play_money` or `real_money`. **following** `boolean` (default: false) When `true`, returns only actions from users you follow. **my\_bets** `boolean` (default: false) When `true`, returns only your own actions. **search** `string` Full-text search query. Between 1 and 100 characters. ## Response Returns an array of wager action objects. ## Example ```bash cURL theme={null} curl -G "https://api.futuur.com/v2.0/events/12345/actions/" \ --data-urlencode "currency_mode=play_money" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" ``` ```python Python theme={null} import requests response = requests.get( "https://api.futuur.com/v2.0/events/12345/actions/", params={"currency_mode": "play_money"}, headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", }, ) actions = response.json() for action in actions: print(action) ``` # Event tax Source: https://docs.futuur.com/api-reference/events/get-tax Retrieve play money and real money tax rates for an event. Return the tax rates applied to trades on an event, split by currency mode. ## Endpoint ``` GET https://api.futuur.com/v2.0/events/{id}/get_tax/ ``` ## Authentication No authentication is required for this endpoint. ## Parameters **id** `integer` *required* The unique identifier of the event. ## Response **tax\_play\_money** `number | null` *required* Tax rate for play money trades on this event. `null` when no play money tax applies. **tax\_real\_money** `number | null` *required* Tax rate for real money trades on this event. `null` when no real money tax applies. ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/events/1023/get_tax/" ``` ```json Sample response theme={null} { "tax_play_money": 0.02, "tax_real_money": 0.05 } ``` # List events Source: https://docs.futuur.com/api-reference/events/list Retrieve a paginated list of prediction market events with optional filters. Retrieve a list of prediction market events. Filter by category, tag, search term, currency mode, date range, and status. Results are paginated. ## Endpoint ``` GET https://api.futuur.com/v2.0/events/ ``` ## Authentication > [!NOTE] > > This endpoint does not require authentication. Public event data is accessible without HMAC headers. ## Parameters **search** `string` Case-insensitive search across the event title, market names, categories, and tags. Maximum 100 characters. **categories** `string` Comma-separated category IDs. A root category includes its descendants. An event matches any listed category. **category\_slug** `string` Comma-separated category slugs, as an alternative to `categories`. A root slug includes its descendants. An event matches any listed slug. When `categories` is also set, the event must match both. **tag** `string` Comma-separated tag slug or name, up to 10. An event matches if it has any listed tag. Matching is case-insensitive. **currency\_mode** `string` (default: play\_money) Filter by currency mode: `play_money` or `real_money`. Defaults to `play_money`. **bet\_end\_date\_after** `string` Inclusive lower bound for `bet_end_date`, ISO 8601 with timezone (e.g., `2026-11-01T00:00:00Z`). Events without `bet_end_date` are excluded. Combines with the list status window: open and pending resolution, unless `live`, `resolved_only`, or `pending_resolution` is set. **bet\_end\_date\_before** `string` Inclusive upper bound for `bet_end_date`, ISO 8601 with timezone (e.g., `2026-11-01T00:00:00Z`). Events without `bet_end_date` are excluded. Combines with the list status window: open and pending resolution, unless `live`, `resolved_only`, or `pending_resolution` is set. **live** `boolean` (default: false) When `true`, return events that are live now or start within 12 hours. **resolved\_only** `boolean` (default: false) When `true`, return only resolved events. **pending\_resolution** `boolean` (default: false) When `true`, return unresolved events whose close time has passed. **hide\_my\_bets** `boolean` (default: false) Authenticated only. Omit events the user has already bet on. **only\_markets\_i\_follow** `boolean` (default: false) Authenticated only. Return only events the user follows. **ordering** `string` Field to order results by. Allowed values: `relevance`, `-relevance`, `created_on`, `-created_on`, `bet_end_date`, `-bet_end_date`, `wagers_count`, `-wagers_count`, `volume`, `-volume`, `open_date`, `-open_date`, `resolve_date`, `-resolve_date`. Prefix with `-` for descending order. **limit** `integer` Number of results to return per page. **offset** `integer` The initial index from which to return results (for pagination). ## Response Returns a paginated list of event objects. **count** `integer` *required* Total number of events matching the query. **next** `string` URL for the next page of results, or `null` if there are no more pages. **previous** `string` URL for the previous page of results, or `null` if on the first page. **results** `array` *required* Array of event objects. **Event object properties** **id** `integer` *required* Unique event identifier. **title** `string` *required* The event title or question. **markets** `array` *required* Array of market (outcome) objects for this event. **bet\_end\_date** `string` ISO 8601 timestamp when betting closes, or `null` if not set. **categories** `array` Array of category objects the event belongs to. **tags** `array` Array of tag objects associated with the event. ## Example ```python python theme={null} import requests response = requests.get( "https://api.futuur.com/v2.0/events/", params={ "search": "US election", "currency_mode": "play_money", "ordering": "-volume", "limit": 10, }, ) data = response.json() for event in data["results"]: print(event["id"], event["title"]) ``` ```bash curl theme={null} curl -G "https://api.futuur.com/v2.0/events/" \ --data-urlencode "search=US election" \ --data-urlencode "currency_mode=play_money" \ --data-urlencode "ordering=-volume" \ --data-urlencode "limit=10" ``` ```json Sample response theme={null} { "count": 42, "next": "https://api.futuur.com/v2.0/events/?limit=10&offset=10", "previous": null, "results": [ { "id": 12345, "title": "Who will win the 2024 US Presidential Election?", "bet_end_date": "2024-11-05T00:00:00Z", "markets": [ { "id": 67890, "name": "Candidate A", "price": 0.52 }, { "id": 67891, "name": "Candidate B", "price": 0.48 } ], "categories": [ {"id": 1, "name": "Politics", "slug": "politics"} ], "tags": [ {"slug": "us-election", "name": "US Election"} ] } ] } ``` # Price history Source: https://docs.futuur.com/api-reference/events/price-history Get historical price data for an event. Retrieve historical price data for all markets within a specific event. ## Endpoint ``` GET https://api.futuur.com/v2.0/events/{id}/price_history/ ``` ## Authentication > [!NOTE] > > This endpoint supports optional HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers for authenticated requests. See the [authentication guide](/authentication) for signing instructions. ## Request **id** `integer` *required* A unique integer value identifying this event. **currency\_mode** `string` (default: play\_money) Currency mode for price history. One of `play_money` or `real_money`. ## Response Returns historical price data points for each market in the event. ## Example ```bash cURL theme={null} curl -G "https://api.futuur.com/v2.0/events/12345/price_history/" \ --data-urlencode "currency_mode=play_money" ``` ```python Python theme={null} import requests response = requests.get( "https://api.futuur.com/v2.0/events/12345/price_history/", params={"currency_mode": "play_money"}, ) history = response.json() print(history) ``` # Related events Source: https://docs.futuur.com/api-reference/events/related-events Retrieve a list of events related to a given event by topic, category, and recent activity. Fetch events related to a specific event. Use this endpoint to surface similar markets when a user is viewing an event detail page, or to power a recommended feed. ## Endpoint ``` GET https://api.futuur.com/v2.0/events/{id}/related_events/ ``` ## Authentication No authentication is required for this endpoint. ## Parameters **id** `integer` *required* The unique identifier of the source event. ## Response Returns an array of related event objects. **id** `integer` *required* Unique identifier for the related event. **title** `string` *required* Display title of the related event. Maximum 150 characters. **wagers\_count** `integer` *required* Number of wagers placed on this event in play money. **wagers\_count\_canonical** `integer` *required* Number of wagers placed on this event in real money. **volume\_play\_money** `string` *required* Total play money volume traded on this event. Returned as a decimal string. **volume\_real\_money** `string` *required* Total real money volume traded on this event. Returned as a decimal string. **bet\_end\_date** `string` ISO 8601 datetime when betting closes. `null` if not set. **event\_start\_date** `string` ISO 8601 datetime when the underlying event begins. `null` if not set. **highest\_market** `string` *required* Title or label of the leading market in play money mode. **highest\_market\_real\_money** `string` *required* Title or label of the leading market in real money mode. ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/events/1023/related_events/" ``` ```json Sample response theme={null} [ { "id": 1187, "title": "Will the Nasdaq close above 18,000 by end of Q2 2026?", "wagers_count": 312, "wagers_count_canonical": 48, "volume_play_money": "84520.00", "volume_real_money": "1240.50", "bet_end_date": "2026-06-30T23:59:59Z", "event_start_date": "2026-01-15T00:00:00Z", "highest_market": "Yes", "highest_market_real_money": "Yes" }, { "id": 1206, "title": "Will the Federal Reserve cut rates before July 2026?", "wagers_count": 540, "wagers_count_canonical": 91, "volume_play_money": "120030.00", "volume_real_money": "3015.00", "bet_end_date": "2026-07-31T23:59:59Z", "event_start_date": null, "highest_market": "Yes", "highest_market_real_money": "No" } ] ``` # Retrieve event Source: https://docs.futuur.com/api-reference/events/retrieve Get detailed information about a specific prediction market event. Retrieve detailed information about a single event by its ID, including all associated markets and their current prices. ## Endpoint ``` GET https://api.futuur.com/v2.0/events/{id}/ ``` ## Authentication > [!NOTE] > > This endpoint supports HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers to access user-specific data. See the [authentication guide](/authentication) for signing instructions. ## Request **id** `integer` *required* A unique integer value identifying this event. ## Response Returns the full event object with all markets and metadata. **id** `integer` *required* Unique identifier for the event. **title** `string` *required* The prediction question. **slug** `string` *required* URL-friendly identifier. **status** `string` *required* Current state: `open`, `stopped`, `resolved`, `cancelled`, `paused`, or `reversed`. **markets** `object[]` *required* Array of market (outcome) objects for this event. **markets\_correlation** `string` *required* How markets relate to each other: `linked_prices` or `independent`. **description** `string` Full question details and resolution criteria. **bet\_end\_date** `string` ISO 8601 datetime when betting closes. **resolve\_date** `string` ISO 8601 datetime when the event was resolved. ## Example ```bash cURL theme={null} curl "https://api.futuur.com/v2.0/events/12345/" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" ``` ```python Python theme={null} import requests response = requests.get( "https://api.futuur.com/v2.0/events/12345/", headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", }, ) event = response.json() print(f"Event: {event['title']}") for market in event["markets"]: print(f" Market {market['id']}: {market['title']}") ``` ```json Sample response (200 OK) theme={null} { "id": 12345, "title": "Who will win the 2024 US Presidential Election?", "slug": "who-will-win-2024-us-presidential-election", "status": "open", "markets_correlation": "linked_prices", "description": "This market resolves based on...", "bet_end_date": "2024-11-05T00:00:00Z", "resolve_date": null, "markets": [ { "id": 67890, "title": "Candidate A", "price": 0.55 }, { "id": 67891, "title": "Candidate B", "price": 0.42 } ] } ``` # Event wagers Source: https://docs.futuur.com/api-reference/events/wagers List all wagers placed on a specific event, with optional filters for active status and currency mode. Retrieve all wagers associated with an event. Filter to active positions, past bets, or a specific currency mode to narrow the results. This endpoint returns a non-paginated array of `WagerList` objects. ## Endpoint ``` GET https://api.futuur.com/v2.0/events/{id}/wagers/ ``` ## Authentication HMAC authentication is required. Include the following headers with every request: | Header | Description | | - | - | | `Key` | Your public API key | | `Timestamp` | Current Unix timestamp | | `HMAC` | SHA-512 signature of the request payload | ## Parameters **id** `integer` *required* The unique identifier of the event. **active** `boolean` When `true`, returns only wagers that are currently active (open positions). When `false`, returns only inactive wagers. **currency\_mode** `string` (default: play\_money) Filter wagers by currency mode. Accepted values: `play_money`, `real_money`. **past\_bets** `boolean` When `true`, includes wagers that have already been settled or closed. ## Response Returns a JSON array of `WagerList` objects (no `pagination` wrapper). Each element includes: **Wager properties** **id** `integer` *required* Unique wager ID. **status** `string` *required* Wager status: `purchased`, `sold`, `won`, `lost`, `cancelled`, or `disabled`. **status\_display** `string` *required* Human-readable status label. **market** `string` *required* Market resource reference (read-only). **position** `string` *required* Position direction: `long` or `short`. **position\_display** `string` *required* Human-readable position label. **currency** `string` Currency code for the wager. **shares** `number` *required* Consolidated shares held in this wager. **total\_amount** `string` *required* Total amount associated with the wager. **purchases\_amount** `number` Cost basis of the open position. **roi** `string` *required* Return on investment for the wager. **last\_purchase** `string` *required* ISO 8601 datetime of the most recent purchase. **last\_update** `string` *required* ISO 8601 datetime of the most recent wager update. ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/events/1023/wagers/?currency_mode=play_money&active=true" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" ``` ```json Sample response theme={null} [ { "id": 4401, "status": "purchased", "status_display": "Purchased", "user": "https://api.futuur.com/v2.0/users/120/", "event": "https://api.futuur.com/v2.0/events/1023/", "market": "https://api.futuur.com/v2.0/markets/501/", "position": "long", "position_display": "Long", "currency": "OOM", "shares": 50.0, "shares_in_canonical": 50.0, "total_amount": "31.00", "purchases_amount": 31.0, "active_purchases_amount": "31.00", "roi": "8.06", "earnings": "2.50", "amount_on_win": "50.00", "amount_on_sell": "33.50", "last_profit": null, "last_purchase": "2026-03-15T14:22:10Z", "last_update": "2026-03-15T14:22:10Z", "actions_count": 1 } ] ``` # Order book Source: https://docs.futuur.com/api-reference/markets/order-book Retrieve aggregated order book data for a market, including bids and asks at each price level. Get the aggregated order book for a market. The response contains `bid` and `ask` arrays with cumulative depth data at each price level, allowing you to assess market liquidity and your position within it. ## Endpoint ``` GET https://api.futuur.com/v2.0/markets/{id}/book/ ``` ## Authentication No authentication is required for this endpoint. ## Parameters **id** `integer` *required* The unique identifier of the market. **currency\_mode** `string` *required* The currency mode to query. Accepted values: `play_money`, `real_money`. **position** `string` (default: long) The position side to query. Accepted values: `long`, `short`. ## Response **bid** `object[]` *required* Aggregated bid levels, sorted from highest to lowest price. **properties** **price** `number` Price per share at this level (0–1). **total\_shares** `number` Total number of shares available at this price level. **total\_amount** `number` Total currency amount represented at this price level. **total\_fees** `number` Total fees attributable to the shares offered at this price level. **cumulative\_shares** `number` Cumulative shares from the best bid down to and including this level. **cumulative\_amount** `number` Cumulative currency amount from the best bid down to and including this level. **cumulative\_fees** `number` Cumulative fees from the best bid down to and including this level. **total\_user\_shares** `number` Number of shares at this level belonging to you. Present when authenticated. **total\_user\_shares\_requested** `number` Number of shares at this level you have requested but that have not yet been filled. Present when authenticated. **ask** `object[]` *required* Aggregated ask levels, sorted from lowest to highest price. **properties** **price** `number` Price per share at this level (0–1). **total\_shares** `number` Total number of shares offered at this price level. **total\_amount** `number` Total currency amount represented at this price level. **total\_fees** `number` Total fees attributable to the shares offered at this price level. **cumulative\_shares** `number` Cumulative shares from the best ask up to and including this level. **cumulative\_amount** `number` Cumulative currency amount from the best ask up to and including this level. **cumulative\_fees** `number` Cumulative fees from the best ask up to and including this level. **total\_user\_shares** `number` Number of shares at this level belonging to you. Present when authenticated. **total\_user\_shares\_requested** `number` Number of shares at this level you have requested but that have not yet been filled. Present when authenticated. ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/markets/501/book/?currency_mode=play_money&position=long" ``` ```json Sample response theme={null} { "bid": [ { "price": 0.62, "total_shares": 120.0, "total_amount": 74.4, "total_fees": 0.12, "cumulative_shares": 120.0, "cumulative_amount": 74.4, "cumulative_fees": 0.12, "total_user_shares": 50.0, "total_user_shares_requested": 0.0 }, { "price": 0.60, "total_shares": 80.0, "total_amount": 48.0, "total_fees": 0.08, "cumulative_shares": 200.0, "cumulative_amount": 122.4, "cumulative_fees": 0.20, "total_user_shares": 0.0, "total_user_shares_requested": 0.0 } ], "ask": [ { "price": 0.64, "total_shares": 95.0, "total_amount": 60.8, "total_fees": 0.10, "cumulative_shares": 95.0, "cumulative_amount": 60.8, "cumulative_fees": 0.10, "total_user_shares": 0.0, "total_user_shares_requested": 10.0 }, { "price": 0.66, "total_shares": 60.0, "total_amount": 39.6, "total_fees": 0.06, "cumulative_shares": 155.0, "cumulative_amount": 100.4, "cumulative_fees": 0.16, "total_user_shares": 0.0, "total_user_shares_requested": 0.0 } ] } ``` # My balances Source: https://docs.futuur.com/api-reference/me/balances Retrieve ledger account balances for the authenticated user, one row per currency. Return ledger account balances for your authenticated account. Each object in the response represents one currency row with its current balance amount. ## Endpoint ``` GET https://api.futuur.com/v2.0/me/balances/ ``` ## Authentication This endpoint requires HMAC-SHA512 authentication. Include the following headers with every request: | Header | Description | | - | - | | `Key` | Your public API key | | `Timestamp` | Current Unix timestamp | | `HMAC` | SHA-512 signature of the request | ## Parameters **currency** `string` If set, returns only the balance for this currency code. Matching is case-insensitive (for example, `usdc` and `USDC` both match). ## Response Returns an array of balance objects. **currency** `string` *required* Currency code for this balance row (for example, `OOM`, `USDC`, `USDT`, `USD`). **amount** `string` *required* Current balance amount in this currency. Returned as a decimal string. > [!TIP] > > For full account profile fields (username, email, KYC status, and the aggregated `wallet` object), use [`GET /me/`](/api-reference/me/information). ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/me/balances/" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712345678" \ --header "HMAC: YOUR_HMAC_SIGNATURE" ``` ```json Sample response theme={null} [ { "currency": "OOM", "amount": "5000.00" }, { "currency": "USDC", "amount": "100.00" }, { "currency": "USDT", "amount": "0.00" }, { "currency": "USD", "amount": "0.00" } ] ``` ```bash Filter by currency theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/me/balances/?currency=USDC" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712345678" \ --header "HMAC: YOUR_HMAC_SIGNATURE" ``` ```json Filtered response theme={null} [ { "currency": "USDC", "amount": "100.00" } ] ``` # Account information Source: https://docs.futuur.com/api-reference/me/information Retrieve your account details and wallet balances. Returns details about your authenticated account, including your username, email address, wallet balances, and account status. For ledger balances broken out by currency, use [`GET /me/balances/`](/api-reference/me/balances). ## Endpoint ``` GET https://api.futuur.com/v2.0/me/ ``` ## Authentication This endpoint requires HMAC-SHA512 authentication. Include the following headers with every request: | Header | Description | | - | - | | `Key` | Your public API key | | `Timestamp` | Current Unix timestamp | | `HMAC` | SHA-512 signature of the request | ## Parameters This endpoint takes no parameters. ## Response Returns a `UserPrivate` object. **id** `integer` *required* Unique numeric identifier for your account. **username** `string` Your account username. **email** `string` *required* The email address associated with your account. **wallet** `object` *required* Dictionary of balances keyed by currency code (for example, `OOM`, `USDC`, `USDT`, `USD`). Values are decimal strings. **email\_confirmed** `boolean` *required* Whether you have confirmed your email address. **real\_currency\_enabled** `boolean` *required* Whether real money trading is enabled for your account. **kyc\_status** `string` *required* Current KYC status. One of `no_need`, `requested`, `initialized`, `refused`, `approved`, or `by_passed`. **date\_joined** `string` ISO 8601 timestamp of when you joined Futuur. ## Register a Safe address If you use a [Safe](https://safe.global) smart account, register it with Futuur by calling [`POST /me/safe/`](/api-reference/me/safe). The request body requires both a `safe_address` and a `chain_id`. On success, the response is the same `UserPrivate` object returned by `GET /me/`. ## Example ```bash theme={null} curl --request GET \ --url https://api.futuur.com/v2.0/me/ \ --header 'Key: YOUR_PUBLIC_KEY' \ --header 'Timestamp: 1712345678' \ --header 'HMAC: YOUR_HMAC_SIGNATURE' ``` ```json theme={null} { "id": 42, "username": "trader_jane", "email": "jane@example.com", "wallet": { "OOM": "5000.00", "USDC": "100.00", "USDT": "0.00", "USD": "0.00" }, "email_confirmed": true, "real_currency_enabled": true, "kyc_status": "approved", "date_joined": "2024-03-15T10:00:00Z" } ``` # My ranking Source: https://docs.futuur.com/api-reference/me/ranking Get your current leaderboard ranking. Returns your current position on the Futuur leaderboard. Use this endpoint to track your standing relative to other traders. ## Endpoint ``` GET https://api.futuur.com/v2.0/me/ranking/ ``` ## Authentication This endpoint requires HMAC-SHA512 authentication. Include the following headers with every request: | Header | Description | | - | - | | `Key` | Your public API key | | `Timestamp` | Current Unix timestamp | | `HMAC` | SHA-512 signature of the request | ## Parameters This endpoint takes no parameters. ## Response **ranking** `string` *required* Your current leaderboard ranking as returned by the API. ## Example ```bash theme={null} curl --request GET \ --url https://api.futuur.com/v2.0/me/ranking/ \ --header 'Key: YOUR_PUBLIC_KEY' \ --header 'Timestamp: 1712345678' \ --header 'HMAC: YOUR_HMAC_SIGNATURE' ``` ```json theme={null} { "ranking": "127" } ``` # Register Safe address Source: https://docs.futuur.com/api-reference/me/safe Register a Safe smart account address for the authenticated user. Register a [Safe](https://safe.global) smart account address with your Futuur account. After registration, you can use your Safe to fund and settle real money trades on supported chains. > [!NOTE] > > On-chain CLOB trading is coming soon. Registering a Safe is available today. Enable-trading, signing-context, and per-order EIP-712 intents are described in [On-chain trading](/concepts/on-chain-trading) so you can prepare. ## Endpoint ``` POST https://api.futuur.com/v2.0/me/safe/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Request **safe\_address** `string` *required* The Safe smart account address (e.g. `0xAbC...123`). **chain\_id** `integer` *required* The chain ID where the Safe is deployed. For example, `1` for Ethereum mainnet or `137` for Polygon. ## Response Returns `200 OK` with the updated `UserPrivate` object — the same shape as `GET /me/`. Use this response to confirm the Safe address has been associated with your account. **id** `integer` *required* Your account identifier. **username** `string` Your account username. **email** `string` *required* The email address associated with your account. **wallet** `object` *required* Dictionary containing balances for every currency in your wallet. **is\_wallet\_user** `string` *required* `true` if you signed up via wallet (Privy). **real\_currency\_enabled** `boolean` *required* Whether real money trading is enabled for your account. **kyc\_status** `string` *required* Current KYC status. One of `no_need`, `requested`, `initialized`, `refused`, `approved`, or `by_passed`. > [!TIP] > > See [Account information](/api-reference/me/information) for the full list of `UserPrivate` fields returned by this endpoint. ## Example ```bash cURL theme={null} curl --request POST \ --url "https://api.futuur.com/v2.0/me/safe/" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" \ --header "Content-Type: application/json" \ --data '{ "safe_address": "0xAbC1234567890DefAbC1234567890DefAbC12345", "chain_id": 137 }' ``` ```json Sample response (200 OK) theme={null} { "id": 42, "username": "trader_jane", "email": "jane@example.com", "wallet": { "OOM": "5000.00", "USDC": "100.00" }, "is_wallet_user": "true", "real_currency_enabled": true, "kyc_status": "approved" } ``` # Batch cancel orders Source: https://docs.futuur.com/api-reference/orders/batch-cancel Cancel multiple open limit orders by ID in a single request. Cancel a list of open limit orders in one API call. Each order is canceled independently — a failure on one order does not block the others. Use this to wind down a quoting ladder or unwind a set of stale orders quickly. ## Endpoint ``` POST https://api.futuur.com/v2.0/orders/batch-cancel/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Request **order\_ids** `integer[]` *required* Array of limit order IDs to cancel. Must contain at least one ID. ## Response Returns `200 OK` with a result item for each requested order ID, in the same order as the request. **index** `integer` *required* Zero-based position of this order in the request payload. **order\_id** `integer` *required* The order ID that was submitted. **success** `boolean` *required* `true` if the order was canceled. **error** `string` Human-readable error message when `success` is `false`. For example, `Order is being processed.` or `Order already filled.` ## Example ```bash cURL theme={null} curl --request POST \ --url "https://api.futuur.com/v2.0/orders/batch-cancel/" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" \ --header "Content-Type: application/json" \ --data '{ "order_ids": [100, 101, 102] }' ``` ```json Sample response (200 OK) theme={null} [ { "index": 0, "order_id": 100, "success": true }, { "index": 1, "order_id": 101, "success": false, "error": "Order is being processed." }, { "index": 2, "order_id": 102, "success": true } ] ``` > [!TIP] > > To cancel every open order at once instead of providing IDs, use [Cancel all orders](/api-reference/orders/cancel-all). # Batch create orders Source: https://docs.futuur.com/api-reference/orders/batch-create Submit between 1 and 20 limit orders in a single request. Create multiple limit or market orders in a single API call. Each item in the `orders` array is validated and matched independently — partial failures do not block successful orders in the same batch. Use this endpoint to quote ladders, hedge positions, or rebalance across multiple markets without sending separate requests. ## Endpoint ``` POST https://api.futuur.com/v2.0/orders/batch/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Headers **Idempotency-Key** `string` Optional. A unique value chosen by the client for a logical operation. Replaying the same `POST` with the same key and the same JSON body returns the stored response without creating duplicate orders. A different body produces a new fingerprint, so requoting is not blocked. ## Request **orders** `object[]` *required* An array of 1 to 20 order objects. Each entry follows the same shape as [Create order](/api-reference/orders/create). **order properties** **market** `integer` *required* Market (outcome) ID for this order. **event** `integer` Optional event ID. When set, the API verifies the market belongs to this event. **side** `string` *required* Order side: `bid` (buy) or `ask` (sell). **position** `string` *required* Position direction: `long` (in favor of the outcome) or `short` (against). **price** `number` Limit price between 0 and 1. Use `null` for a market order. **shares** `number` *required* Number of shares to buy or sell. Submitted as a decimal string. **amount** `number` Optional total cost for validation against `shares` and `price`. **currency** `string` *required* Currency for the order: `USDC`, `USDT`, `USD`, or `OOM`. **expired\_at** `string` ISO 8601 datetime when the order should auto-cancel. `null` for no expiration. **cancel\_conflicting\_orders** `boolean` (default: false) When `true`, conflicting open orders are canceled before the new order is placed. ## Response Returns `200 OK` with one result per submitted order, plus the IDs of any conflicting orders that were canceled to make room for them. **results** `object[]` *required* Per-order result, returned in the same order as the request. **result properties** **index** `integer` *required* Zero-based position of this order in the request payload. **success** `boolean` *required* `true` if the order was created. **order** `object` Created limit order. Present when `success` is `true`. **errors** `any` Validation error for this order. Present when `success` is `false`. May be a string or an object describing field-level issues. **cancelled\_existing\_order\_ids** `integer[]` *required* IDs of existing open orders that were canceled because `cancel_conflicting_orders` was set on one or more items in the batch. ## Example ```bash cURL theme={null} curl --request POST \ --url "https://api.futuur.com/v2.0/orders/batch/" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" \ --header "Idempotency-Key: 5b1f0c0a-0b9f-4d3a-9f8c-1d2b3a4e5f60" \ --header "Content-Type: application/json" \ --data '{ "orders": [ { "event": 873, "market": 2231, "shares": "13", "currency": "OOM", "position": "long", "side": "bid", "price": "0.43" }, { "event": 873, "market": 2231, "shares": "0.04", "currency": "OOM", "position": "short", "side": "bid", "price": "0.44" } ] }' ``` ```json Sample response (200 OK) theme={null} { "results": [ { "index": 0, "success": true, "order": { "id": 10501, "event": "873", "market": "2231", "price": 0.43, "shares": 13.0, "shares_requested": 13.0, "shares_filled": "0.0", "currency": "OOM", "side": "bid", "position": "long", "expired_at": null, "status": "open", "created": "2026-04-07T12:00:00Z" } }, { "index": 1, "success": false, "errors": "InvalidShares" } ], "cancelled_existing_order_ids": [] } ``` # Batch update orders Source: https://docs.futuur.com/api-reference/orders/batch-update Update between 1 and 20 open limit orders in a single request. Update multiple open limit orders in a single API call. Each update cancels the existing open order and creates a replacement with the updated fields, so all order-book validations run normally. Partial failures do not block successful updates in the same batch. ## Endpoint ``` POST https://api.futuur.com/v2.0/orders/batch-update/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Headers **Idempotency-Key** `string` Optional. A unique value chosen by the client for a logical operation. Replaying the same `POST` with the same key and the same JSON body returns the stored response without applying duplicate updates. A different body produces a new fingerprint, so requoting is not blocked. ## Request **orders** `object[]` *required* An array of 1 to 20 update objects. Each entry must include the `id` of an open order plus the fields to change. **update properties** **id** `integer` *required* ID of the open limit order to update. **shares** `string` Updated number of shares. Submitted as a decimal string. **price** `string` Updated limit price between 0 and 1. Submitted as a decimal string. **expired\_at** `string | null` Updated ISO 8601 expiration datetime. Use `null` to remove expiration. ## Response Returns `200 OK` with one result per submitted update, in the same order as the request. **index** `integer` *required* Zero-based position of this update in the request payload. **order\_id** `integer` The original order ID that was submitted for update. **success** `boolean` *required* `true` if the order was updated. **order** `object` Replacement limit order. Present when `success` is `true`. See [List orders](/api-reference/orders/list) for the `LimitOrder` field reference. **errors** `any` Validation error for this update. Present when `success` is `false`. May be a string or an object describing field-level issues. ## Example ```bash cURL theme={null} curl --request POST \ --url "https://api.futuur.com/v2.0/orders/batch-update/" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" \ --header "Idempotency-Key: 5b1f0c0a-0b9f-4d3a-9f8c-1d2b3a4e5f60" \ --header "Content-Type: application/json" \ --data '{ "orders": [ { "id": 100, "shares": "12", "price": "0.48" }, { "id": 101, "expired_at": null } ] }' ``` ```json Sample response (200 OK) theme={null} [ { "index": 0, "order_id": 100, "success": true, "order": { "id": 10550, "event": "873", "market": "2231", "price": 0.48, "shares": 12.0, "shares_requested": 12.0, "shares_filled": "0.0", "currency": "OOM", "side": "bid", "position": "long", "expired_at": null, "status": "open", "created": "2026-06-25T12:00:00Z" } }, { "index": 1, "order_id": 101, "success": false, "errors": "Order is being processed." } ] ``` > [!TIP] > > To create new orders instead of updating existing ones, use [Batch create orders](/api-reference/orders/batch-create). # Cancel order Source: https://docs.futuur.com/api-reference/orders/cancel Cancel an open limit order by its ID. Cancel an open limit order. Only orders with a status of `open` or `partial_filled` can be canceled. Orders that are already `filled`, `canceled`, or `processing` cannot be canceled. ## Endpoint ``` PATCH https://api.futuur.com/v2.0/orders/{id}/cancel/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Request **id** `integer` *required* The ID of the limit order to cancel. This endpoint does not accept a request body. ## Response Returns `204 No Content` on success. No response body is returned. > [!WARNING] > > Attempting to cancel an order that is already `filled`, `canceled`, or in `processing` state will return a `400` or `404` error. Verify the order status using [List orders](/api-reference/orders/list) before canceling. ## Example ```bash cURL theme={null} curl --request PATCH \ --url "https://api.futuur.com/v2.0/orders/10482/cancel/" \ --header "Key: pk_live_abc123def456" \ --header "Timestamp: 1712534400" \ --header "HMAC: 3a9f2c1b...sha512signature" ``` ``` HTTP/1.1 204 No Content ``` # Cancel all orders Source: https://docs.futuur.com/api-reference/orders/cancel-all Cancel every active limit order on your account, optionally scoped to a single event or market. Cancel all active limit orders for the authenticated user in one call. You can scope the cancellation to a specific event or market — useful when you want to retire a single ladder or quickly unwind your exposure on one outcome without touching the rest of your book. ## Endpoint ``` POST https://api.futuur.com/v2.0/orders/cancel-all/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Request The request body is optional. If you submit an empty body, every active order on your account is canceled. **event** `integer` Limit the cancellation to orders on a specific event (question) ID. **market** `integer` Limit the cancellation to orders on a specific market (outcome) ID. Can be combined with `event` to scope further. ## Response Returns `200 OK` with two arrays of order IDs. **canceled\_order\_ids** `integer[]` *required* IDs of orders that were successfully canceled. **processing\_order\_ids** `integer[]` *required* IDs of orders that could not be canceled immediately because they were already being processed (for example, mid-fill). Retry these IDs with [Batch cancel](/api-reference/orders/batch-cancel) after a short delay if you need them removed. ## Example ```bash cURL — cancel everything theme={null} curl --request POST \ --url "https://api.futuur.com/v2.0/orders/cancel-all/" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" \ --header "Content-Type: application/json" \ --data '{}' ``` ```bash cURL — scope to a market theme={null} curl --request POST \ --url "https://api.futuur.com/v2.0/orders/cancel-all/" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" \ --header "Content-Type: application/json" \ --data '{"event": 873, "market": 2231}' ``` ```json Sample response (200 OK) theme={null} { "canceled_order_ids": [100, 101], "processing_order_ids": [102] } ``` # Create order Source: https://docs.futuur.com/api-reference/orders/create Place a new limit or market order on a prediction market outcome. Place a new limit order or market order on a specific market outcome. Set `price` to a value between 0 and 1 for a limit order, or leave it `null` to execute at the current market price. ## Endpoint ``` POST https://api.futuur.com/v2.0/orders/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. > [!NOTE] > > On-chain CLOB trading is coming soon. The live request body is HMAC-only. When settlement moves on-chain, creates will also require `chain_id`, `order_intent_signature`, and `order_intent_expiry`. Those fields are **not** accepted on production today. See [Place an on-chain order](/guides/on-chain-first-order). ## Headers **Idempotency-Key** `string` Optional. A unique value chosen by the client for a logical operation. Replaying the same `POST` with the same key and the same JSON body returns the stored response without creating a duplicate order. A different body (for example, a new price) produces a different fingerprint, so requoting is not blocked. ## Request **market** `integer` *required* The market (outcome) ID to place the order on. **side** `string` *required* Order side. Use `bid` to purchase shares or `ask` to sell shares. **currency** `string` *required* Currency for the order. One of `USDC`, `USDT`, `USD`, or `OOM`. **price** `number` Limit price expressed as a probability between 0 and 1. Set to `null` to place a market order that executes immediately at the best available price. **shares** `number` Number of shares to buy or sell. **amount** `number` Total cost of the order in currency units. Used for validation against `shares` and `price`. Optional if `shares` is provided. **position** `string` Position direction. Use `long` to bet in favor of the outcome, or `short` to bet against it. **time\_in\_force** `string` (default: gtc) `gtc` (default): the order rests on the book until it is fully filled or canceled. `ioc` (immediate or cancel): the order fills right away at `price` or better, and any unfilled remainder is canceled. `ioc` requires a `price`. A priceless order is already a market order. **expired\_at** `string` ISO 8601 datetime at which an unfilled or partially filled limit order is automatically canceled. Set to `null` for no expiration. **cancel\_conflicting\_orders** `boolean` (default: false) When `true`, any existing open orders that conflict with this order are canceled before the new order is placed. ## Response Returns `201 Created` with the newly created order object. **id** `integer` *required* Unique ID of the created order. **market** `integer` *required* Market (outcome) ID the order is placed on. **side** `string` *required* Order side: `bid` or `ask`. **currency** `string` *required* Currency used: `USDC`, `USDT`, `USD`, or `OOM`. **price** `number` Limit price between 0 and 1, or `null` for a market order. **shares** `number` Number of shares in the order. **amount** `number` Cost of the order in currency units. **position** `string` Position direction: `long` or `short`. **status** `string` *required* Initial order status. Typically `open` or `processing` immediately after creation. **expired\_at** `string` Expiration datetime, or `null` if no expiration is set. **created\_at** `string` *required* ISO 8601 datetime when the order was created. ## Error codes > [!WARNING] > > The following application-level error codes may be returned in the response body when the order cannot be created. | Error code | Description | | - | - | | `RealMoneyForbiddenCountry` | Real-money trading is not available in your country. | | `RealMoneyBetNotAllowed` | Your account is not permitted to place real-money orders. | | `EmailNotConfirmed` | You must confirm your email address before placing orders. | | `UserBlockedBets` | Your account has been blocked from placing orders. | | `InvalidHMACKey` | The HMAC signature or key is invalid. | | `UserNotEnoughBalance` | Your account balance is insufficient for this order. | | `InvalidShares` | The number of shares specified is not valid. | | `OutcomeDisabled` | The selected market outcome is currently disabled. | | `MarketClosed` | The market is closed and no longer accepting orders. | | `OrderBookMarketClosed` | The order book for this market is closed. | | `OrderBookConflictingOrders` | Conflicting open orders exist. Set `cancel_conflicting_orders` to `true` to resolve. | | `OrderBookInvalidAmount` | The order amount does not meet the minimum or maximum requirements. | ## Example ```bash cURL theme={null} curl --request POST \ --url "https://api.futuur.com/v2.0/orders/" \ --header "Key: pk_live_abc123def456" \ --header "Timestamp: 1712534400" \ --header "HMAC: 3a9f2c1b...sha512signature" \ --header "Content-Type: application/json" \ --data '{ "market": 3801, "side": "bid", "currency": "USDC", "price": 0.65, "shares": 100, "position": "long", "cancel_conflicting_orders": false }' ``` ```json Sample response (201 Created) theme={null} { "id": 10483, "market": 3801, "side": "bid", "currency": "USDC", "price": 0.65, "shares": 100.0, "amount": 65.0, "position": "long", "status": "open", "expired_at": null, "created_at": "2026-04-07T11:30:00Z" } ``` # List orders Source: https://docs.futuur.com/api-reference/orders/list Retrieve a paginated list of your limit orders, with optional filters by market, event, currency, status, and side. Retrieve a list of limit orders associated with your account. By default, only `open` orders are returned. Use the query parameters to filter by market, event, currency mode, status, or order side. ## Endpoint ``` GET https://api.futuur.com/v2.0/orders/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Request **status** `string` (default: open) Filter orders by status. One of `open`, `partial_filled`, `filled`, `canceled`, or `processing`. **side** `string` Filter by order side. Use `bid` for buy orders or `ask` for sell orders. **market** `integer` Filter orders by market (outcome) ID. **event** `integer` Filter orders by event ID. **currency** `string` Filter by a specific currency code. Maximum 4 characters (e.g., `USDC`, `OOM`). **currency\_mode** `string` Filter by currency mode. One of `play_money` or `real_money`. **currencies** `string[]` Filter by one or more currency codes. **categories** `integer[]` Filter by one or more category IDs. **search** `string` Full-text search query. Maximum 255 characters. **ordering** `string` Field to sort results by. Prefix with `-` for descending order (e.g., `-created_at`). **limit** `integer` Number of results to return per page. **offset** `integer` Pagination offset. Number of results to skip before returning results. ## Response Returns a paginated list of limit order objects. **pagination** `object` *required* Pagination metadata for the result set. **properties** **total** `integer` Total number of orders matching the query. **next** `string` URL for the next page of results. `null` if there are no more pages. **previous** `string` URL for the previous page of results. `null` if on the first page. **page\_size** `integer` Number of results returned per page. **offset** `integer` Current pagination offset. **results** `object[]` *required* Array of limit order objects. **Order properties** **id** `integer` *required* Unique order ID. **market** `integer` *required* Market (outcome) ID the order is placed on. **side** `string` *required* Order side: `bid` (buy) or `ask` (sell). **currency** `string` *required* Currency used for the order: `USDC`, `USDT`, `USD`, or `OOM`. **price** `number` Limit price as a probability between 0 and 1. `null` for market orders. **shares** `number` Number of shares in the order. **amount** `number` Cost of the order in currency units. **position** `string` Position direction: `long` (betting in favor of the outcome) or `short` (betting against). **status** `string` *required* Current order status: `open`, `partial_filled`, `filled`, `canceled`, or `processing`. **expired\_at** `string` ISO 8601 datetime at which the order expires. `null` if no expiration is set. **created\_at** `string` *required* ISO 8601 datetime when the order was created. ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/orders/?status=open&side=bid&limit=2" \ --header "Key: pk_live_abc123def456" \ --header "Timestamp: 1712534400" \ --header "HMAC: 3a9f2c1b...sha512signature" ``` ```json Sample response theme={null} { "pagination": { "total": 47, "next": "https://api.futuur.com/v2.0/orders/?limit=2&offset=2&status=open", "previous": null, "page_size": 2, "offset": 0 }, "results": [ { "id": 10482, "market": 3801, "side": "bid", "currency": "USDC", "price": 0.65, "shares": 100.0, "amount": 65.0, "position": "long", "status": "open", "expired_at": null, "created_at": "2026-04-05T14:22:10Z" }, { "id": 10479, "market": 4112, "side": "bid", "currency": "USDC", "price": 0.42, "shares": 50.0, "amount": 21.0, "position": "long", "status": "open", "expired_at": "2026-04-30T00:00:00Z", "created_at": "2026-04-04T09:05:33Z" } ] } ``` # List wagers Source: https://docs.futuur.com/api-reference/wagers/list Retrieve a paginated list of wagers, with optional filters by user, event, activity status, and currency mode. Retrieve a list of wagers. You can filter by active status, event, currency mode, or by bets placed by users you follow. Authenticated requests return your own wagers by default. Public wagers can also be accessed without authentication. ## Endpoint ``` GET https://api.futuur.com/v2.0/wagers/ ``` ## Authentication > [!NOTE] > > Authentication is optional for this endpoint. Unauthenticated requests can access public wager data. To access your own private wagers or filter by followed users, include the `Key`, `Timestamp`, and `HMAC` headers. ## Request **active** `boolean` When `true`, returns only active wagers with a status of `purchased`. **past\_bets** `boolean` When `true`, returns only inactive wagers — those that are sold, won, lost, cancelled, or disabled. **event** `integer` Filter wagers by event ID. **user** `integer` Filter wagers by user ID. **following** `boolean` When `true`, returns only wagers placed by users you follow. **currency\_mode** `string` Filter by currency mode: `play_money`, `real_money`, or an empty string to return all. **limit** `integer` Number of results to return per page. **offset** `integer` Pagination offset. Number of results to skip before returning results. ## Response Returns a paginated list of wager objects. **pagination** `object` *required* Pagination metadata for the result set. **properties** **total** `integer` Total number of wagers matching the query. **next** `string` URL for the next page of results. `null` if there are no more pages. **previous** `string` URL for the previous page of results. `null` if on the first page. **page\_size** `integer` Number of results returned per page. **offset** `integer` Current pagination offset. **results** `object[]` *required* Array of `WagerList` objects. **Wager properties** **id** `integer` *required* Unique wager ID. **status** `string` *required* Wager status: `purchased`, `sold`, `won`, `lost`, `cancelled`, or `disabled`. **status\_display** `string` *required* Human-readable status label. **user** `string` *required* User resource reference (read-only). **event** `string` *required* Event resource reference (read-only). **market** `string` *required* Market resource reference (read-only). **position** `string` *required* Position direction: `long` (in favor of the outcome) or `short` (against). **position\_display** `string` *required* Human-readable position label. **currency** `string` Currency code for the wager (for example `OOM`, `USDC`). **shares** `number` *required* Consolidated shares held in this wager. **shares\_in\_canonical** `number` *required* Consolidated shares expressed in the event's canonical currency. **total\_amount** `string` *required* Total amount associated with the wager. **purchases\_amount** `number` Cost basis of the open position, adjusted for partial sales. **active\_purchases\_amount** `string` *required* Amount from active purchases on this wager. **active\_purchases** Purchases from the last outcome bought in this event. **roi** `string` *required* Return on investment for the wager. **earnings** `string` *required* Earnings associated with the wager. **amount\_on\_win** `string` *required* Projected payout if the wager wins. **amount\_on\_sell** `string` *required* Amount available if the position is sold now. **last\_profit** `number` Last profit when the event resolved or the wager was sold. `null` if not applicable. **last\_sell\_amount** `number` Last sale amount when the wager was sold. Always positive when set. **last\_purchase** `string` *required* ISO 8601 datetime of the most recent purchase. **last\_update** `string` *required* ISO 8601 datetime of the most recent wager update. **last\_action** Serialized data about the most recent `WagerAction` on this wager. **actions\_count** `integer` Number of user-triggered actions (purchases, sales) on this wager. ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/wagers/?active=true¤cy_mode=real_money&limit=2" \ --header "Key: pk_live_abc123def456" \ --header "Timestamp: 1712534400" \ --header "HMAC: 3a9f2c1b...sha512signature" ``` ```json Sample response theme={null} { "pagination": { "total": 12, "next": "https://api.futuur.com/v2.0/wagers/?active=true¤cy_mode=real_money&limit=2&offset=2", "previous": null, "page_size": 2, "offset": 0 }, "results": [ { "id": 88201, "status": "purchased", "status_display": "Purchased", "user": "https://api.futuur.com/v2.0/users/5042/", "event": "https://api.futuur.com/v2.0/events/901/", "market": "https://api.futuur.com/v2.0/markets/3801/", "position": "long", "position_display": "Long", "currency": "USDC", "shares": 100.0, "shares_in_canonical": 100.0, "total_amount": "65.00", "purchases_amount": 65.0, "active_purchases_amount": "65.00", "roi": "10.00", "earnings": "6.50", "amount_on_win": "100.00", "amount_on_sell": "71.50", "last_profit": null, "last_sell_amount": null, "last_purchase": "2026-04-05T14:22:10Z", "last_update": "2026-04-07T08:15:44Z", "last_action": null, "actions_count": 1 } ] } ``` # Maker rebates Source: https://docs.futuur.com/api-reference/wagers/rebates Retrieve current rebated fees for the authenticated maker. Return the total rebated maker fees for your account, optionally filtered by date or event. ## Endpoint ``` GET https://api.futuur.com/v2.0/wagers/rebates/ ``` ## Authentication > [!NOTE] > > This endpoint requires HMAC authentication. Include the `Key`, `Timestamp`, and `HMAC` headers on every request. See the [authentication guide](/authentication) for signing instructions. ## Parameters **date** `string` Filter rebates to a specific calendar date (`YYYY-MM-DD`). **event** `integer` Filter rebates to a specific event ID. ## Response **rebated\_fee\_usd** `number` *required* Total rebated fees in USD for the selected scope. ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/wagers/rebates/?date=2026-06-25&event=1023" \ --header "Key: YOUR_PUBLIC_KEY" \ --header "Timestamp: 1712500000" \ --header "HMAC: YOUR_HMAC_SIGNATURE" ``` ```json Sample response theme={null} { "rebated_fee_usd": 12.45 } ``` # Retrieve wager Source: https://docs.futuur.com/api-reference/wagers/retrieve Retrieve detailed information about a single wager by its ID. Retrieve full details for a specific wager, including share count, cost basis, ROI, and resolution status. Public wagers are accessible without authentication. ## Endpoint ``` GET https://api.futuur.com/v2.0/wagers/{id}/ ``` ## Authentication > [!NOTE] > > Authentication is optional for this endpoint. Unauthenticated requests can retrieve public wager data. To access private wagers, include the `Key`, `Timestamp`, and `HMAC` headers. ## Request **id** `integer` *required* The ID of the wager to retrieve. ## Response Returns a `WagerDetail` object. Fields match `WagerList` with the addition of `actions`. **id** `integer` *required* Unique wager ID. **status** `string` *required* Wager status: `purchased`, `sold`, `won`, `lost`, `cancelled`, or `disabled`. **status\_display** `string` *required* Human-readable status label. **user** `string` *required* User resource reference (read-only). **event** `string` *required* Event resource reference (read-only). **market** `string` *required* Market resource reference (read-only). **position** `string` *required* Position direction: `long` (in favor of the outcome) or `short` (against). **position\_display** `string` *required* Human-readable position label. **currency** `string` Currency code for the wager (for example `OOM`, `USDC`). **shares** `number` *required* Consolidated shares held in this wager. **shares\_in\_canonical** `number` *required* Consolidated shares expressed in the event's canonical currency. **total\_amount** `string` *required* Total amount associated with the wager. **purchases\_amount** `number` Cost basis of the open position, adjusted for partial sales. **active\_purchases\_amount** `string` *required* Amount from active purchases on this wager. **active\_purchases** Purchases from the last outcome bought in this event. **roi** `string` *required* Return on investment for the wager. **earnings** `string` *required* Earnings associated with the wager. **amount\_on\_win** `string` *required* Projected payout if the wager wins. **amount\_on\_sell** `string` *required* Amount available if the position is sold now. **last\_profit** `number` Last profit when the event resolved or the wager was sold. `null` if not applicable. **last\_sell\_amount** `number` Last sale amount when the wager was sold. Always positive when set. **last\_purchase** `string` *required* ISO 8601 datetime of the most recent purchase. **last\_update** `string` *required* ISO 8601 datetime of the most recent wager update. **last\_action** Serialized data about the most recent `WagerAction` on this wager. **actions\_count** `integer` Number of user-triggered actions (purchases, sales) on this wager. **actions** `string` *required* Serialized wager action history (read-only). ## Example ```bash cURL theme={null} curl --request GET \ --url "https://api.futuur.com/v2.0/wagers/88201/" \ --header "Key: pk_live_abc123def456" \ --header "Timestamp: 1712534400" \ --header "HMAC: 3a9f2c1b...sha512signature" ``` ```json Sample response theme={null} { "id": 88201, "status": "purchased", "status_display": "Purchased", "user": "https://api.futuur.com/v2.0/users/5042/", "event": "https://api.futuur.com/v2.0/events/901/", "market": "https://api.futuur.com/v2.0/markets/3801/", "position": "long", "position_display": "Long", "currency": "USDC", "shares": 100.0, "shares_in_canonical": 100.0, "total_amount": "65.00", "purchases_amount": 65.0, "active_purchases_amount": "65.00", "roi": "10.00", "earnings": "6.50", "amount_on_win": "100.00", "amount_on_sell": "71.50", "last_profit": null, "last_sell_amount": null, "last_purchase": "2026-04-05T14:22:10Z", "last_update": "2026-04-07T08:15:44Z", "last_action": null, "actions_count": 1, "actions": "https://api.futuur.com/v2.0/wagers/88201/actions/" } ``` # Authorization Source: https://docs.futuur.com/api-reference/websocket/authorization Authorize private Pusher channels with HMAC-signed requests to the Futuur auth endpoint. Pusher requires an authorization token before a client can subscribe to a private channel. When subscribing, the Pusher client sends `socket_id` and `channel_name` to your authorization endpoint. API bots call Futuur's channel authorization endpoint: ``` POST https://api.futuur.com/v2.0/pusher/auth/ ``` `POST https://api.futuur.com/v2.0/pusher/user-auth/` is also available and unchanged. Authenticate with HMAC headers (`Key`, `Timestamp`, `HMAC`). Sign the request using alphabetically sorted parameters: ``` Key={{your_public_key}}&Timestamp={{current_timestamp}}&channel_name={{channel_name}}&socket_id={{socket_id}} ``` See [Authentication](/authentication) for the general HMAC signing flow. ```javascript Node.js theme={null} const crypto = require("crypto"); const API_PUBLIC_KEY = "your_public_key"; const API_PRIVATE_KEY = "your_private_key"; const CHANNEL_AUTH_ENDPOINT = "https://api.futuur.com/v2.0/pusher/auth/"; async function authorizeChannel(socketId, channelName) { const timestamp = String(Math.floor(Date.now() / 1000)); const paramsToSign = { Key: API_PUBLIC_KEY, Timestamp: timestamp, channel_name: channelName, socket_id: socketId, }; const rawToSign = new URLSearchParams( Object.entries(paramsToSign).sort(([a], [b]) => a.localeCompare(b)), ).toString(); const signature = crypto .createHmac("sha512", API_PRIVATE_KEY) .update(rawToSign) .digest("hex"); const response = await fetch(CHANNEL_AUTH_ENDPOINT, { method: "POST", headers: { Key: API_PUBLIC_KEY, Timestamp: timestamp, HMAC: signature, "Content-Type": "application/x-www-form-urlencoded", }, body: new URLSearchParams({ socket_id: socketId, channel_name: channelName, }), }); if (!response.ok) { throw new Error("Forbidden"); } return response.json(); // { auth: "..." } } ``` ```javascript pusher-js theme={null} const Pusher = require("pusher-js"); const pusher = new Pusher("9011f7eac38e825792d5", { cluster: "us2", channelAuthorization: { customHandler: ({ socketId, channelName }, callback) => { authorizeChannel(socketId, channelName) .then((authResponse) => callback(null, authResponse)) .catch((err) => callback(err, null)); }, }, }); const channel = pusher.subscribe("private-user-1"); ``` A user may only subscribe to their own `private-user-{user_id}` channel. Public channels (`event` and `event-{event_id}`) do not require authorization. ## Related * [Overview](/api-reference/websocket/overview) — Pusher client setup * [Channels and events](/api-reference/websocket/channels-and-events) — private user channel events * [Authentication](/authentication) — HMAC signing details # Channels and events Source: https://docs.futuur.com/api-reference/websocket/channels-and-events Catalog of Pusher channels and realtime events for markets, order books, and account updates. This is the complete catalog of realtime channels and the events published on each. Terminology: **event** = a question; **market** = an outcome. For client setup, see [Overview](/api-reference/websocket/overview). Private channels require [Authorization](/api-reference/websocket/authorization). ## Channels | Channel | Type | Auth | Purpose | | - | - | - | - | | `event` | public | none | Global feed of event and market activity | | `event-{event_id}` | public | none | Per-event BBO, order-book, and status updates | | `private-user-{user_id}` | private | `POST https://api.futuur.com/v2.0/pusher/auth/` | Per-user balance, deposit, order, and position updates | | `test-channel` | public | none | Connectivity testing (`test-event` only) | ## Events at a glance | Event | Channel | Emitted when | | - | - | - | | `best-prices-change` | `event`, `event-{event_id}` | A wagerable market's best bid/ask changes | | `price-change` | `event` | An event's price or volume state changes | | `new-market` | `event` | A new market is added to an event | | `live-data-update` | `event` | Live data, status, or resolution changes | | `market-status-change` | `event`, `event-{event_id}` | Tradability fields change (status, bet window, disabled) | | `market-comment` | `event` | A user posts a comment on an event | | `order-book-update` | `event-{event_id}` | Absolute top-N bid/ask levels for a changed market | | `balance-changed` | `private-user-{user_id}` | The user's balance changes | | `deposit-success` | `private-user-{user_id}` | A deposit completes | | `order-update` | `private-user-{user_id}` | An order is created or its status changes | | `position-update` | `private-user-{user_id}` | The user's wager shares change | > [!NOTE] > > Full-depth `order-book-snapshot` pushes are **not** emitted (Pusher message size limits). `order-book-update` carries top-N levels per market. For depth beyond top-N, call the REST [order book](/api-reference/markets/order-book) API. ## Event channel (public) Global public feed on channel `event`. Subscribe with `pusher.subscribe("event")`; no authentication required. ### best-prices-change Emitted when the best bid/ask of a **wagerable** market changes. Non-wagerable markets are skipped to stay within Pusher limits. Also published on `event-{event_id}` with the same payload, so quoting bots can avoid the global `event` fanout: ```javascript theme={null} pusher.subscribe("event-" + eventId).bind("best-prices-change", ...); ``` **market\_id** `integer` Market (outcome) ID. **event\_id** `integer` Event ID. **currency\_mode** `string` `play_money` or `real_money`. **best\_ask** `number | null` Best ask price. **best\_bid** `number | null` Best bid price. **spread** `number | null` `best_ask - best_bid`. ### price-change Emitted when an event's price or volume state changes. `currency_mode` controls the ordering of `markets` in the payload. | Field | Type | Description | | - | - | - | | `id` | number | Event ID | | `title` | string | Event title | | `status` | string | Event status code | | `currency_mode` | string | `play_money` or `real_money` | | `is_wagerable` | boolean | Whether the event accepts wagers | | `wagers_count_play_money` | number | Play-money wager count | | `wagers_count_real_money` | number | Real-money wager count | | `wagers_count_total` | number | Sum of play and real counts | | `volume_play_money` | number | null | | `volume_real_money` | number | null | | `markets` | array | Visible markets (see below) | Each element of `markets`: | Field | Type | Description | | - | - | - | | `id` | number | Market ID | | `title` | string | Market title | | `status` | string | Market status | | `price` | object | Long mid-price per currency: `{ "OOM": ..., "USDC": ... }` | | `long_label` | string | Long side label (e.g. `"Yes"`) | | `short_label` | string | Short side label (e.g. `"No"`) | | `resolution` | string | `long`, `short`, or null | ### new-market Emitted when a new market is added to an event. | Field | Type | Description | | - | - | - | | `id` | number | Market ID | | `title` | string | Market title | | `title_verbose` | string | Verbose title | | `event` | object | `{ id, title, status, category }` | | `status` | string | Market status | | `suggested_price_play_money` | number | null | | `suggested_price_real_money` | number | null | | `bet_start_date` | string | null | | `bet_end_date` | string | null | ### live-data-update Emitted when an event's live data changes. | Field | Type | Description | | - | - | - | | `id` | number | Event ID | | `status` | string | Event status | | `resolution` | string | null | | `resolve_date` | string | null | | `event_start_date` | string | null | | `event_end_date` | string | null | | `event_extra_data` | object | null | | `is_live` | boolean | Whether the event is currently live | ### market-status-change Emitted on `event` and `event-{event_id}` when tradability fields change (`status`, bet window, or market `disabled`). Use this to start or stop quoting — do not rely on BBO alone. ### market-comment Emitted when a user posts a comment. Sent with a \~5s delay so replicas can catch up before clients refetch. | Field | Type | Description | | - | - | - | | `id` | number | Comment ID | | `content` | string | Comment text | | `created_on` | string | ISO 8601 timestamp | | `user` | object | `{ id, username, picture, win_rate, wagers_count, net_earnings }` | | `question` | object | `{ id, title, slug, status, resolve_date, bet_end_date, is_binary }` | ## Per-event channel (public) Channel name pattern: `event-{event_id}` (e.g. `event-1234`). Subscribe with `pusher.subscribe("event-" + eventId)`; no authentication required. Events on this channel: `order-book-update`, `best-prices-change`, and `market-status-change`. ### order-book-update Absolute top-N (default 5) bid/ask levels for the affected market — one message per market. The legacy refetch ping (`{ endpoint, question, currency }`) and the separate `order-book-delta` event are removed; use this payload only. For depth beyond top-N, call [GET /markets//book/](/api-reference/markets/order-book). | Field | Type | Description | | - | - | - | | `market_id` | number | Market (outcome) ID | | `event_id` | number | Event ID | | `currency` | string | Currency code (e.g. `USDC`) | | `currency_mode` | string | `play_money` or `real_money` | | `top_n` | number | Number of levels (default `5`) | | `ask` | array | Ask levels: `{ price, total_shares, total_amount }` | | `bid` | array | Bid levels: `{ price, total_shares, total_amount }` | | `timestamp` | string | Emission timestamp | ```html theme={null} ``` ## Private user channel Channel name pattern: `private-user-{user_id}`. Requires authorization via `POST https://api.futuur.com/v2.0/pusher/auth/`. Subscribe with `pusher.subscribe("private-user-" + userId)`. ### balance-changed Emitted when the user's balance changes. Carries no amount — refetch [GET /me/balances/](/api-reference/me/balances). | Field | Type | Description | | - | - | - | | `timestamp` | number | Unix epoch seconds when emitted | ### deposit-success Emitted when a deposit completes. | Field | Type | Description | | - | - | - | | `amount` | number | Deposited amount | | `currency` | string | Currency code | ### order-update Real-time order lifecycle updates: create / open acks (`pending`, `open`, including PROCESSING → OPEN) plus fill, partial fill, cancel, and expire. Useful for syncing resting orders without relying only on the REST response. | Field | Type | Description | | - | - | - | | `order_id` | number | Order ID | | `market_id` | number | Market ID | | `event_id` | number | Event ID | | `status` | string | New status (e.g. `pending`, `open`, `filled`, `partial_filled`, `canceled`, `expired`) | | `previous_status` | string | null | | `side` | string | `bid` | | `position` | string | `l` (long) | | `price` | number | null | | `shares_requested` | number | Requested quantity | | `shares_filled` | number | Total filled so far | | `shares_filled_delta` | number | Optional — filled in this update | | `avg_fill_price` | number | null | | `currency` | string | Currency code | | `timestamp` | string | ISO 8601 with milliseconds | | `cancel_reason` | string | Optional — e.g. `user_requested` | | `expired_at` | string | Optional — ISO 8601 | | `is_system_initiated` | boolean | Optional | ```html theme={null} ``` ### position-update Emitted when a user's wager shares change. Use for inventory sync. | Field | Type | Description | | - | - | - | | `market_id` | number | Market (outcome) ID | | `event_id` | number | Event ID | | `position` | string | Position side | | `currency` | string | Currency code | | `shares` | number | Current share quantity | | `purchases_amount` | number | Amount spent on purchases | | `avg_price` | number | Average purchase price | ## Related * [Overview](/api-reference/websocket/overview) — Pusher client setup * [Authorization](/api-reference/websocket/authorization) — private channel HMAC auth * [Order book](/api-reference/markets/order-book) — REST endpoint for full depth beyond top-N * [Reading the order book](/guides/reading-the-order-book) — interpret bid/ask depth # Overview Source: https://docs.futuur.com/api-reference/websocket/overview Subscribe to realtime market, order, and account updates over Pusher WebSockets. Futuur uses [Pusher](https://pusher.com/docs/channels/using_channels/client-api-overview/) to deliver realtime data to clients over WebSocket connections. Use the global `event` channel for market-wide feeds, `event-{event_id}` for per-event BBO and order-book updates, and private channels for account-specific order and position updates. Terminology: **event** = a question; **market** = an outcome. > [!NOTE] > > Examples below use `https://api.futuur.com/v2.0`. Private channel authorization calls `POST https://api.futuur.com/v2.0/pusher/auth/`. See [Authentication](/authentication) for HMAC signing and [Authorization](/api-reference/websocket/authorization) for private channel setup. ## Client setup Include the Pusher JS client: ```html theme={null} ``` Initialize Pusher and subscribe to a channel: ```html theme={null} ``` ## Next steps * [Authorization](/api-reference/websocket/authorization) — authorize private user channels with HMAC * [Channels and events](/api-reference/websocket/channels-and-events) — full channel and event catalog with payloads ## Related * [Order book](/api-reference/markets/order-book) — REST endpoint for full depth beyond top-N * [Reading the order book](/guides/reading-the-order-book) — interpret bid/ask depth * [Authentication](/authentication) — HMAC signing for private channel auth # Authentication Source: https://docs.futuur.com/authentication Authenticate Futuur API requests using HMAC-SHA512 signatures. Every request to the Futuur API must be authenticated. Authentication uses HMAC-SHA512 signatures generated from your public/private key pair. There are no bearer tokens or session cookies — each request is independently signed. ## Get your API keys Get a public/private HMAC pair from **Settings** → **API keys**, or (coming soon) derive the same pair by signing with your wallet. Full steps and the wallet-derive payload are in [Get your API keys](/guides/get-api-keys). * **Public key** — included in every request as the `Key` header. Safe to log. * **Private key** — used to sign requests. Never share or log this value. > [!NOTE] > > On-chain CLOB trading is coming soon. HMAC still authenticates every HTTP request. When settlement moves on-chain, each create will also need an EIP-712 `LimitOrderIntent` signed by your Safe owner key. HMAC never replaces that wallet signature. See [On-chain trading](/concepts/on-chain-trading). ## Required headers Every authenticated request must include these three headers: | Header | Value | | - | - | | `Key` | Your public key | | `Timestamp` | Current Unix timestamp in seconds (UTC epoch, for example `int(time.time())`) | | `HMAC` | SHA-512 hexdigest of the signed parameter string | ## Signing process **1. Collect parameters to sign** Gather all request parameters — query string parameters for GET requests, body parameters for POST requests — plus `Key` (your public key) and `Timestamp` (current Unix timestamp as an integer). **2. Sort by key name (case-sensitive)** Sort all parameters (including `Key` and `Timestamp`) by key using a **case-sensitive code-point** sort — the same order Python's `sorted()` produces. Uppercase letters (`A`–`Z`) come **before** lowercase letters (`a`–`z`), so `Key` and `Timestamp` sort before `category`. Do not use a case-insensitive or locale-aware comparator (for example JavaScript `localeCompare`) — the server rejects those signatures with `401 authentication_failed`. **3. URL-encode the sorted parameters** Join the sorted key-value pairs as a URL-encoded query string, for example: ``` Key=YOUR_PUBLIC_KEY&Timestamp=1234567890&category=5 ``` **4. Sign with your private key** Compute an HMAC-SHA512 digest using your private key as the secret and the URL-encoded string as the message. Use the hex digest (not base64). ``` hmac.new(private_key_bytes, encoded_params_bytes, sha512).hexdigest() ``` **5. Add headers to your request** Include `Key`, `Timestamp`, and `HMAC` as request headers. Do not include the parameters again in the query string separately — they are already encoded in the signature. ## Code examples ```python python theme={null} import hashlib import hmac import time from collections import OrderedDict from urllib.parse import urlencode PRIVATE_KEY = "your_private_key" PUBLIC_KEY = "your_public_key" # Collect all request parameters plus Key and Timestamp params = { "Key": PUBLIC_KEY, "Timestamp": int(time.time()), "category": 5, # any query/body params for this request } # Sort alphabetically and URL-encode params_to_sign = OrderedDict(sorted(params.items())) encoded_params = urlencode(params_to_sign).encode("utf-8") encoded_private_key = PRIVATE_KEY.encode("utf-8") # Compute HMAC-SHA512 hmac_signature = hmac.new(encoded_private_key, encoded_params, hashlib.sha512).hexdigest() # Build headers headers = { "Key": PUBLIC_KEY, "Timestamp": str(params["Timestamp"]), "HMAC": hmac_signature, } # Make the request import requests response = requests.get( "https://api.futuur.com/v2.0/events/", params={"category": 5}, headers=headers, ) ``` ```javascript javascript theme={null} const crypto = require("crypto"); const PRIVATE_KEY = "your_private_key"; const PUBLIC_KEY = "your_public_key"; function signRequest(requestParams = {}) { const timestamp = Math.floor(Date.now() / 1000); // Combine request params with auth params const params = { ...requestParams, Key: PUBLIC_KEY, Timestamp: timestamp }; // Sort alphabetically and URL-encode const sortedKeys = Object.keys(params).sort(); const encoded = sortedKeys .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`) .join("&"); // Compute HMAC-SHA512 const signature = crypto .createHmac("sha512", PRIVATE_KEY) .update(encoded) .digest("hex"); return { Key: PUBLIC_KEY, Timestamp: String(timestamp), HMAC: signature, }; } // Example: GET /events/?category=5 const headers = signRequest({ category: 5 }); fetch("https://api.futuur.com/v2.0/events/?category=5", { headers }) .then((res) => res.json()) .then(console.log); ``` ```bash curl theme={null} # Pre-compute the HMAC signature using Python or another tool, # then pass the headers directly. curl https://api.futuur.com/v2.0/events/?category=5 \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1234567890" \ -H "HMAC: YOUR_COMPUTED_SIGNATURE" ``` ## GET vs. POST requests * **GET requests**: include all query string parameters in the parameter set you sign (in addition to `Key` and `Timestamp`). * **POST requests**: include all body parameters in the parameter set you sign. Do not mix query and body parameters. > [!TIP] > > If your GET request has no additional parameters (e.g., `GET /me/`), you still sign just `Key` and `Timestamp`. ## Common errors | Error | Cause | | - | - | | `InvalidHMACKey` | The public key in the `Key` header is not recognized. Check for typos or use the wrong key. | | `InvalidHMACSignature` | The computed signature does not match. Common causes: wrong sort order (including a case-insensitive sort), missing parameters in the signed set, encoding mismatch, or using the wrong private key. | | `MissingTimestamp` | The `Timestamp` header is absent or malformed. | | `ExpiredTimestamp` | The timestamp is too far from the server's current time. Ensure your system clock is synchronized (NTP). | > [!WARNING] > > Never include your private key in client-side code or commit it to version control. Treat it with the same care as a password. # Conditional tokens Source: https://docs.futuur.com/concepts/conditional-tokens Coming soon: ERC-1155 Yes/No positions for binary events and exclusive multi-outcome events. > [!NOTE] > > On-chain outcome tokens are coming soon. Today's production API still uses HMAC-only ledger settlement, and share balances stay in the database. This page describes the builder model so you can prepare. Nothing here is live on `https://api.futuur.com`. Futuur is adding Polymarket-shaped **conditional tokens**. The CLOB still matches off-chain. Collateral still moves on-chain at match. After the first cutover, each filled position is also an ERC-1155 token you hold in your Safe. Matching and two-layer auth are unchanged. See [On-chain trading](/concepts/on-chain-trading). ## Two rails Every event uses **one** rail. You do not mix them on the same book. | Event shape | Outcome tokens | Complementary both-buy | | - | - | - | | Binary (two markets, or Yes/No) | One binary condition. Yes and No are the two slots. | Bid Yes + bid No on that event | | Exclusive, three or more markets | One binary condition **per market**. Exactly one market may resolve Yes. | Bid Yes + bid No on the **same** market | | Independent multi-outcome | Stays on pool-simulated shares | Not a complete set | Exclusive N≥3 is **not** one n-slot condition. It is a bag of binary conditions. Cross-market Yes vs Yes is not a complete set and does not mint. ## What you hold Each market has a **Yes** token and a **No** token. A complete set (Yes + No of the same condition) is redeemable 1:1 for collateral. On exclusive events you can also **convert** a bag of No tokens into the complementary Yes tokens plus leftover collateral. Example: a 3-way race. 1 No on Red = 1 Yes on Blue + 1 Yes on Green. ## Match shapes | Match | What happens on-chain | | - | - | | Bid vs ask | The seller's Yes (or No) token moves to the buyer. Collateral moves the other way. | | Same-condition both-buy | Collateral splits into Yes + No. Each trader receives their side. | | Same-condition both-sell | Yes + No merge back to collateral. | | Exclusive convert | A No bag burns into complementary Yes (operator-assisted). | Place still does not mint. Tokens move only when a match settles. ## Resolution Winning Yes tokens redeem 1:1 for collateral. Losing tokens redeem to zero. Cancel refunds purchase cost on the pool-simulated rail; the exclusive-token cancel path is not part of this model yet. ## Not in this release * Live API fields for token ids, convert, or on-chain redeem * A dedicated exchange contract that fills two Safes in one `matchOrders` * Official SDKs You still call `https://api.futuur.com`. HMAC authenticates HTTP. The Safe owner signs every on-chain create. See [Place an on-chain order](/guides/on-chain-first-order). # Currencies Source: https://docs.futuur.com/concepts/currencies Supported currencies and how to switch between play money and real money. Futuur supports two trading modes: **play money** for risk-free testing and **real money** for live trading. You select the mode via the `currency_mode` parameter and specify the currency when placing orders. ## Supported currencies > [card] OOM (play money) > > Virtual currency with no real-world value. Use OOM to explore the API, test your integration, and practice trading without any financial risk. > [card] USDC, USDT, USD (real money) > > Real stablecoins and fiat currency for live prediction markets. Subject to country restrictions. ## currency\_mode parameter Many endpoints accept a `currency_mode` query parameter that controls which trading environment you interact with. | Value | Description | | - | - | | `play_money` | Returns data and places orders in the OOM (virtual) environment | | `real_money` | Returns data and places orders in the real money environment | The `currency_mode` parameter affects endpoints that list events, retrieve order books, and place orders. Omitting it typically defaults to `play_money`. ```bash theme={null} # Browse real money events GET /events/?currency_mode=real_money # Browse play money events GET /events/?currency_mode=play_money ``` > [!TIP] > > Start with `currency_mode=play_money` during development. It lets you test the full order lifecycle — placing, filling, and canceling orders — without real funds. ## Specifying currency when placing orders When you create an order via `POST /orders/`, include the `currency` field to specify which currency to use. ```json theme={null} { "market": 42, "side": "bid", "position": "long", "amount": 100, "currency": "OOM", "price": null } ``` Use `USDC` or `USDT` for real money orders: ```json theme={null} { "market": 42, "side": "bid", "position": "long", "amount": 10.00, "currency": "USDC", "price": 0.60 } ``` The `currency` value you supply must match the `currency_mode` of the event you are trading on. Mixing OOM with a real money event (or vice versa) will return an error. > [!NOTE] > > On-chain CLOB trading is coming soon. Today's balances are ledger balances from [`GET /me/balances/`](/api-reference/me/balances). When settlement moves on-chain, OOM and USDC will sit in your Safe and move with ERC-20 `transferFrom` at match. See [On-chain trading](/concepts/on-chain-trading). ## Country restrictions > [!WARNING] > > Real money trading (USDC, USDT, USD) is **not available in all countries**. If your account or IP address is associated with a restricted region, real money order placement will be rejected. > > Use `currency_mode=play_money` if you are in a restricted region or building an application that does not require real money trading. Play money (OOM) is available everywhere with no restrictions. # Events & Markets Source: https://docs.futuur.com/concepts/events-and-markets Understand events, binary markets, and long/short positions in Futuur. An **event** is a prediction question that you can bet on — for example, "Who will win the 2024 US Presidential Election?" or "Will Bitcoin exceed \$100,000 by end of year?" Each event has one or more **markets**, which are the outcomes you can trade. > [!NOTE] > > The API uses the term `markets` for what were previously called "Outcomes" in older versions of the API. Events were previously called "Questions." ## Events An event defines the question, the resolution criteria, and the timeframe. Key fields on an event object include: | Field | Description | | - | - | | `id` | Unique identifier | | `title` | The prediction question | | `slug` | URL-friendly identifier | | `status` | Current state: `open`, `stopped`, `resolved`, `cancelled`, `paused`, or `reversed` | | `category` | Array of category objects the event belongs to | | `markets` | Array of outcome markets | | `bet_end_date` | When betting closes | | `resolve_date` | When the event was resolved | | `markets_correlation` | How markets relate to each other (see below) | | `description` | Full question details and resolution criteria | ### Event statuses > [accordion] open > > The event is active and accepting bets. You can place, modify, and cancel orders. > [accordion] stopped > > Trading has stopped — `bet_end_date` has passed — but the event has not yet resolved. No new orders are accepted. > [accordion] resolved > > The outcome has been determined. Winning wagers are paid out and losing wagers are settled. The event is read-only. > [accordion] cancelled > > The event was cancelled and will not resolve normally. > [accordion] paused > > Trading is temporarily paused on this event. > [accordion] reversed > > A previous resolution was reversed. ### Markets correlation The relationship between markets within an event is defined by **markets correlation**: > [card] Linked prices > > Markets are correlated. The sum of all market prices equals 1, and placing a bet on one market automatically affects the prices of other markets in the same event. This is the default correlation type. > [card] Independent > > Markets operate independently. Each market's price is calculated separately, and betting on one market does not affect others. The correlation type determines how prices are calculated and how bets impact market dynamics within an event. ## Markets A **market** represents a single tradeable outcome within an event. For example, in an election event, each candidate would be a separate market. Key fields on a market object include: | Field | Description | | - | - | | `id` | Unique identifier | | `title` | The outcome name | | `price` | Current probability (0 to 1) | | `status` | Market status | | `volume` | Total trading volume | ## Long vs short positions When placing an order, you specify a **position**: | Position | Description | | - | - | | `long` | You believe this outcome **will** happen. You profit if the market resolves to Yes. | | `short` | You believe this outcome **will not** happen. You profit if the market resolves to No. | For a binary market (Yes/No), going long on "Yes" is equivalent to going short on "No". # On-chain trading Source: https://docs.futuur.com/concepts/on-chain-trading How Futuur's coming-soon CLOB matches orders off-chain and moves collateral on-chain. > [!NOTE] > > On-chain CLOB trading is coming soon. Today's production API still uses HMAC-only ledger settlement. This page describes the builder flow so you can prepare. Futuur is adding Polymarket-shaped on-chain settlement. The book still matches off-chain. Collateral (OOM or USDC) moves on-chain at match. HMAC authenticates HTTP. A wallet signature authorizes every create. ## How a bot trade works ```mermaid theme={null} sequenceDiagram participant Bot as API_bot participant API as Futuur_API participant Chain as Safe_and_USDC Bot->>API: POST_api_keys_derive API-->>Bot: HMAC_public_and_private Bot->>API: POST_enable_trading API->>Chain: approve_pool_max Bot->>API: POST_orders_signing_context API-->>Bot: eip712_payload Bot->>Bot: sign_LimitOrderIntent Bot->>API: POST_orders_plus_intent API->>API: match_CLOB API->>Chain: transferFrom_at_match ``` 1. [Get HMAC keys](/guides/get-api-keys) from Settings or wallet derive. 2. Enable trading once per token (standing `approve` of OOM or USDC to the pool). 3. Ask the API for a signing context, sign `LimitOrderIntent` with the **owner EOA**, then create the order. 4. The CLOB matches. Settlement `transferFrom`s run before share balances update. See [Place an on-chain order](/guides/on-chain-first-order) for the step-by-step request flow. ## Matching The matching engine is a **CLOB**. The best price fills first, whether it comes from another user or the platform AMM. At the same price, a resting user order fills before the AMM. **Complementary both-buy** is a first-class match. If you bid long at 0.55 and someone else bids short at 0.45, the prices sum to 1 and the orders can match without an ask on the book. On a **binary** event, that is Yes vs No of the same event. On an **exclusive** event with three or more markets, it is Yes vs No of the **same** market — not Yes on one market vs Yes on another. See [Conditional tokens](/concepts/conditional-tokens). | Rule | What it means | | - | - | | Best price first | Your order takes the best crossing price on the book, user or AMM | | User before AMM at a tie | At equal prices, a resting user order fills before the AMM | | Complementary both-buy | A bid Yes and a bid No whose prices sum to ≥ 1 cross like a bid and an ask | A filled on-chain order without a collateral `Transfer` is a failure. The API does not credit positions until collateral has moved. ## Settlement at match The first on-chain cutover moves **collateral** (OOM or USDC) and keeps share balances in the Futuur database. A later cutover mints those positions as ERC-1155 outcome tokens. Matching stays the same CLOB either way. | Match type | Collateral (first cutover) | Outcome tokens (later) | | - | - | - | | Bid vs ask | Bidder Safe → asker Safe (via the pool) | Transfer the filled ERC-1155 | | Bid vs bid (both-buy) | Each user Safe → pool | Split a complete set; each trader receives their side | | Ask vs ask (both-sell) | Pool → each user Safe | Merge a complete set back to collateral | ## Two-layer auth | Layer | Mechanism | Who signs | Purpose | | - | - | - | - | | L2 (HTTP) | HMAC-SHA512 headers `Key`, `Timestamp`, `HMAC` | HMAC **private key** | Authenticate the REST call | | L1 (order) | EIP-712 `LimitOrderIntent` (`FutuurLimitOrder` v1) | Safe **owner EOA** | Authorize that create | HMAC never replaces the wallet signature. Get both credentials from [Get your API keys](/guides/get-api-keys). ## What stays the same * Events, markets, and the existing [order](/concepts/orders) and [wager](/concepts/wagers) resources * Play money (`OOM`) and real money (`USDC`) as [currencies](/concepts/currencies) * HMAC signing for every authenticated request — see [Authentication](/authentication) ## Not in this release These are not live on `https://api.futuur.com`: * [Merge a complete set](/guides/merge-complete-set) — recycle overlapping long and short shares to \$1 collateral. Splitting a new set is [documented only](/guides/split-before-quoting) * [Conditional / outcome tokens](/concepts/conditional-tokens) (ERC-1155 Yes/No positions; binaries and exclusive N≥3) * A dedicated exchange contract (settlement uses the pool Safe; operator fills come later) * An official TypeScript or Python SDK * Separate CLOB, Gamma, or Relayer hosts — you still call `https://api.futuur.com` # Orders Source: https://docs.futuur.com/concepts/orders Learn how limit orders and market orders work in Futuur. An **order** is an instruction to buy or sell shares in a market outcome. When you place an order, you specify which market you want to trade, which side (buy or sell), what position to take, and how many shares or how much to spend. Orders are created via [`POST /orders/`](/api-reference/orders/create), listed via [`GET /orders/`](/api-reference/orders/list), and canceled via [`PATCH /orders/{id}/cancel/`](/api-reference/orders/cancel). For higher-throughput flows, you can also [submit](/api-reference/orders/batch-create), [update](/api-reference/orders/batch-update), or [cancel](/api-reference/orders/batch-cancel) up to 20 orders at once, or [cancel everything](/api-reference/orders/cancel-all) on your account in a single call. > [!NOTE] > > On-chain CLOB trading is coming soon. Matching will stay off-chain (user orders first, including complementary both-buy). Collateral will move on-chain at match, and each create will require an EIP-712 wallet signature in addition to HMAC. Outcome tokens are a later cutover — see [Conditional tokens](/concepts/conditional-tokens) and [On-chain trading](/concepts/on-chain-trading). ## Order types > [tab] Market order > > Set `price` to `null` to place a market order. The order executes immediately at the best available price in the order book. > > Use market orders when you want guaranteed execution and don't need to control the exact price. > > ```json theme={null} > { > "market": 42, > "side": "bid", > "position": "long", > "amount": 10.00, > "currency": "OOM", > "price": null > } > ``` > [tab] Limit order > > Set `price` to a specific value (between 0 and 1) to place a limit order. The order sits in the order book and only executes when a counterparty matches your price. > > Use limit orders when you want to trade at a specific probability and are willing to wait. > > ```json theme={null} > { > "market": 42, > "side": "bid", > "position": "long", > "amount": 10.00, > "currency": "OOM", > "price": 0.45 > } > ``` ## Side: bid vs ask The `side` field specifies whether you are buying or selling shares. | Value | Meaning | | - | - | | `bid` | You are **buying** shares | | `ask` | You are **selling** shares you already hold | ## Position: long vs short The `position` field specifies which direction you are betting. | Value | Meaning | | - | - | | `long` | Betting **in favor** of the outcome — you profit if it resolves true | | `short` | Betting **against** the outcome — you profit if it resolves false | > [!NOTE] > > Long and short positions can both be bought (`bid`) or sold (`ask`). For example, selling a long position (`ask` + `long`) reduces your existing long exposure. ## Order lifecycle ```mermaid theme={null} flowchart LR A[open] --> B{matched?} B -->|partially| C[partial_filled] B -->|fully| D[filled] C --> B C --> E[canceled] A --> E ``` | Status | Description | | - | - | | `open` | The order is in the order book, waiting to be matched | | `partial_filled` | Some shares have been matched; the rest remain open | | `filled` | The order has been fully executed | | `canceled` | The order was canceled before fully filling | | `processing` | The order is being processed — transient state | ## Order fields reference > [accordion] shares vs amount > > You can specify how much to trade using either `shares` or `amount` — not both. > > * `shares`: the number of shares you want to buy or sell > * `amount`: the total monetary value to spend or receive, in the specified `currency` > > Use `amount` when you want to spend a fixed budget. Use `shares` when you want to acquire a specific quantity. > [accordion] expired\_at > > Set `expired_at` to an ISO 8601 datetime string to automatically cancel any unfilled portion of the order after that time. > > If omitted, the order remains open until filled, manually canceled, or the event closes. > > ```json theme={null} > { > "expired_at": "2024-11-05T23:59:00Z" > } > ``` > [accordion] cancel\_conflicting\_orders > > Set `cancel_conflicting_orders` to `true` to automatically cancel any of your existing open orders on the same market that would conflict with the new order before placing it. > > This is useful when you want to change your position without manually canceling previous orders first. ## Full order fields | Field | Type | Description | | - | - | - | | `market` | integer | ID of the market (outcome) to trade | | `side` | string | `bid` (buy) or `ask` (sell) | | `position` | string | `long` or `short` | | `price` | float \| null | Limit price 0–1, or `null` for a market order | | `shares` | float | Number of shares (use instead of `amount`) | | `amount` | float | Monetary amount to spend (use instead of `shares`) | | `currency` | string | `OOM`, `USDC`, `USDT`, or `USD` | | `expired_at` | datetime | Auto-cancel time for unfilled order | | `cancel_conflicting_orders` | boolean | Cancel conflicting open orders before placing | > [!WARNING] > > Real money orders (USDC, USDT, USD) are restricted in some countries. See [Currencies](/concepts/currencies) for details. # Wagers Source: https://docs.futuur.com/concepts/wagers Understand wagers and how to track your open positions. A **wager** represents a position you hold in a market. When an order fills (fully or partially), the resulting shares you own become a wager. You can think of a wager as a record of your stake in a particular outcome. Wagers are read-only — they are created automatically when orders execute, not by direct API calls. ## How wagers relate to orders and events ```mermaid theme={null} flowchart LR A[Event] --> B[Market / Outcome] B --> C[Order placed] C -->|filled| D[Wager created] D -->|event resolves| E{Outcome} E -->|correct| F[won] E -->|incorrect| G[lost] ``` * One order can produce one or more wagers as it fills over time. * A wager is always linked to a specific market (outcome) within an event. * Multiple wagers on the same market are aggregated into your net position. ## Wager statuses | Status | Description | | - | - | | `purchased` | Active position — the event is still open or closed but unresolved | | `sold` | You sold this position before the event resolved | | `won` | The event resolved and this outcome was correct — payout received | | `lost` | The event resolved and this outcome was incorrect — stake forfeited | | `cancelled` | The wager was cancelled before resolution | | `disabled` | The wager has been administratively disabled | > [!NOTE] > > A `purchased` wager means your position is active. It will transition to `won`, `lost`, or `sold` once the event resolves or you sell your shares. ## Fetching your wagers Use `GET /wagers/` to list wagers. You can also fetch wagers for a specific event via `GET /events/{id}/wagers/`. ### Filtering wagers The `/wagers/` endpoint supports several filters: | Filter | Description | | - | - | | `active` | Returns only wagers with `purchased` status | | `past_bets` | Returns settled wagers (`won`, `lost`, `sold`) | | `event` | Filter by event ID | | `following` | Wagers on events you follow | | `user` | Filter by user ID (for public wager history) | ```bash theme={null} # Get your active positions GET /wagers/?active=true # Get settled wagers for a specific event GET /wagers/?past_bets=true&event=123 ``` ## Wager resolution When an event resolves, the API automatically settles all wagers associated with it: * Wagers on the **winning** market transition to `won`. Any payout is credited to your account. * Wagers on **losing** markets transition to `lost`. The staked amount is not returned. * If you sold your position before resolution (via an `ask` order), the wager transitions to `sold` regardless of the outcome. > [!TIP] > > Use `GET /events/{id}/wagers/` to retrieve wager history for a specific event across all users, useful for displaying market participation data in your application. # Get your API keys Source: https://docs.futuur.com/guides/get-api-keys Get HMAC credentials from Settings or derive them from your wallet. Learn which private key signs HTTP requests and which signs on-chain orders. API builders use two different secrets. The HMAC pair authenticates every REST request. The wallet owner key authorizes on-chain actions. Do not treat them as interchangeable. | Credential | What it is | Used for | How you get it | | - | - | - | - | | HMAC public + private key | HTTP API pair | Every authenticated REST call (`Key`, `Timestamp`, `HMAC`) | [Settings](#from-the-website) or [wallet derive](#from-your-wallet) | | Owner wallet private key | Safe owner EOA | EIP-712 `DeriveApiKey` and `LimitOrderIntent` | Your wallet (MetaMask or an exported embedded wallet). Futuur never returns this. | > [!NOTE] > > HMAC keys work on today's production API. Wallet-signed derive and per-order EIP-712 signing are part of [on-chain CLOB trading](/concepts/on-chain-trading), which is coming soon. You can prepare your bot now; production still settles on the ledger. > [tab] From the website > > ## From the website > > Use this path if you trade from a script today. The private HMAC key is shown **once**. > > **1. Open API keys** > > Log in at [futuur.com](https://futuur.com). Open **Settings** → **API keys**. > > **2. Create a key** > > Click **Create API key** or **Generate keys**. If you already have a pair, creating a new one **replaces** it — requests signed with the old keys stop working immediately. > > **3. Choose what the key can trade** > > Play money (OOM) is always included. Turn on **Real money trading** if you also need USDC, USDT, or USD. Real money requires identity verification. > > **4. Copy both keys immediately** > > The modal shows **Public** and **Private**. Copy the private key now. You cannot view it again. If you lose it, generate another pair. > > > [!WARNING] > > > > For security reasons, you can only see your private HMAC key once. Do not share it. Do not commit it to version control. If you lose it, generate a new public/private key pair. > > Then sign requests with HMAC-SHA512. See [Authentication](/authentication). > [tab] From your wallet > > ## From your wallet > > > [!NOTE] > > > > Coming soon. `POST /v2.0/api-keys/derive/` is not live on `https://api.futuur.com` yet. This is the Polymarket-shaped bot path: prove you control the owner wallet, then receive HMAC credentials. > > Derive does **not** replace the owner wallet key. You still need that key to sign [on-chain orders](/guides/on-chain-first-order). > > **1. Link a wallet to a Futuur account** > > Log in once (email or wallet) so `wallet_address` is stored on your account. Derive rejects signers that have no Futuur user. > > **2. Sign EIP-712 DeriveApiKey** > > Sign with the **owner EOA** — the same key that owns your Safe — not the Safe contract address. > > **3. POST the signature** > > Send `address`, `timestamp`, `nonce`, `signature`, and optional `chain_id` to `POST /v2.0/api-keys/derive/`. The request is unauthenticated; the signature is the auth. > > **4. Store the HMAC pair** > > The response returns the existing active HMAC pair, or creates one. Derive does **not** rotate keys. Replay of the same `timestamp` + `nonce` is rejected. > > ### EIP-712 typed data > > Domain: `FutuurApiAuth` v1. `verifyingContract` is the zero address. Timestamp must be within ±120 seconds of the server clock. > > ```json theme={null} > { > "domain": { > "name": "FutuurApiAuth", > "version": "1", > "chainId": 8453, > "verifyingContract": "0x0000000000000000000000000000000000000000" > }, > "types": { > "DeriveApiKey": [ > { "name": "address", "type": "address" }, > { "name": "timestamp", "type": "string" }, > { "name": "nonce", "type": "uint256" }, > { "name": "message", "type": "string" } > ] > }, > "primaryType": "DeriveApiKey", > "message": { > "address": "0xYourOwnerAddress", > "timestamp": "1712500000", > "nonce": 0, > "message": "Derive Futuur API credentials" > } > } > ``` > > ### Request and response > > ```http theme={null} > POST /v2.0/api-keys/derive/ > ``` > > | Field | Notes | > | - | - | > | `address` | Owner EOA (checksum or lowercase) | > | `timestamp` | Unix seconds, valid ±120s | > | `nonce` | Integer; change it if you retry in the same second | > | `signature` | Hex EIP-712 signature | > | `chain_id` | Optional; defaults to the active chain | > > ```json theme={null} > { > "id": 12, > "public_key": "your_public_key", > "private_key": "your_private_key", > "user_id": 42 > } > ``` > > ### Code examples > > ```python python theme={null} > import time > import requests > from eth_account import Account > from eth_account.messages import encode_typed_data > > OWNER_KEY = "0xYOUR_OWNER_PRIVATE_KEY" > CHAIN_ID = 8453 > > account = Account.from_key(OWNER_KEY) > timestamp = int(time.time()) > nonce = 0 > > typed = { > "domain": { > "name": "FutuurApiAuth", > "version": "1", > "chainId": CHAIN_ID, > "verifyingContract": "0x0000000000000000000000000000000000000000", > }, > "types": { > "EIP712Domain": [ > {"name": "name", "type": "string"}, > {"name": "version", "type": "string"}, > {"name": "chainId", "type": "uint256"}, > {"name": "verifyingContract", "type": "address"}, > ], > "DeriveApiKey": [ > {"name": "address", "type": "address"}, > {"name": "timestamp", "type": "string"}, > {"name": "nonce", "type": "uint256"}, > {"name": "message", "type": "string"}, > ], > }, > "primaryType": "DeriveApiKey", > "message": { > "address": account.address, > "timestamp": str(timestamp), > "nonce": nonce, > "message": "Derive Futuur API credentials", > }, > } > > signable = encode_typed_data(full_message=typed) > signature = account.sign_message(signable).signature.hex() > if not signature.startswith("0x"): > signature = f"0x{signature}" > > response = requests.post( > "https://api.futuur.com/v2.0/api-keys/derive/", > json={ > "address": account.address, > "timestamp": timestamp, > "nonce": nonce, > "signature": signature, > "chain_id": CHAIN_ID, > }, > ) > print(response.json()) > ``` > > ```javascript javascript theme={null} > import { privateKeyToAccount } from "viem/accounts"; > > const OWNER_KEY = "0xYOUR_OWNER_PRIVATE_KEY"; > const CHAIN_ID = 8453; > > const account = privateKeyToAccount(OWNER_KEY); > const timestamp = Math.floor(Date.now() / 1000); > const nonce = 0; > > const signature = await account.signTypedData({ > domain: { > name: "FutuurApiAuth", > version: "1", > chainId: CHAIN_ID, > verifyingContract: "0x0000000000000000000000000000000000000000", > }, > types: { > DeriveApiKey: [ > { name: "address", type: "address" }, > { name: "timestamp", type: "string" }, > { name: "nonce", type: "uint256" }, > { name: "message", type: "string" }, > ], > }, > primaryType: "DeriveApiKey", > message: { > address: account.address, > timestamp: String(timestamp), > nonce: BigInt(nonce), > message: "Derive Futuur API credentials", > }, > }); > > const response = await fetch("https://api.futuur.com/v2.0/api-keys/derive/", { > method: "POST", > headers: { "Content-Type": "application/json" }, > body: JSON.stringify({ > address: account.address, > timestamp, > nonce, > signature, > chain_id: CHAIN_ID, > }), > }); > > console.log(await response.json()); > ``` > > ```bash curl theme={null} > # Sign DeriveApiKey with your owner key first, then: > > curl -X POST "https://api.futuur.com/v2.0/api-keys/derive/" \ > -H "Content-Type: application/json" \ > -d '{ > "address": "0xYourOwnerAddress", > "timestamp": 1712500000, > "nonce": 0, > "signature": "0x...", > "chain_id": 8453 > }' > ``` ## Two-layer auth (coming soon) On-chain trading uses the same shape as Polymarket CLOB bots, with Futuur-specific details: | Layer | How it works | Purpose | | - | - | - | | L1 (wallet) | The owner EOA signs EIP-712 (`DeriveApiKey`, then `LimitOrderIntent`) | Prove wallet control and authorize each order | | L2 (HTTP) | Each request is signed with HMAC-SHA512 | Authenticate as a Futuur API user | HMAC **never** replaces the wallet signature. When on-chain settlement is on, unsigned creates return `order_intent_signature is required`. If you already know Polymarket's CLOB client, do not copy their headers or hash: * Futuur HMAC is **SHA-512**, not SHA-256 * Headers are `Key`, `Timestamp`, and `HMAC` — not `POLY_*` * There is no passphrase * Parameter sort is **case-sensitive** (Python `sorted()`) See [Authentication](/authentication) for the live HMAC signing process, and [Place an on-chain order](/guides/on-chain-first-order) for the coming-soon create flow. > [!WARNING] > > Never log or commit the HMAC private key or the owner wallet key. Store them in environment variables or a secret manager. # Claude (MCP) Source: https://docs.futuur.com/guides/mcp Use Futuur prediction markets directly inside Claude via the Futuur MCP server. The [Model Context Protocol](https://modelcontextprotocol.io) (MCP) lets Claude call external tools on your behalf. The Futuur MCP server exposes tools covering market discovery, order placement, position management, and account info — all accessible through natural language. **Get connected in under a minute:** paste your API keys, copy the `claude mcp add` command, run it in your terminal, then start a new Claude session. **You can say things like:** * *"Show me the top 10 markets by volume"* * *"Simulate buying 200 OOM on the Yes outcome of event #1234"* * *"What are my open positions and how are they performing?"* * *"Sell 50 shares of my wager on the US election market"* *** ## Prerequisites **1. Node.js 18 or higher** Download from [nodejs.org](https://nodejs.org). Verify with `node --version`. **2. Claude Code CLI** Install the [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code). Verify with `claude --version`. **3. Futuur API keys** Log in to [futuur.com](https://futuur.com) → **Settings** → **API keys** → generate a key pair. You'll get a **public key** and a **private key**. See [Get your API keys](/guides/get-api-keys). *** ## Setup Paste your Futuur API keys below, then copy and run the generated command in your terminal. Claude Connect Futuur to Claude with claude mcp add Public key Private key
Run in your terminal. Requires the [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) . Your keys never leave this page except in the command you copy. **1. Paste your API keys** Use the fields above. Keys stay in your browser — they are only embedded in the command you copy. **2. Copy and run** Paste the `claude mcp add` command into your terminal and press Enter. Claude registers the Futuur MCP server with your keys. **3. Start Claude** Open a new Claude Code session (`claude`) — the Futuur tools are available immediately. > [!TIP] > > To add the server for a single project only, run the command from that project directory. To add it globally, run it from any directory — Claude stores it in your user config. > [accordion] Manual JSON config (optional) > > If you prefer to edit config files yourself, add this under `"mcpServers"` in `~/.claude.json` (global) or `.claude/settings.json` (project): > > ```json theme={null} > { > "futuur": { > "command": "npx", > "args": ["-y", "@futuur/futuur-mcp"], > "env": { > "FUTUUR_PUBLIC_KEY": "your_public_key_here", > "FUTUUR_PRIVATE_KEY": "your_private_key_here" > } > } > } > ``` *** ## Available tools > [card] Market discovery > > `get_markets` · `get_market_details` · `get_price_history` · `get_categories` > [card] Account > > `get_user_profile` · `get_user_ranking` > [card] Trading > > `get_bet_simulation` · `place_bet` · `list_orders` · `cancel_order` > [card] Positions > > `get_user_bets` · `get_wager_details` · `get_partial_sell_amount` · `sell_bet` | Tool | What it does | | - | - | | `get_markets` | List and search events with filters — category, tag, status, ordering | | `get_market_details` | Full details for one event including all outcome markets | | `get_price_history` | Historical prices for an event (`day` / `week` / `month` / `year` / `all_time`) | | `get_categories` | List available market categories | | `get_user_profile` | Your account profile and wallet balances (see also [`GET /me/balances/`](/api-reference/me/balances)) | | `get_user_ranking` | Your leaderboard position | | `get_bet_simulation` | Preview a buy order — cost and shares — without placing it | | `place_bet` | Execute a limit order from a confirmed simulation | | `list_orders` | List your open, filled, or cancelled orders | | `cancel_order` | Cancel an open order by ID | | `get_user_bets` | List your wager positions with filters | | `get_wager_details` | Full details for one wager | | `get_partial_sell_amount` | Simulate how much you'd receive for selling N shares | | `sell_bet` | Sell all or part of a wager position | *** ## Example session ``` You: Show me the top 5 prediction markets right now Claude: [calls get_markets with ordering=-volume, limit=5] Here are the top markets by volume: ... You: I want to bet 100 OOM that Trump wins. Show me the details first. Claude: [calls get_market_details for the event] The "Trump wins 2026" market is currently priced at 62% (0.62). Market ID: 8821, Event ID: 4401. You: Simulate buying 100 OOM on the Yes outcome Claude: [calls get_bet_simulation with event_id=4401, market=8821, amount=100, currency=OOM] You'd receive approximately 161 shares at 0.62 each. Total cost: 100 OOM. Shall I place the order? You: Yes, go ahead Claude: [calls place_bet with confirmed payload] Order placed. ID: 99231, status: filled. ``` > [!TIP] > > Use `currency_mode: "play_money"` to practice with OOM (play money) before trading real funds. *** ## Links > [card] [GitHub repository](https://github.com/futuur/Futuur-MCP) > > Source code, issues, and contributions > [card] [Authentication](/authentication) > > How HMAC-SHA512 signing works > [card] [Placing a bet](/guides/placing-a-bet) > > Full step-by-step guide to placing orders via the REST API > [card] [API Reference](/api-reference/events/list) > > Browse all available endpoints # Merge a complete set Source: https://docs.futuur.com/guides/merge-complete-set Coming soon: quote and merge overlapping long and short shares on one market back to collateral. > [!NOTE] > > Complete-set merge is not live on `https://api.futuur.com` yet. The same handler will exist on `/v1.5/` and `/v2.0/`. Examples below use `https://api.futuur.com/v2.0`. Sign the request the same way as any other private call. See [Authentication](/authentication). When you already hold both long and short on one market, in one currency, merge the overlap back to collateral at **\$1 per set**. A resolved market is redeemed, not merged. This call does not place an order and does not move the quote. Play money (`OOM`) and real money (`USDC`) are separate merges. Splitting collateral into a new YES+NO set is a later step, documented in [Split before quoting](/guides/split-before-quoting). This page is only the merge. ## Who can call it The phase-one endpoint accepts the house market maker and allowlisted accounts. Session auth (the site), OAuth, wallet JWT, and HMAC all use the same handler. An HMAC caller merging `USDC` also needs real-money API access on that key. Anyone else receives `not_enabled`. The house market maker also merges on its own after a fill that increases its smaller side. You do not call this endpoint for that. You call it for your own inventory. ## What you can merge Quote first. The overlap is the shares that are free on both sides: * Open long shares, minus shares reserved by your own asks * Open short shares, minus shares reserved by your own asks * `k = min(long, short)` Resting bids stay up. A pair is a complete set only on a binary, including a linked event with two markets. An exclusive event with three or more markets is not a long/short complete set, and neither is a NegRisk event. Those return `not_a_complete_set`. ## Quote the overlap ``` GET https://api.futuur.com/v2.0/inventory-merges/?outcome={outcome}¤cy={currency} ``` **outcome** `integer` *required* Market id. Long and short are the two sides of this market. **currency** `string` *required* `OOM` or `USDC`. **outcome** `integer` *required* Market id you quoted. **currency** `string` *required* Currency you quoted. **long\_shares** `number` *required* Open long shares not reserved by your own asks. **short\_shares** `number` *required* Open short shares not reserved by your own asks. **mergeable** `number` *required* `k`, the overlap: `min(long_shares, short_shares)`. **residual\_side** `string` *required* `long`, `short`, or `flat` after a max merge. The larger side is what remains. **collateral** `number` *required* Collateral a max merge would return. One currency unit per merged set. ## Perform the merge ``` POST https://api.futuur.com/v2.0/inventory-merges/ ``` Send the body as form fields, the same way you create an order. **outcome** `integer` *required* Market id. **currency** `string` *required* `OOM` or `USDC`. **amount** `string` `max`, or an explicit size up to `k`. Omitted means `max`. A larger size returns `over_merge`. **idempotency\_key** `string` Retrying a confirmed key returns the original merge and does not pay twice. A key that is still in progress returns `merge_in_progress`. **id** `integer` *required* Merge record id. **outcome** `integer` *required* Market id. **currency** `string` *required* Currency merged. **amount** `number` *required* Shares closed on each side. **long\_shares** `number` *required* Long shares still open after the merge. **short\_shares** `number` *required* Short shares still open after the merge. **mergeable** `number` *required* Overlap still left. `0` when this call merged the whole pair. **residual\_side** `string` *required* Side still open after this merge, or `flat`. **collateral** `number` *required* Collateral credited, equal to `amount`. **cost\_basis** `number` *required* Cost of the shares closed. Profit is `collateral` minus this number, and it can be negative. **realized\_profit** `number` *required* `collateral` minus `cost_basis`. **rail** `string` *required* `ledger` credits the ledger. `onchain` pays from the Pool Safe to your Safe and fails closed if the Pool cannot pay. `tokenized` burns the YES+NO pair and returns the ERC-20. The request body is the same on every rail. **idempotency\_key** `string` The key stored for this merge, when you sent one. ### Example Quote a market, then merge the whole overlap: ```bash theme={null} curl "https://api.futuur.com/v2.0/inventory-merges/?outcome=123¤cy=USDC" \ -H "Key: $FUTUUR_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "HMAC: $HMAC" curl -X POST "https://api.futuur.com/v2.0/inventory-merges/" \ -H "Key: $FUTUUR_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "HMAC: $HMAC" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "outcome=123¤cy=USDC&amount=max&idempotency_key=merge-123-usdc-1" ``` A successful merge looks like this: ```json theme={null} { "id": 1, "outcome": 123, "currency": "USDC", "amount": 2, "long_shares": 0, "short_shares": 4, "mergeable": 0, "residual_side": "short", "collateral": 2, "cost_basis": 2.8325, "realized_profit": -0.8325, "rail": "onchain", "idempotency_key": "merge-123-usdc-1" } ``` That account held 2 long and 6 short. The merge closed 2 of each, paid \$2, and left 4 short. The quote on the book did not change. ## Errors | Code | HTTP | When | | - | - | - | | `not_enabled` | 403 | The flag is off, or the account is not the house market maker and not allowlisted. | | `real_money_not_allowed` | 403 | An HMAC caller merges `USDC` without real-money API access. | | `invalid_amount` | 400 | `outcome` or `currency` is missing, or `amount` is not `max` or a positive size. | | `not_found` | 404 | That market id does not exist. | | `no_pair` | 400 | You do not hold both sides, or asks already reserve the overlap. | | `over_merge` | 400 | `amount` is larger than `k`. | | `resolved_market` | 400 | The event is resolved. Redeem the winner. Do not merge. | | `cancelled_market` | 400 | The event is cancelled. It is refunded, not merged. | | `not_a_complete_set` | 400 | Exclusive or linked events with three or more markets, or a NegRisk event. | | `merge_in_progress` | 400 | This idempotency key is already running. | | `collateral_failed` | 400 | On-chain or tokenized payment failed. Shares stay where they were. | Error bodies are `{ "code", "detail" }`. # Place an on-chain order Source: https://docs.futuur.com/guides/on-chain-first-order Coming soon: enable trading, fetch a signing context, sign LimitOrderIntent, and POST a limit order. > [!NOTE] > > On-chain CLOB trading is coming soon. Today's production API still uses HMAC-only ledger settlement. This page describes the builder flow so you can prepare. The endpoints below are **not live** on `https://api.futuur.com` yet. Every on-chain create is pre-signed. HMAC authenticates the HTTP request. The Safe **owner EOA** signs EIP-712 `LimitOrderIntent`. HMAC keys alone cannot create OOM or USDC orders once on-chain settlement is on. If you do not have credentials yet, start with [Get your API keys](/guides/get-api-keys). For the matching and settlement model, see [On-chain trading](/concepts/on-chain-trading). Outcome tokens (Yes/No ERC-1155) are a later cutover — see [Conditional tokens](/concepts/conditional-tokens). ## Prerequisites 1. A Futuur account with `wallet_address` linked and a registered Safe (`POST /me/safe/`). 2. HMAC public and private keys for L2 request signing. 3. The owner EOA private key — the same key that owns the Safe. 4. The Safe funded with OOM and/or USDC on the active chain. 5. Trading enabled once per collateral token. ## Step 1 — Enable trading Grant the pool a standing allowance so bids do not need a per-order approve. ``` token.approve(poolAddress, type(uint256).max) ``` ```http theme={null} GET /v2.0/me/safe/trading-status/?currency=OOM POST /v2.0/me/safe/enable-trading/ ``` | Endpoint | Role | | - | - | | `GET /me/safe/trading-status/` | Returns whether that currency already has a standing approve | | `POST /me/safe/enable-trading/` | Submits the signed approve UserOperation | After this succeeds, signing-context returns `needsApproval: false` and creates are intent-only. > [!TIP] > > Do this once per token (OOM and USDC). You do not repeat it on every order. ## Step 2 — Signing context Call this **once at submit time**, not on every UI keystroke. ```http theme={null} POST /v2.0/orders/signing-context/ ``` HMAC-authenticated. Body: ```json theme={null} { "market": 3801, "price": 0.42, "shares": 3, "currency": "USDC", "position": "long", "side": "bid", "chain_id": 8453 } ``` | Response field | Meaning | | - | - | | `eip712` | Typed data to sign (`domain`, `types`, `message`, `primaryType`) | | `ownerAddress` | EOA that must sign — must match the recovered signer | | `safeAddress` | Your Safe (collateral holder) | | `poolAddress` | Approve spender and clearing wallet | | `maxUsdcRaw` | Bid cap: notional + taker fee, in raw token units | | `expiry` | Pass back as `order_intent_expiry` | | `nonce` | Per-Safe replay counter | | `needsApproval` | If `true`, enable trading first | ## Step 3 — Sign LimitOrderIntent Sign `eip712` with the **owner EOA**, not the Safe contract address. Domain: `FutuurLimitOrder` v1, `verifyingContract` is the zero address. ```json theme={null} { "domain": { "name": "FutuurLimitOrder", "version": "1", "chainId": 8453, "verifyingContract": "0x0000000000000000000000000000000000000000" }, "types": { "LimitOrderIntent": [ { "name": "orderId", "type": "uint256" }, { "name": "chainId", "type": "uint256" }, { "name": "safeAddress", "type": "address" }, { "name": "marketId", "type": "uint256" }, { "name": "side", "type": "string" }, { "name": "position", "type": "string" }, { "name": "priceRaw", "type": "uint256" }, { "name": "sharesRaw", "type": "uint256" }, { "name": "maxUsdcRaw", "type": "uint256" }, { "name": "nonce", "type": "uint256" }, { "name": "expiry", "type": "uint256" } ] }, "primaryType": "LimitOrderIntent", "message": { "orderId": 0, "chainId": 8453, "safeAddress": "0xYourSafe", "marketId": 3801, "side": "bid", "position": "long", "priceRaw": 42, "sharesRaw": 300, "maxUsdcRaw": "1296540", "nonce": 1, "expiry": 1712503600 } } ``` Use the `eip712` object from signing-context as-is. `maxUsdcRaw` must match exactly. ```python python theme={null} from eth_account import Account from eth_account.messages import encode_typed_data OWNER_KEY = "0xYOUR_OWNER_PRIVATE_KEY" eip712 = signing_context["eip712"] # from POST /orders/signing-context/ structured = { "types": { "EIP712Domain": [ {"name": "name", "type": "string"}, {"name": "version", "type": "string"}, {"name": "chainId", "type": "uint256"}, {"name": "verifyingContract", "type": "address"}, ], **eip712["types"], }, "primaryType": eip712["primaryType"], "domain": eip712["domain"], "message": eip712["message"], } signable = encode_typed_data(full_message=structured) signature = Account.from_key(OWNER_KEY).sign_message(signable).signature.hex() if not signature.startswith("0x"): signature = f"0x{signature}" ``` ```javascript javascript theme={null} import { privateKeyToAccount } from "viem/accounts"; const account = privateKeyToAccount("0xYOUR_OWNER_PRIVATE_KEY"); const eip712 = signingContext.eip712; // from POST /orders/signing-context/ const signature = await account.signTypedData({ domain: eip712.domain, types: eip712.types, primaryType: eip712.primaryType, message: eip712.message, }); ``` ## Step 4 — Create the order ```http theme={null} POST /v2.0/orders/ ``` Send the usual order fields plus: | Field | Required | Notes | | - | - | - | | `chain_id` | Yes | Must match signing-context | | `order_intent_signature` | Yes | Hex signature from step 3 | | `order_intent_expiry` | Yes | `expiry` from signing-context | ```json theme={null} { "market": 3801, "side": "bid", "position": "long", "price": 0.42, "shares": 3, "currency": "USDC", "chain_id": 8453, "order_intent_signature": "0x...", "order_intent_expiry": 1712503600 } ``` Sign the HTTP request with HMAC as usual. See [Authentication](/authentication). Bids match only after `settlement_status` is `ready` (standing allowance confirmed). Asks become `ready` as soon as the intent verifies. ## Selling Do **not** sell on-chain OOM or USDC with `PATCH /wagers/{id}/`. That path only moves the internal ledger. Use a signed `side=ask` create instead. When on-chain settlement is on, `PATCH /wagers/` returns `onchain_sell_requires_limit_order`. ## Common errors | Symptom | Cause | | - | - | | `order_intent_signature is required` | On-chain settlement is on and the create was unsigned | | `trading_not_enabled` / `needsApproval: true` | Enable trading first | | Intent recover mismatch | You signed with a key that is not `wallet_address` / the Safe owner | | `onchain_sell_requires_limit_order` | Used `PATCH /wagers/` instead of a signed ask | | `Not enough shares to complete the Ask limit order.` | The ask is larger than your position. Shares settle on-chain in 0.01 steps, so 0.68 against a 0.67 position fails | | Insufficient balance | The Safe lacks OOM or USDC on-chain | | `401 authentication_failed` | Bad HMAC sort, clock skew, or revoked key | > [!WARNING] > > Never store the owner wallet key in git or client-side code. HMAC keys cannot create on-chain orders by themselves. # Placing a bet Source: https://docs.futuur.com/guides/placing-a-bet Step-by-step guide to placing your first order on a Futuur prediction market. This guide walks you through finding an event, checking the current price, and placing an order — from a quick market order to a precise limit order. > [!NOTE] > > All examples use `https://api.futuur.com/v2.0`. Authenticated requests require HMAC headers. See [Get your API keys](/guides/get-api-keys) and the [Authentication](/authentication) guide for how to generate them. > [!NOTE] > > On-chain CLOB trading is coming soon. This guide is the live ledger flow. When settlement moves on-chain, creates will also need an EIP-712 `LimitOrderIntent` — see [Place an on-chain order](/guides/on-chain-first-order). **1. Find an event** Use `GET /v2.0/events/` to browse available prediction markets. You can search by keyword or filter by category. This endpoint does not require authentication. ```python python theme={null} import requests response = requests.get( "https://api.futuur.com/v2.0/events/", params={ "search": "US election", "currency_mode": "play_money", "limit": 5, }, ) events = response.json()["results"] for event in events: print(event["id"], event["title"]) ``` ```bash curl theme={null} curl -G "https://api.futuur.com/v2.0/events/" \ --data-urlencode "search=US election" \ --data-urlencode "currency_mode=play_money" \ --data-urlencode "limit=5" ``` The response includes a `results` array of events. Each event has an `id` and a `markets` array containing individual outcomes you can bet on. > [!TIP] > > Set `currency_mode=play_money` while testing. Switch to `real_money` when you're ready to trade with USDC, USDT, or USD. **2. Inspect the event's markets** Each event has one or more markets, each representing a possible outcome. Retrieve a single event to see its markets in detail. ```python python theme={null} response = requests.get( "https://api.futuur.com/v2.0/events/12345/", headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", }, ) event = response.json() print(f"Event: {event['title']}") for market in event["markets"]: print(f" Market {market['id']}: {market['title']} @ {market['price']}") ``` ```bash curl theme={null} curl "https://api.futuur.com/v2.0/events/12345/" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" ``` Note the `id` of the market you want to bet on and its current `price` (implied probability between 0 and 1). **3. Place a market order** To buy shares immediately at the best available price, set `price` to `null`. This is a market order. ```python python theme={null} response = requests.post( "https://api.futuur.com/v2.0/orders/", headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", "Content-Type": "application/json", }, json={ "market": 67890, "side": "bid", "position": "long", "amount": 100, "currency": "OOM", "price": None, }, ) print(response.json()) ``` ```bash curl theme={null} curl -X POST "https://api.futuur.com/v2.0/orders/" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "market": 67890, "side": "bid", "position": "long", "amount": 100, "currency": "OOM", "price": null }' ``` **4. Place a limit order** To specify the exact price you're willing to pay, include a `price` value between 0 and 1. The order will only fill when the market reaches your price. ```python python theme={null} response = requests.post( "https://api.futuur.com/v2.0/orders/", headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", "Content-Type": "application/json", }, json={ "market": 67890, "side": "bid", "position": "long", "amount": 100, "currency": "OOM", "price": 0.45, }, ) print(response.json()) ``` ```bash curl theme={null} curl -X POST "https://api.futuur.com/v2.0/orders/" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "market": 67890, "side": "bid", "position": "long", "amount": 100, "currency": "OOM", "price": 0.45 }' ``` If the current market price is above 0.45, your order will sit in the order book until someone is willing to sell at that price. ## Next steps * [Reading the order book](/guides/reading-the-order-book) — understand market depth before placing orders * [Selling a position](/guides/selling-a-position) — exit or reduce your wager * [Orders reference](/api-reference/orders/create) — full endpoint documentation # Reading the order book Source: https://docs.futuur.com/guides/reading-the-order-book How to read and interpret the order book for a prediction market. The order book shows all open buy (bid) and sell (ask) orders for a market outcome, aggregated by price level. Use it to understand where the market is trading and to pick a good price for a limit order. > [!NOTE] > > All examples use `https://api.futuur.com/v2.0`. The order book endpoint does not require authentication. ## What the order book shows The order book aggregates open orders at each price level into two sides: * **Bids** (`bid` in the response) — buyers willing to pay up to a certain price (buy orders) * **Asks** (`ask` in the response) — sellers willing to accept at least a certain price (sell orders) Each level shows the quantity available and the cumulative depth of the book up to that price. This tells you how much liquidity exists and at what prices. ## Fetching the order book Call `GET /markets/{id}/book/` with the required `currency_mode` parameter and the market ID in the path. ```python python theme={null} import requests response = requests.get( "https://api.futuur.com/v2.0/markets/67890/book/", params={ "currency_mode": "play_money", "position": "long", }, ) order_book = response.json() print(order_book) ``` ```bash curl theme={null} curl -G "https://api.futuur.com/v2.0/markets/67890/book/" \ --data-urlencode "currency_mode=play_money" \ --data-urlencode "position=long" ``` ### Required parameters | Parameter | Type | Description | | - | - | - | | `id` (path) | integer | The market ID to query | | `currency_mode` | string | `play_money` or `real_money` | ### Optional parameters | Parameter | Type | Default | Description | | - | - | - | - | | `position` | string | `long` | `long` for long order book, `short` for short order book | ## Example response ```json theme={null} { "bid": [ { "price": 0.62, "total_shares": 500.0, "total_amount": 310.0, "total_fees": 0.50, "cumulative_shares": 500.0, "cumulative_amount": 310.0, "cumulative_fees": 0.50 }, { "price": 0.60, "total_shares": 1200.0, "total_amount": 720.0, "total_fees": 1.20, "cumulative_shares": 1700.0, "cumulative_amount": 1030.0, "cumulative_fees": 1.70 }, { "price": 0.58, "total_shares": 800.0, "total_amount": 464.0, "total_fees": 0.80, "cumulative_shares": 2500.0, "cumulative_amount": 1494.0, "cumulative_fees": 2.50 } ], "ask": [ { "price": 0.65, "total_shares": 300.0, "total_amount": 195.0, "total_fees": 0.30, "cumulative_shares": 300.0, "cumulative_amount": 195.0, "cumulative_fees": 0.30 }, { "price": 0.67, "total_shares": 750.0, "total_amount": 502.5, "total_fees": 0.75, "cumulative_shares": 1050.0, "cumulative_amount": 697.5, "cumulative_fees": 1.05 } ] } ``` ## Order book fields Each level in the `bid` and `ask` arrays contains the following fields: | Field | Type | Description | | - | - | - | | `price` | float | The price level (0 to 1, representing probability) | | `total_shares` | float | Total shares available at exactly this price level | | `total_amount` | float | Total currency amount at exactly this price level | | `total_fees` | float | Total fees attributable to the shares at this price level | | `cumulative_shares` | float | Total shares available at this price level and better | | `cumulative_amount` | float | Total currency amount at this price level and better | | `cumulative_fees` | float | Cumulative fees from the top of the book through this level | For **bids**, levels are sorted from highest price to lowest (best bid first). For **asks**, levels are sorted from lowest price to highest (best ask first). ## Interpreting the best bid and ask The **best bid** is the first entry in the `bid` array — the highest price a buyer is currently willing to pay. The **best ask** is the first entry in `ask` — the lowest price a seller will accept. ```python python theme={null} best_bid = order_book["bid"][0]["price"] if order_book["bid"] else None best_ask = order_book["ask"][0]["price"] if order_book["ask"] else None if best_bid and best_ask: spread = round(best_ask - best_bid, 4) mid_price = round((best_bid + best_ask) / 2, 4) print(f"Best bid: {best_bid}, Best ask: {best_ask}") print(f"Spread: {spread}, Mid price: {mid_price}") ``` For the example response above: * Best bid: `0.62` * Best ask: `0.65` * Spread: `0.03` (3 cents per share) * Mid price: `0.635` A narrow spread indicates high liquidity. A wide spread means fewer active traders and more price uncertainty. > [!TIP] > > The mid-price is a useful reference point. Placing a limit order just inside the spread — for example, a bid at `0.63` — can get you a better fill price than a market order at the best ask of `0.65`. ## Using the order book to pick a limit price The `cumulative_shares` field tells you how much total liquidity is available up to a given price. Use this to estimate how many shares you can buy or sell at a target price. ```python python theme={null} target_shares = 1000.0 for level in order_book["ask"]: if level["cumulative_shares"] >= target_shares: print(f"You can buy {target_shares} shares up to price {level['price']}") break else: print("Not enough liquidity in the book to fill this order at any listed level.") ``` For the example response: * Buying 300 shares: best ask at `0.65` covers it (`cumulative_shares = 300`) * Buying 1000 shares: requires depth up to `0.67` (`cumulative_shares = 1050`) Setting your limit price at `0.67` or placing a market order would fill a 1000-share buy in this scenario. > [!WARNING] > > Liquidity changes continuously. The order book snapshot you fetch may be stale by the time your order executes. For large orders, consider splitting into smaller chunks. ## Long vs short order books The `position` parameter controls which order book you're viewing: | Value | Description | | - | - | | `long` (default) | Long order book — orders betting the outcome **happens** | | `short` | Short order book — orders betting the outcome **does not happen** | Long and short positions trade in separate books. If you hold a short position and want to sell, fetch the short order book (`position=short`) to see relevant bids. ```python python theme={null} response = requests.get( "https://api.futuur.com/v2.0/markets/67890/book/", params={ "currency_mode": "play_money", "position": "short", }, ) short_book = response.json() best_short_bid = short_book["bid"][0]["price"] if short_book["bid"] else None print("Best bid for short shares:", best_short_bid) ``` ## Realtime order-book updates Subscribe to the per-event Pusher channel `event-{event_id}` and listen for `order-book-update`. That event carries absolute top-N bid/ask levels for the affected market — apply them directly for top-of-book quoting. Full-depth snapshots are not streamed over Pusher. When you need depth beyond top-N, call the REST [order book](/api-reference/markets/order-book) endpoint. See [Channels and events](/api-reference/websocket/channels-and-events) for the payload. # Selling a position Source: https://docs.futuur.com/guides/selling-a-position How to sell shares in an existing wager to close or reduce your position. Selling a position means placing an **ask** (sell) order on a market where you already hold shares. You can sell your entire position to exit completely, or sell a portion to reduce your exposure. > [!NOTE] > > All examples use `https://api.futuur.com/v2.0`. Every request requires HMAC authentication headers. See the [Authentication](/authentication) guide for how to generate them. **1. List your active wagers** Call `GET /wagers/` to see all positions you currently hold. Filter by `active=true` to show only open wagers. ```python python theme={null} import requests response = requests.get( "https://api.futuur.com/v2.0/wagers/", params={"active": True}, headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", }, ) wagers = response.json()["results"] for wager in wagers: print( f"Wager {wager['id']} — Market: {wager['market']}, " f"Shares: {wager['shares']}, Position: {wager['position']}" ) ``` ```bash curl theme={null} curl -G "https://api.futuur.com/v2.0/wagers/" \ --data-urlencode "active=true" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" ``` The response includes each wager's `market` ID, the number of `shares` you hold, and the `position` (`long` or `short`). **2. Find the wager you want to exit** Identify the wager you want to sell. Note the following fields from the wager response: * **`market`** — the market ID you'll use in the sell order * **`shares`** — the total number of shares you hold (your maximum sell quantity) * **`position`** — `long` if you bet the outcome happens, `short` if you bet against it * **`currency`** — the currency the wager was placed in ```python python theme={null} # Pick the wager you want to exit target_wager = wagers[0] market_id = target_wager["market"] shares_held = target_wager["shares"] position = target_wager["position"] currency = target_wager["currency"] print(f"Selling {shares_held} shares on market {market_id} ({position} position)") ``` > [!TIP] > > To check the current sell price before committing, fetch the order book with `GET /markets/{id}/book/` and look at the `bid` array. The highest bid is the best price you can sell at. See [Reading the order book](/guides/reading-the-order-book). **3. Place an ask (sell) order** To sell, place a `POST /orders/` request with `side="ask"`. Match the `position` field to the position type you hold — `long` for long shares, `short` for short shares. Use `shares` to specify exactly how many shares to sell. Set `price=null` for a market sell (executes immediately at the best available bid), or set a specific `price` to place a limit sell. **Market sell (sell immediately):** ```python python theme={null} # Sell all shares immediately at the best available price response = requests.post( "https://api.futuur.com/v2.0/orders/", json={ "market": market_id, "side": "ask", "currency": currency, "position": position, "shares": shares_held, "price": None, }, headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", "Content-Type": "application/json", }, ) order = response.json() print("Sell order ID:", order["id"], "Status:", order["status"]) ``` ```bash curl theme={null} # Sell all shares immediately at the best available price curl -X POST "https://api.futuur.com/v2.0/orders/" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "market": 67890, "side": "ask", "currency": "OOM", "position": "long", "shares": 150.0, "price": null }' ``` **Limit sell (only fill at your target price or better):** ```python python theme={null} # Limit sell: only sell if the price reaches 0.70 or higher response = requests.post( "https://api.futuur.com/v2.0/orders/", json={ "market": market_id, "side": "ask", "currency": currency, "position": position, "shares": shares_held, "price": 0.70, }, headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", "Content-Type": "application/json", }, ) order = response.json() print("Limit sell order placed. ID:", order["id"]) ``` ```bash curl theme={null} # Limit sell: only sell if the price reaches 0.70 or higher curl -X POST "https://api.futuur.com/v2.0/orders/" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "market": 67890, "side": "ask", "currency": "OOM", "position": "long", "shares": 150.0, "price": 0.70 }' ``` **4. Confirm the order is filled and the wager is closed** Check the order's `status` in the response. For market sells, the status is typically `filled` immediately. For limit sells, it remains `open` until a buyer matches your price. ```python python theme={null} order = response.json() if order["status"] == "filled": print("Position closed. Proceeds:", order["amount"]) elif order["status"] == "open": print("Limit sell is open. Waiting for price:", order["price"]) ``` To confirm the wager is fully closed, re-fetch your wagers list. A fully sold wager will no longer appear in the `active=true` results. ```python python theme={null} response = requests.get( "https://api.futuur.com/v2.0/wagers/", params={"active": True}, headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", }, ) active_ids = [w["id"] for w in response.json()["results"]] if target_wager["id"] not in active_ids: print("Wager is fully closed.") else: print("Wager is still open (partial fill or limit order pending).") ``` ```bash curl theme={null} curl -G "https://api.futuur.com/v2.0/wagers/" \ --data-urlencode "active=true" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" ``` ## Partial sells You don't have to sell your entire position at once. Pass a `shares` value smaller than your total holding to partially exit. The remaining shares stay open in your wager. ```python python theme={null} # Sell only half your shares shares_to_sell = shares_held / 2 response = requests.post( "https://api.futuur.com/v2.0/orders/", json={ "market": market_id, "side": "ask", "currency": currency, "position": position, "shares": shares_to_sell, "price": None, }, headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", "Content-Type": "application/json", }, ) ``` After a partial fill, your wager's `shares` field decreases by the number of shares sold. ## Long vs short positions | Position | What it means | How to sell | | - | - | - | | Long (`"long"`) | You bet the outcome **happens** | Place `side="ask"`, `position="long"` | | Short (`"short"`) | You bet the outcome **does not happen** | Place `side="ask"`, `position="short"` | Always match the `position` field in your sell order to the position type you hold. Mismatching will result in an error or an unintended new position. ## Cancelling an unfilled limit sell If your limit sell order hasn't filled yet and you want to cancel it, use `PATCH /orders/{id}/cancel/`: ```python python theme={null} order_id = order["id"] response = requests.patch( f"https://api.futuur.com/v2.0/orders/{order_id}/cancel/", headers={ "Key": "YOUR_PUBLIC_KEY", "Timestamp": "1712500000", "HMAC": "YOUR_HMAC_SIGNATURE", }, ) print("Cancelled:", response.status_code == 204) ``` ```bash curl theme={null} curl -X PATCH "https://api.futuur.com/v2.0/orders/99999/cancel/" \ -H "Key: YOUR_PUBLIC_KEY" \ -H "Timestamp: 1712500000" \ -H "HMAC: YOUR_HMAC_SIGNATURE" ``` # Split before quoting Source: https://docs.futuur.com/guides/split-before-quoting Documented phase after the in-house merge. Collateral is split into a YES+NO set so both sides can be sold. Not built in phase one. > [!NOTE] > > This is documentation only. It is the phase after the in-house inventory merge, and it is not built in phase one. Nothing on this page is live on `https://api.futuur.com`. Polymarket market makers take collateral and split it into a complete YES+NO set before they quote. The maker then holds sellable inventory on both sides. A complete set is collateral, not a bet: whichever side wins, the pair is worth $1. Merging it back returns $1 per set. ``` 1 collateral → split → 1 YES + 1 NO 1 YES + 1 NO → merge → 1 collateral ``` ## What phase one already does Phase one simulates the merging half of that experience. When the house market maker (or an allowlisted account) already holds both long and short on one market, [Merge a complete set](/guides/merge-complete-set) closes the overlap and returns collateral at \$1 a set. That merge does not create the pair. It only recycles a pair that trading already left behind. The quote curve does not move. ## What this phase specifies, and does not build Split would run before quoting: 1. Take collateral from the maker. 2. Split it into one YES and one NO for that market. 3. Quote sells from that inventory. The set itself is still collateral. 4. Merge any complete set that is no longer needed. Phase one is this step, on shares that already exist. Splitting is not implemented. There is no split endpoint, and phase one does not mint a YES+NO set in the database or on-chain. # Introduction Source: https://docs.futuur.com/introduction Get started with the Futuur API to build prediction market applications. Futuur is a prediction market platform where users trade on the outcomes of real-world events. The Futuur API gives you programmatic access to that same platform — letting you build applications that browse markets, place orders, and track positions. ## What you can do * **Browse events and markets** — list open prediction markets, filter by category or tag, and retrieve price history. * **Place limit orders** — submit bids and asks on event outcomes in both play money and real money modes. * **Manage wagers** — retrieve active and settled wager positions for any account. * **Read the order book** — access the full depth of bids and asks for any market. * **Subscribe to realtime updates** — receive price, order-book, and account events over Pusher WebSockets. * **Check balances** — fetch per-currency ledger balances for your account. ## Base URL All API requests go to: ``` https://api.futuur.com/v2.0 ``` That is `https://api.futuur.com` + `/v2.0`. Include the version in every request path. > [!NOTE] > > For reference, the deprecated v1.0 documentation is available at: [https://api.futuur.com/v1.0/docs](https://api.futuur.com/v1.0/docs) > [!NOTE] > > For AI agents and automated integrations, access the OpenAPI schema directly at: [https://api.futuur.com/docs/schema/](https://api.futuur.com/docs/schema/). This endpoint provides the complete API specification in JSON format, perfect for code generation, API clients, and AI-powered integrations. ## User-Agent header Send a non-empty `User-Agent` header that identifies your client, for example `MyApp/1.0` or the default value sent by your HTTP library (`python-requests/2.32.0`). This applies to public reads as well as authenticated calls. A browser-like value is not required. Scripts and servers, including clients running on cloud hosts, can call `/v2.0/`, `/v1.5/`, and `/api/`. > [!WARNING] > > `User-Agent` is not part of the HMAC signature. Send it alongside `Key`, `Timestamp`, and `HMAC`; do not include it in the string you sign. ## Key resources | Resource | Description | | - | - | | **Events** | Prediction market events. Each event has one or more outcomes. | | **Markets** | The tradeable instrument for a specific outcome within an event. | | **Orders** | Limit orders placed on a market outcome (bid or ask, long or short). | | **Wagers** | Confirmed positions resulting from matched orders. | ## Play money vs. real money The API supports two currency modes: * **Play money (OOM)** — use `currency_mode=play_money` to test your integration without financial risk. * **Real money (USDC, USDT, USD)** — live trading mode. Requires a funded account. > [!NOTE] > > Start with play money to verify your authentication and order flow before switching to real money. # Rate limits Source: https://docs.futuur.com/rate-limits Understand Futuur API rate limits and how to stay within them. The Futuur API enforces rate limits per authenticated user to ensure fair access and platform stability. ## Limits | Window | Limit | | - | - | | Per minute | 2,000 requests | | Per day | 1,000,000 requests | Both limits apply to your account (identified by your public key), not per IP address. The limits are shared across all endpoints — different paths and querystrings count against the same bucket. ## What happens when you exceed a limit When you exceed a rate limit, the API returns HTTP `429 Too Many Requests` with a `Retry-After` header indicating when you can retry. Back off until the indicated time. > [!WARNING] > > Requests carrying HMAC headers that fail authentication are also limited per IP, and sustained abuse is rate-limited at the network edge. ## Duplicate POST requests Submitting the same POST request more than once within a 1-second window causes a `wager_action_duplicated` error. This protects against accidental double-submission of orders. > [!NOTE] > > The duplicate check is based on request content, not idempotency keys. If you need to retry a failed POST, wait at least 1 second before resubmitting. ## Best practices **Use the `include_mine` parameter wisely.** Order book and event detail reads are served from cache. By default they return the public payload; pass `include_mine=1` only on the calls where you actually need your own orders or wagers embedded, so the rest of your polling stays on the fast path. **Prefer polling intervals of 1 second or more.** Responses are cached for a few seconds server-side, so faster polling returns the same data while consuming your quota. **Cache responses where possible.** Market data like event listings and price history does not change every second. Cache responses and serve them from memory rather than re-fetching on every operation. **Use exponential backoff on 429 responses.** If you receive a `429`, wait before retrying. Start with a short delay (e.g., 1 second) and double it on each successive failure, up to a maximum wait time. ```python python theme={null} import time import requests def request_with_backoff(url, headers, max_retries=5): delay = 1 for attempt in range(max_retries): response = requests.get(url, headers=headers) if response.status_code == 429: retry_after = response.headers.get('Retry-After') wait_time = int(retry_after) if retry_after else delay time.sleep(wait_time) delay = min(delay * 2, 60) # cap at 60 seconds continue return response return response ```