### Enable Venue Source: https://docs.predexon.com/trading-api/accounts/enable-venue Provision a venue for an account. Creates the wallet, funds gas, and sets token approvals. Returns `provisioning` while setup runs; poll `GET /api/accounts/{accountId}` until the venue's status becomes `active`. ```APIDOC ## POST /api/accounts/{accountId}/enable ### Description Provision a venue for an account. Creates the wallet, funds gas, and sets token approvals. Returns `provisioning` while setup runs; poll `GET /api/accounts/{accountId}` until the venue's status becomes `active`. ### Method POST ### Endpoint /api/accounts/{accountId}/enable ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account to enable the venue for. #### Request Body - **venue** (string) - Required - The venue to enable. Must be one of: polymarket, predict, opinion, limitless, hyperliquid. ### Request Example { "venue": "polymarket" } ### Response #### Success Response (200) - **venue** (string) - The name of the venue. - **status** (string) - The status of the venue. Can be `provisioning`, `active`, or `failed`. - **message** (string) - A message providing details about the status, especially if `failed`. #### Response Example { "venue": "polymarket", "status": "provisioning" } ``` -------------------------------- ### Binance Ticks Endpoint Example Source: https://docs.predexon.com/changelog Example of fetching raw book ticker data from Binance. ```http GET /v2/binance/ticks/{symbol} ``` -------------------------------- ### Install MCP Server Globally Source: https://docs.predexon.com/mcp-server Install the Predexon MCP server globally using npm. This command is used for system-wide installation. ```bash npm install -g predexon-mcp ``` -------------------------------- ### Snapshots Done Example Source: https://docs.predexon.com/websocket/playground-orderbook This example demonstrates the JSON payload indicating that all initial book snapshots have been delivered. It includes the event type and the count of snapshot events sent. ```json { "event_type": "snapshots_done", "count": 2 } ``` -------------------------------- ### Redeem Position Example Source: https://docs.predexon.com/trading-api/accounts/redeem-position This example demonstrates how to redeem a position by specifying the market ID and outcome. ```javascript const marketId = "12345"; const outcome = "Yes"; // Call the redeemPosition function with marketId and outcome redeemPosition(marketId, outcome); ``` -------------------------------- ### Set Fee Policy Request Example Source: https://docs.predexon.com/trading-api/fees/set-fee-policy This example demonstrates how to configure the fee policy for a venue, specifying the partner fee in basis points and the treasury address. ```yaml venue: polymarket partnerFeeBps: 100 partnerTreasuryAddress: '0x1234567890abcdef1234567890abcdef12345678' ``` -------------------------------- ### Hyperliquid Market Buy Order Example Source: https://docs.predexon.com/trading-api/accounts/place-order Example of placing a market buy order on Hyperliquid. Requires `venue`, `market` (with `assetId`), `side`, `type`, and `size`. ```yaml venue: hyperliquid market: assetId: '100000020' side: buy type: market size: '11' ``` -------------------------------- ### Event Batch Message Example Source: https://docs.predexon.com/websocket/playground-orderbook Example of an event batch message. Used for wildcard/firehose subscriptions, batched with price-level conflation. ```json { "type": "event_batch", "subscription_id": "sub_xxx", "count": 350, "events": [], "gap": false } ``` -------------------------------- ### Polymarket Market Buy Order Example Source: https://docs.predexon.com/trading-api/accounts/place-order Example of placing a market buy order on Polymarket. Requires `venue`, `market` (with `tokenId`), `side`, `type`, and `amount`. ```yaml venue: polymarket market: tokenId: '71321045679252212' side: buy type: market amount: '2' ``` -------------------------------- ### Polymarket Limit Buy Order Example Source: https://docs.predexon.com/trading-api/accounts/place-order Example of placing a limit buy order on Polymarket. Requires `venue`, `market` (with `tokenId`), `side`, `type`, `size`, and `price`. ```yaml venue: polymarket market: tokenId: '71321045679252212' side: buy type: limit size: '10' price: '0.55' ``` -------------------------------- ### Opinion Market Buy Order Example Source: https://docs.predexon.com/trading-api/accounts/place-order Example of placing a market buy order on Opinion. Requires `venue`, `market` (with `tokenId` and `marketId`), `side`, `type`, and `amount`. ```yaml venue: opinion market: tokenId: '9123' marketId: '123' side: buy type: market amount: '5' ``` -------------------------------- ### Hyperliquid Limit Sell Order Example Source: https://docs.predexon.com/trading-api/accounts/place-order Example of placing a limit sell order on Hyperliquid. Requires `venue`, `market` (with `assetId`), `side`, `type`, `size`, and `price`. ```yaml venue: hyperliquid market: assetId: '100000020' side: sell type: limit size: '11' price: '0.99' ``` -------------------------------- ### Get Market Volume Time Series Source: https://docs.predexon.com/api-reference/markets/volume Returns historical time series of traded volume for a token with day+ granularity. You can filter by start and end times. ```APIDOC ## GET /v2/polymarket/markets/{token_id}/volume ### Description Return historical time series of traded volume for a token (day+ granularity). ### Method GET ### Endpoint /v2/polymarket/markets/{token_id}/volume ### Parameters #### Path Parameters - **token_id** (string) - Required - Token ID for the market #### Query Parameters - **granularity** (PnLGranularity) - Optional - Time granularity (default: day). Allowed values: day, week, month, year, all. - **start_time** (integer) - Optional - Unix timestamp (seconds) for start - **end_time** (integer) - Optional - Unix timestamp (seconds) for end ### Response #### Success Response (200) - **token_id** (string) - Token ID for the market - **granularity** (PnLGranularity) - The granularity of the returned data. - **start_time** (integer) - The start timestamp of the returned data. - **end_time** (integer) - The end timestamp of the returned data. - **volume_over_time** (array) - An array of VolumeDataPoint objects representing the volume over time. #### Response Example { "token_id": "example_token_id", "granularity": "day", "start_time": 1678886400, "end_time": 1678972800, "volume_over_time": [ { "timestamp": 1678886400, "volume": 1500.50, "buy_volume": 1000.25, "sell_volume": 500.25 } ] } #### Error Response (400, 422, 500) - **error** (string) - A short error code. - **message** (string) - A detailed error message. ``` -------------------------------- ### Create an Account Source: https://docs.predexon.com/concepts/how-it-works Provision a deposit wallet and trading identity for your account. This is the first step in setting up your trading infrastructure with Predexon. ```bash POST /api/accounts/create ``` -------------------------------- ### Get Outcome by Predexon ID Source: https://docs.predexon.com/api-reference/canonical/outcome Fetches the details of a specific outcome using its unique Predexon ID. This includes market information, start times, status, and venue-specific data. ```APIDOC ## GET /v2/outcomes/{predexon_id} ### Description Retrieves detailed information about a specific outcome identified by its Predexon ID. ### Method GET ### Endpoint /v2/outcomes/{predexon_id} ### Parameters #### Path Parameters - **predexon_id** (string) - Required - The unique identifier for the outcome. ### Request Example ```bash curl -sS \ -H 'x-api-key: YOUR_API_KEY' \ 'https://api.predexon.com/v2/outcomes/px-udfdzy5gtmm4kdoa' ``` ### Response #### Success Response (200) - **predexon_id** (string) - The unique identifier for the outcome. - **event_id** (string) - The identifier for the associated event. - **market_type** (string) - The type of market (e.g., 'game_winner'). - **market_title** (string) - A human-readable title for the market. - **starts_at** (string) - The start time of the market in ISO 8601 format. - **status** (string) - The current status of the market (e.g., 'open', 'resolved'). - **outcome** (string) - The winning outcome identifier. - **outcome_label** (string) - A human-readable label for the winning outcome. - **claim** (string) - A descriptive claim associated with the outcome. - **venues** (array) - An array of venue-specific market details. - **venue** (string) - The name of the venue (e.g., 'kalshi', 'polymarket'). - **market_ticker** (string) - The market ticker symbol at the venue. - **venue_market_title** (string) - The market title as displayed by the venue. - **side** (string) - The user's side in the market ('yes' or 'no'). - **status** (string) - The status of the market at the venue. - **yes_subtitle** (string) - Subtitle for the 'yes' side. - **selection_label** (string) - The label for the selected outcome. - **market_id** (string) - The market ID on the venue. - **condition_id** (string) - The condition ID on the venue. - **market_slug** (string) - The market slug on the venue. - **token_id** (string) - The token ID on the venue. - **description** (string) - Venue-native market description. - **resolution_source** (string) - Venue-native resolution source. - **venue_event_slug** (string) - The event slug on the venue. - **image_url** (string) - URL for an associated image. - **league** (string) - The league the market belongs to. #### Response Example ```json { "predexon_id": "px-udfdzy5gtmm4kdoa", "event_id": "fl1-asm-met-2026-05-02", "market_type": "game_winner", "market_title": "Monaco vs Metz Winner?", "starts_at": "2026-05-02T00:00:00+00:00", "status": "open", "outcome": "asm", "outcome_label": "Monaco", "claim": "Monaco win fl1-asm-met-2026-05-02.", "venues": [ { "venue": "kalshi", "market_ticker": "KXLIGUE1GAME-26MAY02FCMASM-ASM", "venue_market_title": "Metz vs Monaco Winner?", "side": "yes", "status": "open", "yes_subtitle": "Monaco", "selection_label": "Monaco", "series": "KXLIGUE1GAME" }, { "venue": "polymarket", "market_id": "2018979", "condition_id": "0x070254c57b7545b0df2dba4a38ef81655a5b41c1f8edf9d466218f58d9a1f600", "market_slug": "fl1-met-asm-2026-05-02-asm", "venue_market_title": "Will AS Monaco FC win on 2026-05-02?", "token_id": "10439835459613392921040201374401440506564152347998894843834931942965004437054", "side": "yes", "status": "open", "selection_label": "Monaco", "description": "Venue-native market description when provided by Polymarket.", "resolution_source": "Venue-native resolution source when provided.", "venue_event_slug": "fl1-met-asm-2026-05-02", "image_url": "https://..." } ], "league": "fl1" } ``` ### Errors #### Error Response (404) - **Reason**: No canonical outcome found for the provided `predexon_id`. ``` -------------------------------- ### Canonical Outcome JSON Response Source: https://docs.predexon.com/api-reference/canonical/outcome This is an example of a successful JSON response when fetching canonical outcome data. It includes market details, start times, status, and venue-specific information. ```json { "predexon_id": "px-udfdzy5gtmm4kdoa", "event_id": "fl1-asm-met-2026-05-02", "market_type": "game_winner", "market_title": "Monaco vs Metz Winner?", "starts_at": "2026-05-02T00:00:00+00:00", "status": "open", "outcome": "asm", "outcome_label": "Monaco", "claim": "Monaco win fl1-asm-met-2026-05-02.", "venues": [ { "venue": "kalshi", "market_ticker": "KXLIGUE1GAME-26MAY02FCMASM-ASM", "venue_market_title": "Metz vs Monaco Winner?", "side": "yes", "status": "open", "yes_subtitle": "Monaco", "selection_label": "Monaco", "series": "KXLIGUE1GAME" }, { "venue": "polymarket", "market_id": "2018979", "condition_id": "0x070254c57b7545b0df2dba4a38ef81655a5b41c1f8edf9d466218f58d9a1f600", "market_slug": "fl1-met-asm-2026-05-02-asm", "venue_market_title": "Will AS Monaco FC win on 2026-05-02?", "token_id": "10439835459613392921040201374401440506564152347998894843834931942965004437054", "side": "yes", "status": "open", "selection_label": "Monaco", "description": "Venue-native market description when provided by Polymarket.", "resolution_source": "Venue-native resolution source when provided.", "venue_event_slug": "fl1-met-asm-2026-05-02", "image_url": "https://..." } ], "league": "fl1" } ``` -------------------------------- ### Get Kalshi Orderbooks Source: https://docs.predexon.com/api-reference/kalshi/orderbooks Fetch historical orderbook snapshots for a Kalshi market. Requires market ticker, start time, and end time in milliseconds. Optional parameters include limit and pagination key. ```yaml GET /v2/kalshi/orderbooks openapi: 3.1.0 info: title: Predexon API description: Prediction market data aggregation and matching API version: 2.0.0 servers: - url: https://api.predexon.com security: - apiKey: [] paths: /v2/kalshi/orderbooks: get: tags: - kalshi summary: Get Kalshi Orderbooks description: >- Fetch historical orderbook snapshots for a Kalshi market over a specified time range. Returns snapshots of the order book including yes bids, yes asks, and market metadata. All timestamps are in milliseconds. Prices are in cents (1-99 representing $0.01 to $0.99). operationId: get_kalshi_orderbooks_v2_kalshi_orderbooks_get parameters: - name: ticker in: query required: true schema: type: string description: The Kalshi market ticker title: Ticker description: The Kalshi market ticker - name: start_time in: query required: true schema: type: integer description: Start time in Unix timestamp (milliseconds) title: Start Time description: Start time in Unix timestamp (milliseconds) - name: end_time in: query required: true schema: type: integer description: End time in Unix timestamp (milliseconds) title: End Time description: End time in Unix timestamp (milliseconds) - name: limit in: query required: false schema: type: integer maximum: 200 minimum: 1 description: Maximum number of snapshots to return default: 100 title: Limit description: Maximum number of snapshots to return - name: pagination_key in: query required: false schema: anyOf: - type: string - type: 'null' description: Pagination key to get the next chunk of data title: Pagination Key description: Pagination key to get the next chunk of data responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/KalshiOrderbooksResponse' '400': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad Request '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' '500': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal Server Error components: schemas: KalshiOrderbooksResponse: properties: snapshots: items: $ref: '#/components/schemas/KalshiOrderbookSnapshot' type: array title: Snapshots pagination: $ref: '#/components/schemas/CursorPagination' type: object required: - snapshots - pagination title: KalshiOrderbooksResponse description: Kalshi orderbooks endpoint response. ErrorResponse: properties: error: type: string title: Error message: type: string title: Message type: object required: - error - message title: ErrorResponse description: Standard error response. HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError KalshiOrderbookSnapshot: properties: ticker: type: string title: Ticker description: Market ticker timestamp: type: integer title: Timestamp description: Snapshot timestamp in milliseconds yes_bids: items: $ref: '#/components/schemas/KalshiOrderbookLevel' type: array title: Yes Bids description: Yes bid levels, ordered by price descending yes_asks: items: $ref: '#/components/schemas/KalshiOrderbookLevel' type: array title: Yes Asks description: Yes ask levels, ordered by price ascending best_bid: type: integer title: Best Bid description: Best bid price in cents best_ask: type: integer title: Best Ask description: Best ask price in cents bid_depth: type: integer ``` -------------------------------- ### Get PredictFun Orderbooks Source: https://docs.predexon.com/api-reference/predictfun/orderbooks Fetches historical orderbook snapshots for a PredictFun market over a specified time range. Requires market ID, start time, and end time. Optional parameters include limit and pagination key. ```yaml openapi: 3.1.0 info: title: Predexon API description: Prediction market data aggregation and matching API version: 2.0.0 servers: - url: https://api.predexon.com security: - apiKey: [] paths: /v2/predictfun/orderbooks: get: tags: - predictfun summary: Get PredictFun Orderbooks description: >- Fetch historical orderbook snapshots for a PredictFun market over a specified time range. Returns orderbook snapshots including bids, asks, and depth metadata. All timestamps are in milliseconds. operationId: get_predictfun_orderbooks_v2_predictfun_orderbooks_get parameters: - name: market_id in: query required: true schema: type: integer description: The PredictFun market ID title: Market Id description: The PredictFun market ID - name: start_time in: query required: true schema: type: integer description: Start time in Unix timestamp (milliseconds) title: Start Time description: Start time in Unix timestamp (milliseconds) - name: end_time in: query required: true schema: type: integer description: End time in Unix timestamp (milliseconds) title: End Time description: End time in Unix timestamp (milliseconds) - name: limit in: query required: false schema: type: integer maximum: 200 minimum: 1 description: Maximum number of snapshots to return default: 100 title: Limit description: Maximum number of snapshots to return - name: pagination_key in: query required: false schema: anyOf: - type: string - type: 'null' description: Pagination key to get the next chunk of data title: Pagination Key description: Pagination key to get the next chunk of data responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PredictFunOrderbooksResponse' '400': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad Request '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' '500': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal Server Error components: schemas: PredictFunOrderbooksResponse: properties: snapshots: items: $ref: '#/components/schemas/PredictFunOrderbookSnapshot' type: array title: Snapshots pagination: $ref: '#/components/schemas/CursorPagination' type: object required: - snapshots - pagination title: PredictFunOrderbooksResponse description: PredictFun orderbooks endpoint response. ErrorResponse: properties: error: type: string title: Error message: type: string title: Message type: object required: - error - message title: ErrorResponse description: Standard error response. HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError PredictFunOrderbookSnapshot: properties: market_id: type: integer title: Market Id description: Market ID timestamp: type: integer title: Timestamp description: Snapshot timestamp (Unix epoch MILLISECONDS) bids: items: $ref: '#/components/schemas/PredictFunOrderbookLevel' type: array title: Bids description: Bid levels asks: items: $ref: '#/components/schemas/PredictFunOrderbookLevel' type: array title: Asks description: Ask levels best_bid: type: number title: Best Bid description: Best bid price best_ask: type: number title: Best Ask description: Best ask price bid_depth: type: number title: Bid Depth description: Total bid depth ask_depth: type: number ``` -------------------------------- ### Subscribe to Trade Alerts for Wallets Source: https://docs.predexon.com/websocket/subscriptions This example demonstrates subscribing to trade alerts by specifying a list of wallet addresses as filters. ```json { "action": "subscribe", "platform": "polymarket", "version": 1, "type": "orders", "filters": { "users": [ "0x1234567890abcdef1234567890abcdef12345678", "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd" ] } } ``` -------------------------------- ### Initialize API Request Headers and Base URL Source: https://docs.predexon.com/quickstart Set up the base URL and headers for making authenticated requests to the Predexon API using Python. ```python import requests BASE_URL = "https://api.predexon.com" API_KEY = "your_api_key" HEADERS = {"x-api-key": API_KEY} ``` -------------------------------- ### Get Orderbooks Source: https://docs.predexon.com/api-reference/markets/orderbooks Fetches historical orderbook snapshots for a specified asset and time range. Returns snapshots of the order book including bids, asks, and market metadata. All timestamps are in milliseconds. Orderbook data has history starting from January 1st, 2026. ```APIDOC ## GET /v2/polymarket/orderbooks ### Description Fetch historical orderbook snapshots for a specific asset (token ID) over a specified time range. Returns snapshots of the order book including bids, asks, and market metadata in order. All timestamps are in milliseconds. Orderbook data has history starting from January 1st, 2026. ### Method GET ### Endpoint /v2/polymarket/orderbooks ### Parameters #### Query Parameters - **token_id** (string) - Required - The token ID (asset) for the Polymarket market - **start_time** (integer) - Required - Start time in Unix timestamp (milliseconds) - **end_time** (integer) - Required - End time in Unix timestamp (milliseconds) - **limit** (integer) - Optional - Maximum number of snapshots to return (default: 100, min: 1, max: 200) - **pagination_key** (string | null) - Optional - Pagination key to get the next chunk of data ### Response #### Success Response (200) - **snapshots** (array) - Array of OrderbookSnapshot objects. - **pagination** (object) - CursorPagination object for pagination. #### Response Example { "snapshots": [ { "asks": [ { "price": "string", "size": "string" } ], "bids": [ { "price": "string", "size": "string" } ], "hash": "string", "assetId": "string", "timestamp": 0, "tickSize": "string", "indexedAt": 0 } ], "pagination": { "next": "string", "prev": "string" } } #### Error Response (400, 500) { "error": "string", "message": "string" } #### Validation Error Response (422) { "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string" } ] } ``` -------------------------------- ### Create Account Source: https://docs.predexon.com/trading-api/reference Create accounts, enable venues, inspect balances, positions, and account state. ```APIDOC ## POST /api/accounts/create ### Description Creates a new managed account. ### Method POST ### Endpoint /api/accounts/create ### Request Body - **name** (string) - Required - A human-readable name for the account. ### Request Example { "name": "My Trading Account" } ### Response #### Success Response (200) - **accountId** (string) - The unique identifier for the newly created account. - **name** (string) - The name of the account. - **state** (string) - The current state of the account (e.g., 'active', 'suspended'). #### Response Example { "accountId": "acc_12345abcde", "name": "My Trading Account", "state": "active" } ``` -------------------------------- ### Get Binance Candles Source: https://docs.predexon.com/api-reference/binance/candles Fetches OHLCV candlestick data for a specified Binance trading pair. The data can be filtered by interval, start time, end time, and a limit on the number of candles returned. Candle prices are derived from book ticker mid-prices. ```APIDOC ## GET /v2/binance/candles/{symbol} ### Description Fetch OHLCV candlestick data for a Binance trading pair. Candle prices are derived from book ticker mid-prices (not trade prices). ### Method GET ### Endpoint /v2/binance/candles/{symbol} ### Parameters #### Path Parameters - **symbol** (string) - Required - Trading pair (e.g. BTCUSDT) #### Query Parameters - **interval** (string) - Optional - Candle interval (default: 1m). Supported values: 1s, 1m, 5m, 15m, 1h, 4h, 1d. - **start_time** (integer) - Optional - Unix timestamp (seconds) for range start. - **end_time** (integer) - Optional - Unix timestamp (seconds) for range end. - **limit** (integer) - Optional - Max candles to return (default: 500, max: 1500). ### Response #### Success Response (200) - **symbol** (string) - Trading pair (e.g. BTCUSDT) - **interval** (string) - Candle interval (e.g. 15m, 1h) - **candles** (array) - Array of candles, ordered by timestamp ASC. Each candle object contains: - **t** (integer) - Timestamp - **o** (string) - Open price - **h** (string) - High price - **l** (string) - Low price - **c** (string) - Close price - **v** (string) - Volume #### Error Response - **400**: Bad Request - **404**: Not Found - **422**: Validation Error - **500**: Internal Server Error ``` -------------------------------- ### Set Fee Policy Response Example Source: https://docs.predexon.com/trading-api/fees/set-fee-policy This example shows a successful response after updating the fee policy, including the venue, fee status, basis points for platform and partner fees, and the total combined fee. ```yaml venue: polymarket enabled: true platformFeeBps: 0 partnerFeeBps: 100 partnerTreasuryAddress: '0x1234567890abcdef1234567890abcdef12345678' totalFeeBps: 100 ``` -------------------------------- ### GET /v2/polymarket/volume-chart/{condition_id} Source: https://docs.predexon.com/api-reference/markets/volume-chart Fetches volume chart data for a market, broken down by YES/NO side. Returns per-period total, YES, and NO volume aggregated from trade events. Requires a condition ID, start time, and end time. Granularity can be specified as hour, day, or week. ```yaml GET /v2/polymarket/volume-chart/{condition_id} openapi: 3.1.0 info: title: Predexon API description: Prediction market data aggregation and matching API version: 2.0.0 servers: - url: https://api.predexon.com security: - apiKey: [] paths: /v2/polymarket/volume-chart/{condition_id}: get: tags: - polymarket summary: Get Volume Chart description: >- Fetch volume chart data for a market, broken down by YES/NO side. Returns per-period total, YES, and NO volume aggregated from trade events. operationId: get_volume_chart_v2_polymarket_volume_chart__condition_id__get parameters: - name: condition_id in: path required: true schema: type: string description: Condition ID for the market title: Condition Id description: Condition ID for the market - name: granularity in: query required: false schema: $ref: '#/components/schemas/VolumeChartGranularity' description: 'Time granularity: hour, day, or week' default: hour description: 'Time granularity: hour, day, or week' - name: start_time in: query required: true schema: type: integer minimum: 0 description: Unix timestamp (seconds) for start of time range title: Start Time description: Unix timestamp (seconds) for start of time range - name: end_time in: query required: true schema: type: integer minimum: 0 description: Unix timestamp (seconds) for end of time range title: End Time description: Unix timestamp (seconds) for end of time range responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VolumeChartResponse' '400': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad Request '404': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not Found '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: VolumeChartGranularity: type: string enum: - hour - day - week title: VolumeChartGranularity description: Granularity for volume chart endpoint. VolumeChartResponse: properties: condition_id: type: string title: Condition Id description: Market condition ID granularity: $ref: '#/components/schemas/VolumeChartGranularity' description: Time granularity start_time: type: integer title: Start Time description: Unix timestamp of first data point end_time: type: integer title: End Time description: Unix timestamp of last data point data: items: $ref: '#/components/schemas/VolumeChartDataPoint' type: array title: Data description: Volume data points type: object required: - condition_id - granularity - start_time - end_time - data title: VolumeChartResponse description: Volume chart endpoint response. ErrorResponse: properties: error: type: string title: Error message: type: string title: Message type: object required: - error - message title: ErrorResponse description: Standard error response. HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError VolumeChartDataPoint: properties: timestamp: type: integer title: Timestamp description: Unix timestamp in seconds (start of period) total_volume: type: number title: Total Volume description: Total USD volume in this period yes_volume: type: number title: Yes Volume description: YES-side USD volume in this period no_volume: type: number title: No Volume description: NO-side USD volume in this period trades_count: type: integer title: Trades Count ``` -------------------------------- ### Get Balance Source: https://docs.predexon.com/llms.txt Get balance for your trading wallet. ```APIDOC ## GET /trading-api/trading/get-balance ### Description Get balance for your trading wallet. ### Method GET ### Endpoint /trading-api/trading/get-balance ``` -------------------------------- ### Subscribe to Orderbook Example Source: https://docs.predexon.com/websocket/playground-orderbook This example demonstrates how to subscribe to orderbook data using market slugs. Ensure only one filter type (token_ids, condition_ids, or market_slugs) is used per subscription. ```json { "action": "subscribe", "platform": "polymarket", "version": 1, "type": "orderbook", "filters": { "market_slugs": [ "bitcoin-100k-2026" ] } } ``` -------------------------------- ### Get All Positions Source: https://docs.predexon.com/api-reference/trading/positions Fetch all user positions with filtering and pagination. This endpoint is designed for analytics and streaming use cases, allowing clients to backfill historical data or stream new updates. Use `min_block` to start from a specific block and `order=asc` for oldest first (streaming/backfill) or `order=desc` for latest first (recent data). The pagination cursor encodes the last position's block/timestamp and IDs for efficient continuation. ```APIDOC ## GET /v2/polymarket/positions ### Description Fetch all user positions with filtering and pagination. Designed for analytics and streaming use cases where clients need to backfill historical position data or stream new position updates. Use `min_block` to start from a specific block (for backfill). Use `order=asc` to get oldest first (for streaming/backfill). Use `order=desc` to get latest first (for recent data). The pagination cursor encodes the last position's block/timestamp and IDs, allowing efficient continuation from any point. ### Method GET ### Endpoint /v2/polymarket/positions ### Parameters #### Query Parameters - **order_by** (AllPositionsOrderBy) - Optional - Order by block number or timestamp. Default: block - **order** (OrderDirection) - Optional - Sort order (desc for latest first, asc for streaming from oldest). Default: desc - **min_block** (integer | null) - Optional - Minimum block number (inclusive) - **max_block** (integer | null) - Optional - Maximum block number (inclusive) - **min_timestamp** (integer | null) - Optional - Minimum timestamp in Unix seconds (inclusive) - **max_timestamp** (integer | null) - Optional - Maximum timestamp in Unix seconds (inclusive) - **wallet** (string | null) - Optional - Filter by wallet address - **token_id** (string | null) - Optional - Filter by token ID - **condition_id** (string | null) - Optional - Filter by market condition ID - **limit** (integer) - Optional - Maximum positions per page (1-500). Default: 100 - **pagination_key** (string | null) - Optional - Cursor for pagination ### Responses #### Success Response (200) - **AllPositionsResponse** - Successful Response #### Error Response (400) - **ErrorResponse** - Bad Request ``` -------------------------------- ### Enable a Venue for Trading Source: https://docs.predexon.com/concepts/how-it-works Configure your account to trade on a specific venue. This involves on-chain approvals and setting up venue-specific credentials. ```bash POST /api/accounts/{accountId}/enable ``` -------------------------------- ### Get UMA Market Source: https://docs.predexon.com/llms.txt Get current UMA oracle status and event timeline for a market. ```APIDOC ## GET /uma/get-market ### Description Get current UMA oracle status and event timeline for a market. ### Method GET ### Endpoint /uma/get-market ### Parameters #### Query Parameters - **market_id** (string) - Required - The unique identifier for the UMA market. ### Response #### Success Response (200) - **oracle_status** (string) - The current status of the UMA oracle (e.g., 'pending', 'resolved', 'disputed'). - **event_timeline** (array) - A list of significant events related to the UMA oracle. - **timestamp** (integer) - Unix timestamp of the event. - **event** (string) - Description of the event. - **details** (object) - Additional details about the event. #### Response Example { "oracle_status": "resolved", "event_timeline": [ { "timestamp": 1670000000, "event": "Oracle price requested", "details": {} }, { "timestamp": 1670100000, "event": "Oracle price reported", "details": {"price": 1.50} } ] } ``` -------------------------------- ### Enable Venue and Poll for Status - Python Source: https://docs.predexon.com/trading-api/quickstart Enable a venue for your account and poll for its status until it becomes 'active'. Handles provisioning and potential failures. Replace 'polymarket' with other venue names as needed. ```python import time # Enable Polymarket requests.post( f"{BASE}/api/accounts/{account_id}/enable", headers=HEADERS, json={"venue": "polymarket"}, ) # Poll until ready (terminal states: "active" success, "failed" error) for _ in range(60): info = requests.get(f"{BASE}/api/accounts/{account_id}", headers=HEADERS).json() status = info["venues"].get("polymarket", {}).get("status") if status == "active": wallet = info["venues"]["polymarket"]["address"] print(f"Polymarket wallet ready: {wallet}") break if status == "failed": raise RuntimeError(f"Provisioning failed: {info['venues']['polymarket'].get('error')}") time.sleep(2) ``` -------------------------------- ### Limitless Redeem Request Example Source: https://docs.predexon.com/trading-api/accounts/redeem-position Example JSON payload for redeeming a position on Limitless, identifying the market by `tokenId`. ```json { "venue": "limitless", "market": { "tokenId": "55222001234567" } } ``` -------------------------------- ### Predict Redeem Request Example Source: https://docs.predexon.com/trading-api/accounts/redeem-position Example JSON payload for redeeming a position on Predict, identifying the market by `tokenId`. ```json { "venue": "predict", "market": { "tokenId": "103210916722172747942846166716572235061234589599991001208035034049741504775450" } } ``` -------------------------------- ### POST /api/accounts/create Source: https://docs.predexon.com/api-reference/endpoints Creates a new account with no initial venues enabled. This is the starting point for setting up a new trading entity. ```APIDOC ## POST /api/accounts/create ### Description **Create account** - empty, no venues enabled ### Method POST ### Endpoint /api/accounts/create ### Parameters #### Request Body This endpoint does not require a request body. ``` -------------------------------- ### Polymarket Redeem Request Example Source: https://docs.predexon.com/trading-api/accounts/redeem-position Example JSON payload for redeeming a position on Polymarket, identifying the market by `tokenId`. ```json { "venue": "polymarket", "market": { "tokenId": "71321045679252212" } } ``` -------------------------------- ### GET /api/accounts/{accountId} Source: https://docs.predexon.com/api-reference/endpoints Retrieves the profile and per-venue entitlements for a specific account. Use this to get detailed information about a single account. ```APIDOC ## GET /api/accounts/{accountId} ### Description **Get account** - profile + per-venue entitlements ### Method GET ### Endpoint /api/accounts/{accountId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The unique identifier of the account. ``` -------------------------------- ### Cross-Platform Market Equivalence Source: https://docs.predexon.com/mcp-server Find the equivalent market on another platform. This example searches for the Kalshi equivalent of a given Polymarket market. ```text Find the Kalshi equivalent of this Polymarket market: will-bitcoin-hit-100k-in-2024 ``` -------------------------------- ### Initialize API Request Headers and Base URL Source: https://docs.predexon.com/quickstart Set up the base URL and headers for making authenticated requests to the Predexon API using TypeScript. ```typescript const BASE_URL = "https://api.predexon.com"; const HEADERS = { "x-api-key": "your_api_key" }; ``` -------------------------------- ### Opinion Whole-Market Redeem Request Example Source: https://docs.predexon.com/trading-api/accounts/redeem-position Example JSON payload for redeeming all outcomes of a market on Opinion, identifying the market by `marketId`. ```json { "venue": "opinion", "market": { "marketId": "123" } } ```