# Models

## Identifiers

Markets, outcomes, fills and traders are identified by keys, such as `marketId`, `outcomeId`, `fillId` and a trader's `id`. Keys are opaque strings: store and compare them, but don't parse them, since their format may change.

Anything a key identifies should also be available as its own field, such as `platform` on every event and `platformTraderId` on a trader. Use those fields rather than taking a key apart.

## Compatibility

New fields, and new values for existing fields, can appear without notice. To stay compatible:

- **Ignore fields you don't recognise.**
- **Ignore event types you don't recognise.** Don't treat an unknown `type` as an error.

## Types

Named types that event fields refer to.

<details id="platform">
<summary><code>Platform</code>: The venue.</summary>

Type: `"polymarket"` | `"kalshi"` | `"polymarket_us"` | `"pascal"` | `"hyperliquid"`

Used by [`fill.followed_trader`](https://predictparity.com/docs/api/stream#fill-followed-trader), [`alert.price_change`](https://predictparity.com/docs/api/stream#alert-price-change), [`market.resolved`](https://predictparity.com/docs/api/stream#market-resolved).

</details>

<details id="trader">
<summary><code>Trader</code>: A trader on a venue.</summary>

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The trader's key. |
| `platformTraderId` | string | The trader's id on the venue, e.g. a wallet address or a Kalshi nickname. |
| `displayName` | string \| `null` | The trader's display name on the venue, if they have one. |

Used by [`fill.followed_trader`](https://predictparity.com/docs/api/stream#fill-followed-trader).

</details>

Source: https://predictparity.com/docs/api/models
