> ## 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.

# Position mapping

> How each upstream exchange schema maps to OpenPX Position.

*An open position held by the caller.*

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     | 2      | 3         | 0       |
| polymarket | 5      | 0         | 0       |

## Field crosswalk

| Unified field   | Type            | kalshi source                | polymarket source   | Notes                                                                                                                                                 |
| --------------- | --------------- | ---------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `market_ticker` | string          | `MarketPosition.ticker`      | `Position.slug`     | **kalshi:** Kalshi market ticker; round-trips through `fetch_markets`. **polymarket:** Polymarket market slug; matches `Market.ticker`.               |
| `outcome`       | string          | *synthetic*                  | `Position.outcome`  | **kalshi:** Title-cased from the sign of `position_fp` (positive → `Yes`, negative → `No`). **polymarket:** Outcome label as published by Polymarket. |
| `size`          | number (double) | `MarketPosition.position_fp` | `Position.size`     | **kalshi:** Absolute value of the signed `position_fp` FixedPointCount string. **polymarket:** Non-negative size in contracts.                        |
| `average_price` | number (double) | *synthetic*                  | `Position.avgPrice` | **kalshi:** `total_traded_dollars / \|position_fp\|` — cost basis per contract. **polymarket:** Decimal probability in \[0, 1].                       |
| `current_price` | number (double) | *synthetic*                  | `Position.curPrice` | **kalshi:** `market_exposure_dollars / \|position_fp\|` — mark per contract. **polymarket:** Decimal probability in \[0, 1].                          |

## 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-data.openapi.yaml`](https://github.com/openpx-trade/openpx/blob/main/schema/upstream/polymarket-data.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.
