Reference
Upstream to PolyLab Field Map
Field-by-field mapping from upstream Polymarket payloads into PolyLab storage, display, and derived fields.
Current Implementation
This page is intentionally explicit and implementation-first. If the product or upstream APIs change, the current behavior described here can change with them.
Market and event mapping
| Upstream source | Upstream field | PolyLab field | Notes |
|---|---|---|---|
| Gamma market | id | market_id | Stored on each outcome row |
| Gamma market | conditionId | condition_id | Used for holders lookup and grouping |
| Gamma market | question | question | Main display title |
| Gamma market | outcomes[i] | outcome_name | One stored row per outcome |
| Gamma market | outcomePrices[i] | price | Parsed to float where possible |
| Gamma market | spread | spread | Stored directly |
| Gamma market | volume | volume_usd | Stored directly |
| Gamma market | liquidity | liquidity_usd | Stored directly |
| Gamma market | startDate | start_date | Stored directly |
| Gamma market | endDate | end_date | Stored directly |
| Event payload | slug | event_slug | Preferred when event resolution succeeds |
| Event payload | icon or image | icon_url | Used in the UI |
| Event payload | tags[].label | market_tags.tag_label | Also drives primary category |
Derived fields
| PolyLab field | Computed from | Notes |
|---|---|---|
url | event_slug | Built as https://polymarket.com/event/{event_slug} |
category | first available tag label | Convenience primary label |
apr | price, end_date, snapshot_at | Annualized heuristic |
| implied odds | price | UI-only 1 / price transform |
yes_profitable_count | holders + wallet PnL | Count where outcome_index = 0 and total_pnl > 0 |
no_losing_count | holders + wallet PnL | Count where outcome_index = 1 and total_pnl < 0 |
Holder and wallet mapping
| Upstream source | Upstream field | PolyLab field | Notes |
|---|---|---|---|
| Holders API | proxyWallet | wallet_address / normalized address | Stored after normalization |
| Holders API | amount | position_size / normalized positionSize | Parsed to float |
| Holders API | outcomeIndex | outcome_index | YES / NO side |
| Holders API | name | alias | Optional alias |
| Wallet PnL API | latest list item p | wallets_stats.total_pnl | Last observed PnL point |
Important caveat
This map documents the current implementation. It does not claim that every upstream payload will always preserve the same field names or shape.