{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/0xinsider-com/json-schema/0xinsider-com-large-position-schema.json",
  "title": "LargePosition",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/0xinsider-com-large-positions-api-openapi.yml#/components/schemas/LargePosition",
  "type": "object",
  "required": [
    "id",
    "platform",
    "is_two_sided",
    "holdings",
    "share_count",
    "token_id",
    "event_leg_count",
    "first_seen_at",
    "last_updated_at",
    "trader",
    "market"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Composite prefixed ID `pos_<wallet>:<condition_id>:<outcome_index>`."
    },
    "platform": {
      "type": "string",
      "enum": [
        "polymarket"
      ],
      "description": "Provider discriminator. Always polymarket."
    },
    "total_size_usd": {
      "type": "number",
      "description": "Provider currentValue in USD for the outcome named by outcome_label / token_id, and for that outcome only. An absent key means the provider supplied no value for this leg, not a zero position. combined_value_usd carries the wallet's whole-market total."
    },
    "position_unrealized_pnl": {
      "type": "number",
      "description": "Provider unrealized mark-to-market P&L (Polymarket cashPnl) for that same one outcome. An absent key means unavailable, not break-even."
    },
    "combined_value_usd": {
      "type": "number",
      "description": "The wallet's currentValue across every outcome it holds in this market. Equals total_size_usd unless is_two_sided is true, and is the value the feed ranked this row by."
    },
    "combined_unrealized_pnl": {
      "type": "number",
      "description": "The wallet's unrealized P&L across every outcome it holds in this market. Equals position_unrealized_pnl unless is_two_sided is true."
    },
    "is_two_sided": {
      "type": "boolean",
      "description": "Whether the wallet holds shares on both outcomes of this market."
    },
    "holdings": {
      "type": "array",
      "description": "Every outcome the wallet holds, primary first. holdings[0] restates the top-level per-outcome fields; a further entry is a leg those fields do not describe. No amount here is a share-proportional slice of a both-sides total.",
      "items": {
        "type": "object",
        "required": [
          "outcome_index",
          "token_id",
          "share_count"
        ],
        "properties": {
          "outcome_index": {
            "type": "integer",
            "description": "0 = Yes, 1 = No."
          },
          "outcome_label": {
            "type": "string",
            "description": "The market's label for this outcome."
          },
          "token_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Polymarket CLOB token id for this outcome; null for an unsynced market."
          },
          "share_count": {
            "type": "number",
            "description": "Shares held on this outcome."
          },
          "avg_entry_price": {
            "type": "number",
            "description": "Provider average entry price for this outcome."
          },
          "current_price": {
            "type": "number",
            "description": "Provider mark price for this outcome."
          },
          "value_usd": {
            "type": "number",
            "description": "Provider currentValue for this outcome. An absent key means unavailable, not zero."
          },
          "unrealized_pnl": {
            "type": "number",
            "description": "Provider unrealized P&L for this outcome. An absent key means unavailable, not break-even."
          }
        }
      }
    },
    "share_count": {
      "type": "number",
      "description": "Live share count for this position."
    },
    "avg_entry_price": {
      "type": "number",
      "description": "Volume-weighted entry price."
    },
    "current_price": {
      "type": "number",
      "description": "Latest provider mark price for the position's token."
    },
    "outcome_label": {
      "type": "string",
      "description": "Backend-resolved outcome label (provider outcome, else Yes/No from the binary index)."
    },
    "token_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Polymarket CLOB token id (ERC1155 asset id, decimal string) for this outcome; null when unavailable (e.g. unsynced markets)."
    },
    "event_leg_count": {
      "type": "integer",
      "description": "Legs collapsed into this representative row for one (wallet, event, outcome side) group. 1 means standalone."
    },
    "event_total_value_usd": {
      "type": "number",
      "description": "Sum of the collapsed sibling legs' own holding values for this (wallet, event) group; equals total_size_usd when event_leg_count = 1, and omitted when any member's value is unknown."
    },
    "first_seen_at": {
      "type": "string",
      "format": "date-time"
    },
    "last_updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "trader": {
      "type": "object",
      "required": [
        "id",
        "address"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Prefixed ID (`trd_...`)."
        },
        "address": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "grade": {
          "type": "string",
          "enum": [
            "S",
            "A",
            "B",
            "C",
            "D",
            "F"
          ]
        },
        "win_rate": {
          "type": "number",
          "description": "Sports and esports win rate as a ratio from 0 to 1 (0.62 means 62%): wins over the decided sports and esports markets on the wallet's record, the same figure as pnl.in_scope.win_rate on GET /api/v1/trader/{address}. Since 2026-10-27 it no longer counts other markets (#29953). Absent when the wallet has no record or no decided market."
        },
        "pnl": {
          "type": "number",
          "deprecated": true,
          "x-never-sent": true,
          "description": "Deprecated since 2026-10-27 and never sent. It was Polymarket's net total P&L over every Polymarket market of the wallet, and wallet figures cover sports and esports markets only (#29953). Read trader.in_scope_realized_pnl."
        },
        "in_scope_realized_pnl": {
          "type": "number",
          "description": "The wallet's realized P&L in USD on sports and esports markets, the figure the 0xinsider profile shows: the record behind pnl.in_scope.realized_pnl on GET /api/v1/trader/{address}, to cents. Distinct from this position's position_unrealized_pnl. For a graded wallet it is read from the latest grading pass, so it can trail that figure until the next pass. Omitted until 0xinsider has computed the wallet's record (#29953)."
        },
        "markets_traded": {
          "type": "integer",
          "description": "Sports and esports markets on the wallet's record, pnl.in_scope.markets on GET /api/v1/trader/{address}. Since 2026-10-27 it no longer counts other markets (#29953). Absent when the wallet has no record."
        }
      }
    },
    "market": {
      "type": "object",
      "required": [
        "id",
        "condition_id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Prefixed ID (`mkt_...`)."
        },
        "condition_id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "event_slug": {
          "type": "string"
        },
        "category": {
          "type": "string"
        }
      }
    }
  }
}