> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openpx.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Order mapping

> How each upstream exchange schema maps to OpenPX Order.

*An order on the unified surface.*

Every field is one of three entry types — **direct** (taken from upstream), **synthetic** (computed by OpenPX), or **omitted** (not exposed upstream).

## Coverage

| Exchange   | Direct | Synthetic | Omitted |
| ---------- | ------ | --------- | ------- |
| kalshi     | 9      | 2         | 0       |
| polymarket | 8      | 0         | 3       |

## Field crosswalk

| Unified field   | Type                | kalshi source                                                                  | polymarket source                                       | Notes                                                                                                                                                                                                                                        |
| --------------- | ------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`            | string              | `Order.order_id`, fallback `CreateOrderV2Response.order_id`                    | `OpenOrder.id`, fallback `SendOrderResponse.orderID`    | **kalshi:** Kalshi-issued order id, identical across V1 GET and every V2 mutation response. **polymarket:** Order hash; exposed as `id` on GET responses and `orderID` on POST /order.                                                       |
| `market_ticker` | string              | `Order.ticker`                                                                 | *omitted*                                               | **kalshi:** V1 GET echoes the ticker; on V2 mutations the adapter carries the request `asset_id` through. **polymarket:** Polymarket exposes a CTF condition id, not a market ticker; always empty on this surface.                          |
| `outcome`       | string              | *synthetic*                                                                    | `OpenOrder.outcome`                                     | **kalshi:** Title-cased from `Order.side` (yes/no); V2 mutations reuse the caller-frame outcome. **polymarket:** Outcome label as published by Polymarket (e.g. `YES`/`NO` on binary markets).                                               |
| `side`          | OrderSide           | *synthetic*                                                                    | `OpenOrder.side`                                        | **kalshi:** Sourced from `Order.action` (buy/sell), not the YES/NO `side` field. **polymarket:** BUY/SELL enum, 1:1 with unified `OrderSide`.                                                                                                |
| `price`         | number (double)     | `Order.yes_price_dollars`, fallback `CreateOrderV2Response.average_fill_price` | `OpenOrder.price`                                       | **kalshi:** Fixed-point dollar string (V1) or YES-frame average fill price (V2), converted to caller-frame f64. **polymarket:** Decimal probability string (e.g. `"0.5"`) parsed to f64.                                                     |
| `size`          | number (double)     | `Order.initial_count_fp`, fallback `CreateOrderV2Response.remaining_count`     | `OpenOrder.original_size`                               | **kalshi:** FixedPointCount on V1; reconstructed as fill\_count + remaining\_count on V2. **polymarket:** Six-decimal fixed-math string parsed to f64.                                                                                       |
| `filled`        | number (double)     | `Order.fill_count_fp`, fallback `CreateOrderV2Response.fill_count`             | `OpenOrder.size_matched`                                | **kalshi:** FixedPointCount on both V1 and V2. **polymarket:** Cumulative matched size; six-decimal fixed-math string parsed to f64.                                                                                                         |
| `fee`           | number? (double)    | `CreateOrderV2Response.average_fee_paid`                                       | *omitted*                                               | **kalshi:** Per-contract average fee from the V2 create response, multiplied by fill\_count for the dollar total. **polymarket:** Polymarket charges fees at trade settlement, not on order creation or lookup.                              |
| `status`        | OrderStatus         | `Order.status`                                                                 | `OpenOrder.status`, fallback `SendOrderResponse.status` | **kalshi:** V1 enum mapped to unified status; V2 mutations derive status from (fill\_count, remaining\_count). **polymarket:** OpenOrder uses prefixed `ORDER_STATUS_*` enums; SendOrderResponse uses unprefixed `live`/`matched`/`delayed`. |
| `created_at`    | string (date-time)  | `Order.created_time`                                                           | `OpenOrder.created_at`                                  | **kalshi:** RFC3339 string on V1; V2 mutations fall back to wall-clock at parse time. **polymarket:** Unix seconds; create paths fall back to wall-clock since SendOrderResponse omits it.                                                   |
| `updated_at`    | string? (date-time) | `Order.last_update_time`                                                       | *omitted*                                               | **kalshi:** RFC3339, nullable; cancel paths set wall-clock and create paths leave it null. **polymarket:** Polymarket exposes no updated\_at on either OpenOrder or SendOrderResponse.                                                       |

## Source specs

* **kalshi** · [`schema/upstream/kalshi.openapi.yaml`](https://github.com/openpx-trade/openpx/blob/main/schema/upstream/kalshi.openapi.yaml)
* **polymarket** · [`schema/upstream/polymarket-clob.openapi.yaml`](https://github.com/openpx-trade/openpx/blob/main/schema/upstream/polymarket-clob.openapi.yaml)

> Tables are auto-generated from `schema/mappings/`. CI fails if any `direct` ref no longer resolves in the cached upstream spec; the daily upstream-refresh PR surfaces drift here.
