@structbuild/sdk 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,26 @@ export interface paths {
23
23
  patch?: never;
24
24
  trace?: never;
25
25
  };
26
+ "/polymarket/events/chart": {
27
+ parameters: {
28
+ query?: never;
29
+ header?: never;
30
+ path?: never;
31
+ cookie?: never;
32
+ };
33
+ /**
34
+ * Get event chart
35
+ * @description Retrieve price data over time for up to 4 markets with highest YES outcome (outcome_index 0) prices in an event. Perfect for rendering multi-line charts showing price movement across top markets.
36
+ */
37
+ get: operations["get_event_chart"];
38
+ put?: never;
39
+ post?: never;
40
+ delete?: never;
41
+ options?: never;
42
+ head?: never;
43
+ patch?: never;
44
+ trace?: never;
45
+ };
26
46
  "/polymarket/events/metrics": {
27
47
  parameters: {
28
48
  query?: never;
@@ -43,7 +63,7 @@ export interface paths {
43
63
  patch?: never;
44
64
  trace?: never;
45
65
  };
46
- "/polymarket/holders/markets/{condition_id}": {
66
+ "/polymarket/holders/markets": {
47
67
  parameters: {
48
68
  query?: never;
49
69
  header?: never;
@@ -52,7 +72,7 @@ export interface paths {
52
72
  };
53
73
  /**
54
74
  * Get market holders
55
- * @description Retrieve holders of a market grouped by outcome, sorted by shares held
75
+ * @description Retrieve holders of a market grouped by outcome, sorted by shares held. Identify the market with either `condition_id` or `market_slug` — exactly one must be provided. Each holder includes a nested `pnl` object with position-level PnL sourced from the position PnL table.
56
76
  */
57
77
  get: operations["get_market_holders"];
58
78
  put?: never;
@@ -63,7 +83,7 @@ export interface paths {
63
83
  patch?: never;
64
84
  trace?: never;
65
85
  };
66
- "/polymarket/holders/markets/{condition_id}/history": {
86
+ "/polymarket/holders/markets/history": {
67
87
  parameters: {
68
88
  query?: never;
69
89
  header?: never;
@@ -72,7 +92,7 @@ export interface paths {
72
92
  };
73
93
  /**
74
94
  * Get market holders history
75
- * @description Retrieve historical holder count snapshots for a market over a time range
95
+ * @description Retrieve historical holder count snapshots for a market over a time range. Identify the market with either `condition_id` or `market_slug` — exactly one must be provided.
76
96
  */
77
97
  get: operations["get_market_holders_history"];
78
98
  put?: never;
@@ -92,7 +112,7 @@ export interface paths {
92
112
  };
93
113
  /**
94
114
  * Get position holders
95
- * @description Retrieve holders of a specific position (ERC1155 token), sorted by shares held. Uses cursor-based pagination for efficient traversal.
115
+ * @description Retrieve holders of a specific position (ERC1155 token), sorted by shares held. Each holder includes a nested `pnl` object with position-level PnL (realized_pnl_usd, buy_usd, sell_usd, avg_entry_price, avg_exit_price, total_buys, total_sells, total_fees, first/last_trade_at) sourced from the position PnL table — no extra joins required at query time. Uses cursor-based pagination for efficient traversal.
96
116
  */
97
117
  get: operations["get_position_holders"];
98
118
  put?: never;
@@ -183,6 +203,26 @@ export interface paths {
183
203
  patch?: never;
184
204
  trace?: never;
185
205
  };
206
+ "/polymarket/market/chart": {
207
+ parameters: {
208
+ query?: never;
209
+ header?: never;
210
+ path?: never;
211
+ cookie?: never;
212
+ };
213
+ /**
214
+ * Get market chart
215
+ * @description Retrieve price data over time for up to 4 position outcomes in a market condition. Auto-selects the 4 most active outcomes if position_ids not specified.
216
+ */
217
+ get: operations["get_chart"];
218
+ put?: never;
219
+ post?: never;
220
+ delete?: never;
221
+ options?: never;
222
+ head?: never;
223
+ patch?: never;
224
+ trace?: never;
225
+ };
186
226
  "/polymarket/market/metrics": {
187
227
  parameters: {
188
228
  query?: never;
@@ -523,7 +563,7 @@ export interface paths {
523
563
  patch?: never;
524
564
  trace?: never;
525
565
  };
526
- "/polymarket/trader/portfolio/{address}": {
566
+ "/polymarket/trader/pnl/{address}/positions": {
527
567
  parameters: {
528
568
  query?: never;
529
569
  header?: never;
@@ -531,30 +571,10 @@ export interface paths {
531
571
  cookie?: never;
532
572
  };
533
573
  /**
534
- * Get trader portfolio
535
- * @description Retrieve a trader's portfolio overview including balances and active positions
574
+ * Get trader position PnL
575
+ * @description Retrieve per-outcome-token PnL for a trader. Only includes OrderFilled trades (no redemptions/merges). Each entry represents a specific position (outcome token) the trader has bought or sold.
536
576
  */
537
- get: operations["get_portfolio"];
538
- put?: never;
539
- post?: never;
540
- delete?: never;
541
- options?: never;
542
- head?: never;
543
- patch?: never;
544
- trace?: never;
545
- };
546
- "/polymarket/trader/positions/{address}": {
547
- parameters: {
548
- query?: never;
549
- header?: never;
550
- path?: never;
551
- cookie?: never;
552
- };
553
- /**
554
- * Get trader positions
555
- * @description Retrieve a trader's active positions with PnL data, sorted by the specified field
556
- */
557
- get: operations["get_portfolio_positions"];
577
+ get: operations["get_trader_position_pnl"];
558
578
  put?: never;
559
579
  post?: never;
560
580
  delete?: never;
@@ -592,7 +612,7 @@ export interface paths {
592
612
  };
593
613
  /**
594
614
  * Get multiple trader profiles
595
- * @description Retrieve profiles for multiple traders in a single request. Returns a map of address -> profile.
615
+ * @description Retrieve profiles for multiple traders in a single request. Returns an array of profiles.
596
616
  */
597
617
  get: operations["get_trader_profiles_batch"];
598
618
  put?: never;
@@ -670,9 +690,9 @@ export interface components {
670
690
  name: string;
671
691
  /** Format: int32 */
672
692
  index: number;
693
+ position_id: string;
673
694
  /** Format: double */
674
695
  price: number;
675
- position_id: string;
676
696
  };
677
697
  /** @enum {string} */
678
698
  CandlestickResolution: "1" | "5" | "15" | "30" | "60" | "240" | "D" | "1D";
@@ -755,6 +775,19 @@ export interface components {
755
775
  /** @default null */
756
776
  winning_outcome: null | components["schemas"]["EventMarketOutcome"];
757
777
  };
778
+ EventMarketChartDataPoint: {
779
+ /** Format: double */
780
+ value: number;
781
+ /** Format: int64 */
782
+ timestamp: number;
783
+ };
784
+ EventMarketChartOutcome: {
785
+ condition_id: string;
786
+ market_slug: string;
787
+ question: string;
788
+ title: string;
789
+ data: components["schemas"]["EventMarketChartDataPoint"][];
790
+ };
758
791
  /** @description Market outcome for event API responses */
759
792
  EventMarketOutcome: {
760
793
  name: string;
@@ -847,11 +880,7 @@ export interface components {
847
880
  shares_usd?: string | null;
848
881
  /** @description USD balance of wallet (USDe on Polygon) */
849
882
  usd_balance?: string | null;
850
- /**
851
- * Format: double
852
- * @description Lifetime realized PnL in USD
853
- */
854
- realized_pnl_usd?: number | null;
883
+ pnl?: null | components["schemas"]["PositionHolderPnl"];
855
884
  };
856
885
  /** @description Holder statistics data point (single time bucket) */
857
886
  HolderHistoryCandle: {
@@ -1109,11 +1138,6 @@ export interface components {
1109
1138
  * @default 0
1110
1139
  */
1111
1140
  sells: number;
1112
- /**
1113
- * Format: double
1114
- * @default 0
1115
- */
1116
- open_interest_change: number;
1117
1141
  /**
1118
1142
  * Format: double
1119
1143
  * @default null
@@ -1187,6 +1211,16 @@ export interface components {
1187
1211
  * @default 0
1188
1212
  */
1189
1213
  market_count: number;
1214
+ /**
1215
+ * Format: int64
1216
+ * @default null
1217
+ */
1218
+ created_time: number | null;
1219
+ /**
1220
+ * Format: int64
1221
+ * @default null
1222
+ */
1223
+ closed_time: number | null;
1190
1224
  /**
1191
1225
  * Format: int64
1192
1226
  * @default null
@@ -1220,16 +1254,6 @@ export interface components {
1220
1254
  markets: components["schemas"]["EventMarket"][];
1221
1255
  /** @default null */
1222
1256
  series: null | components["schemas"]["PolymarketSeries"];
1223
- /**
1224
- * Format: int64
1225
- * @default null
1226
- */
1227
- created_time: number | null;
1228
- /**
1229
- * Format: int64
1230
- * @default null
1231
- */
1232
- closed_time: number | null;
1233
1257
  };
1234
1258
  /**
1235
1259
  * @description A Polymarket series from the Gamma API
@@ -1305,22 +1329,41 @@ export interface components {
1305
1329
  is_mod: boolean;
1306
1330
  created_at?: string | null;
1307
1331
  };
1308
- /** @description PnL data for a holder (position-level) */
1309
- PositionHolderPnl: {
1332
+ PositionChartDataPoint: {
1310
1333
  /** Format: double */
1311
- realized_pnl_usd?: number | null;
1334
+ value: number;
1335
+ /** Format: int64 */
1336
+ timestamp: number;
1337
+ };
1338
+ PositionChartOutcome: {
1339
+ position_id: string;
1340
+ name: string;
1341
+ /** Format: int32 */
1342
+ outcome_index: number;
1343
+ data: components["schemas"]["PositionChartDataPoint"][];
1344
+ };
1345
+ /** @description Position-level PnL data for a holder (outcome token, OrderFilled trades only) */
1346
+ PositionHolderPnl: {
1312
1347
  /** Format: double */
1313
1348
  buy_usd?: number | null;
1314
1349
  /** Format: double */
1315
1350
  sell_usd?: number | null;
1316
- /** Format: double */
1317
- total_fees?: number | null;
1318
- /** Format: double */
1319
- net_shares?: number | null;
1351
+ /**
1352
+ * Format: double
1353
+ * @description Average price paid per share across all buys (0–1 range)
1354
+ */
1355
+ avg_entry_price?: number | null;
1356
+ /**
1357
+ * Format: double
1358
+ * @description Average price received per share across all sells (0–1 range)
1359
+ */
1360
+ avg_exit_price?: number | null;
1320
1361
  /** Format: int64 */
1321
- buy_count?: number | null;
1362
+ total_buys?: number | null;
1322
1363
  /** Format: int64 */
1323
- sell_count?: number | null;
1364
+ total_sells?: number | null;
1365
+ /** Format: double */
1366
+ total_fees?: number | null;
1324
1367
  /** Format: int64 */
1325
1368
  first_trade_at?: number | null;
1326
1369
  /** Format: int64 */
@@ -1382,6 +1425,8 @@ export interface components {
1382
1425
  /** Format: double */
1383
1426
  price_close: number;
1384
1427
  };
1428
+ /** @enum {string} */
1429
+ PositionPnlSortBy: "realized_pnl_usd" | "buy_usd" | "sell_usd" | "total_buys" | "total_sells" | "total_fees";
1385
1430
  PositionVolumeChartResponse: {
1386
1431
  volumes: components["schemas"]["PositionVolumeDataPoint"][];
1387
1432
  has_more: boolean;
@@ -1498,11 +1543,6 @@ export interface components {
1498
1543
  * @default 0
1499
1544
  */
1500
1545
  unique_traders: number;
1501
- /**
1502
- * Format: double
1503
- * @default 0
1504
- */
1505
- open_interest_change: number;
1506
1546
  };
1507
1547
  /** @enum {string} */
1508
1548
  SortDirection: "asc" | "desc";
@@ -1533,6 +1573,44 @@ export interface components {
1533
1573
  x_username?: string | null;
1534
1574
  verified_badge?: boolean;
1535
1575
  };
1576
+ /** @description Event-level PnL entry */
1577
+ TraderEventPnlEntry: {
1578
+ event_slug?: string | null;
1579
+ /** Format: int64 */
1580
+ markets_traded?: number | null;
1581
+ /** Format: int64 */
1582
+ outcomes_traded?: number | null;
1583
+ /** Format: int64 */
1584
+ total_buys?: number | null;
1585
+ /** Format: int64 */
1586
+ total_sells?: number | null;
1587
+ /** Format: int64 */
1588
+ total_redemptions?: number | null;
1589
+ /** Format: int64 */
1590
+ total_merges?: number | null;
1591
+ /** Format: double */
1592
+ total_volume_usd?: number | null;
1593
+ /** Format: double */
1594
+ buy_usd?: number | null;
1595
+ /** Format: double */
1596
+ sell_usd?: number | null;
1597
+ /** Format: double */
1598
+ redemption_usd?: number | null;
1599
+ /** Format: double */
1600
+ merge_usd?: number | null;
1601
+ /** Format: double */
1602
+ realized_pnl_usd?: number | null;
1603
+ /** Format: int64 */
1604
+ winning_markets?: number | null;
1605
+ /** Format: int64 */
1606
+ losing_markets?: number | null;
1607
+ /** Format: double */
1608
+ total_fees?: number | null;
1609
+ /** Format: int64 */
1610
+ first_trade_at?: number | null;
1611
+ /** Format: int64 */
1612
+ last_trade_at?: number | null;
1613
+ };
1536
1614
  /** @description Trader profile info - backwards compatibility */
1537
1615
  TraderInfo: {
1538
1616
  address: string;
@@ -1542,6 +1620,72 @@ export interface components {
1542
1620
  x_username?: string | null;
1543
1621
  verified_badge?: boolean;
1544
1622
  };
1623
+ /** @description Market-level PnL entry */
1624
+ TraderMarketPnlEntry: {
1625
+ condition_id?: string | null;
1626
+ event_slug?: string | null;
1627
+ /** Format: int64 */
1628
+ outcomes_traded?: number | null;
1629
+ /** Format: int64 */
1630
+ total_buys?: number | null;
1631
+ /** Format: int64 */
1632
+ total_sells?: number | null;
1633
+ /** Format: int64 */
1634
+ total_redemptions?: number | null;
1635
+ /** Format: int64 */
1636
+ total_merges?: number | null;
1637
+ /** Format: double */
1638
+ buy_usd?: number | null;
1639
+ /** Format: double */
1640
+ sell_usd?: number | null;
1641
+ /** Format: double */
1642
+ redemption_usd?: number | null;
1643
+ /** Format: double */
1644
+ merge_usd?: number | null;
1645
+ /** Format: double */
1646
+ realized_pnl_usd?: number | null;
1647
+ /** Format: int64 */
1648
+ winning_outcomes?: number | null;
1649
+ /** Format: double */
1650
+ total_fees?: number | null;
1651
+ /** Format: int64 */
1652
+ first_trade_at?: number | null;
1653
+ /** Format: int64 */
1654
+ last_trade_at?: number | null;
1655
+ };
1656
+ /** @description Outcome-level PnL entry (per outcome token / position_id, OrderFilled trades only) */
1657
+ TraderOutcomePnlEntry: {
1658
+ position_id?: string | null;
1659
+ condition_id?: string | null;
1660
+ event_slug?: string | null;
1661
+ outcome?: string | null;
1662
+ /** Format: int32 */
1663
+ outcome_index?: number | null;
1664
+ /** Format: int64 */
1665
+ total_buys?: number | null;
1666
+ /** Format: int64 */
1667
+ total_sells?: number | null;
1668
+ /** Format: double */
1669
+ buy_usd?: number | null;
1670
+ /** Format: double */
1671
+ sell_usd?: number | null;
1672
+ /**
1673
+ * Format: double
1674
+ * @description VWAP price paid per share across all buys (0–1)
1675
+ */
1676
+ avg_entry_price?: number | null;
1677
+ /**
1678
+ * Format: double
1679
+ * @description VWAP price received per share across all sells (0–1)
1680
+ */
1681
+ avg_exit_price?: number | null;
1682
+ /** Format: double */
1683
+ total_fees?: number | null;
1684
+ /** Format: int64 */
1685
+ first_trade_at?: number | null;
1686
+ /** Format: int64 */
1687
+ last_trade_at?: number | null;
1688
+ };
1545
1689
  TraderVolumeChartResponse: {
1546
1690
  volumes: components["schemas"]["TraderVolumeDataPoint"][];
1547
1691
  has_more: boolean;
@@ -1643,6 +1787,45 @@ export interface operations {
1643
1787
  };
1644
1788
  };
1645
1789
  };
1790
+ get_event_chart: {
1791
+ parameters: {
1792
+ query: {
1793
+ /** @description Event slug (required) */
1794
+ event_slug: string;
1795
+ /** @description Comma-separated condition IDs to include (max 4, optional) */
1796
+ condition_ids?: string;
1797
+ /** @description Comma-separated market slugs to include (max 4, optional). Use either condition_ids or market_slugs, not both */
1798
+ market_slugs?: string;
1799
+ /** @description Number of top markets to include if neither condition_ids nor market_slugs specified (max 4, default: 4) */
1800
+ limit?: number;
1801
+ /** @description Time interval: 1, 5, 15, 30, 60, 240, D, 1D (default: 60) */
1802
+ resolution?: components["schemas"]["CandlestickResolution"];
1803
+ /** @description Number of data points (max: 2500) */
1804
+ count_back?: number;
1805
+ /** @description Start timestamp (Unix seconds) */
1806
+ from?: number;
1807
+ /** @description End timestamp (Unix seconds) */
1808
+ to?: number;
1809
+ /** @description Cursor-based pagination key for fetching next page */
1810
+ pagination_key?: string;
1811
+ };
1812
+ header?: never;
1813
+ path?: never;
1814
+ cookie?: never;
1815
+ };
1816
+ requestBody?: never;
1817
+ responses: {
1818
+ /** @description Price data over time for up to 4 markets with highest YES odds */
1819
+ 200: {
1820
+ headers: {
1821
+ [name: string]: unknown;
1822
+ };
1823
+ content: {
1824
+ "application/json": components["schemas"]["EventMarketChartOutcome"][];
1825
+ };
1826
+ };
1827
+ };
1828
+ };
1646
1829
  get_event_metrics: {
1647
1830
  parameters: {
1648
1831
  query: {
@@ -1685,25 +1868,24 @@ export interface operations {
1685
1868
  get_market_holders: {
1686
1869
  parameters: {
1687
1870
  query?: {
1871
+ /** @description Market condition ID (0x-prefixed hex) */
1872
+ condition_id?: string;
1873
+ /** @description Market slug (e.g. `will-trump-win`) */
1874
+ market_slug?: string;
1688
1875
  /** @description Results limit (default: 10, max: 100) */
1689
1876
  limit?: number;
1690
1877
  /** @description Minimum shares held (decimal string) */
1691
1878
  min_shares?: string;
1692
1879
  /** @description Maximum shares held (decimal string) */
1693
1880
  max_shares?: string;
1694
- /** @description PnL timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
1695
- timeframe?: components["schemas"]["PnlTimeframe"];
1696
1881
  };
1697
1882
  header?: never;
1698
- path: {
1699
- /** @description Market condition ID */
1700
- condition_id: string;
1701
- };
1883
+ path?: never;
1702
1884
  cookie?: never;
1703
1885
  };
1704
1886
  requestBody?: never;
1705
1887
  responses: {
1706
- /** @description Market holders grouped by outcome (sorted by shares DESC) */
1888
+ /** @description Market holders grouped by outcome (sorted by shares DESC). Each holder has `pnl: PositionHolderPnl` with outcome-specific trading stats. */
1707
1889
  200: {
1708
1890
  headers: {
1709
1891
  [name: string]: unknown;
@@ -1724,14 +1906,15 @@ export interface operations {
1724
1906
  get_market_holders_history: {
1725
1907
  parameters: {
1726
1908
  query?: {
1909
+ /** @description Market condition ID (0x-prefixed hex) */
1910
+ condition_id?: string;
1911
+ /** @description Market slug (e.g. `will-trump-win`) */
1912
+ market_slug?: string;
1727
1913
  /** @description Time range in hours (default: 24, max: 336 = 14 days) */
1728
1914
  hours?: number;
1729
1915
  };
1730
1916
  header?: never;
1731
- path: {
1732
- /** @description Market condition ID */
1733
- condition_id: string;
1734
- };
1917
+ path?: never;
1735
1918
  cookie?: never;
1736
1919
  };
1737
1920
  requestBody?: never;
@@ -1775,7 +1958,7 @@ export interface operations {
1775
1958
  };
1776
1959
  requestBody?: never;
1777
1960
  responses: {
1778
- /** @description Position holders (sorted by shares DESC). Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination. */
1961
+ /** @description Position holders (sorted by shares DESC). Each holder has `pnl: PositionHolderPnl` with outcome-specific trading stats. Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination. */
1779
1962
  200: {
1780
1963
  headers: {
1781
1964
  [name: string]: unknown;
@@ -1976,6 +2159,43 @@ export interface operations {
1976
2159
  };
1977
2160
  };
1978
2161
  };
2162
+ get_chart: {
2163
+ parameters: {
2164
+ query?: {
2165
+ /** @description Market condition ID or market_slug (one required) */
2166
+ condition_id?: string;
2167
+ /** @description Market slug (alternative to condition_id) */
2168
+ market_slug?: string;
2169
+ /** @description Comma-separated list of position IDs (max 4, optional). Auto-selected if not provided */
2170
+ position_ids?: string;
2171
+ /** @description Time interval: 1, 5, 15, 30, 60, 240, D, 1D (default: 60) */
2172
+ resolution?: components["schemas"]["CandlestickResolution"];
2173
+ /** @description Number of data points (max: 2500) */
2174
+ count_back?: number;
2175
+ /** @description Start timestamp (Unix seconds) */
2176
+ from?: number;
2177
+ /** @description End timestamp (Unix seconds) */
2178
+ to?: number;
2179
+ /** @description Cursor-based pagination key for fetching next page */
2180
+ pagination_key?: string;
2181
+ };
2182
+ header?: never;
2183
+ path?: never;
2184
+ cookie?: never;
2185
+ };
2186
+ requestBody?: never;
2187
+ responses: {
2188
+ /** @description Price data over time for up to 4 market outcomes */
2189
+ 200: {
2190
+ headers: {
2191
+ [name: string]: unknown;
2192
+ };
2193
+ content: {
2194
+ "application/json": components["schemas"]["PositionChartOutcome"][];
2195
+ };
2196
+ };
2197
+ };
2198
+ };
1979
2199
  get_market_metrics: {
1980
2200
  parameters: {
1981
2201
  query: {
@@ -2111,7 +2331,7 @@ export interface operations {
2111
2331
  [name: string]: unknown;
2112
2332
  };
2113
2333
  content: {
2114
- "application/json": components["schemas"]["PositionVolumeChartResponse"];
2334
+ "application/json": components["schemas"]["PositionVolumeDataPoint"][];
2115
2335
  };
2116
2336
  };
2117
2337
  };
@@ -2179,9 +2399,11 @@ export interface operations {
2179
2399
  };
2180
2400
  get_market_volume_chart: {
2181
2401
  parameters: {
2182
- query: {
2183
- /** @description Market condition ID (required) */
2184
- condition_id: string;
2402
+ query?: {
2403
+ /** @description Market condition ID (or use market_slug) */
2404
+ condition_id?: string;
2405
+ /** @description Market slug (alternative to condition_id) */
2406
+ market_slug?: string;
2185
2407
  /** @description Time interval: 1, 5, 15, 30, 60, 240, D, 1D (default: 60) */
2186
2408
  resolution?: components["schemas"]["CandlestickResolution"];
2187
2409
  /** @description Number of data points (max: 2500) */
@@ -2203,7 +2425,7 @@ export interface operations {
2203
2425
  [name: string]: unknown;
2204
2426
  };
2205
2427
  content: {
2206
- "application/json": components["schemas"]["MarketVolumeChartResponse"];
2428
+ "application/json": components["schemas"]["MarketVolumeDataPoint"][];
2207
2429
  };
2208
2430
  };
2209
2431
  };
@@ -2495,8 +2717,8 @@ export interface operations {
2495
2717
  sort_direction?: components["schemas"]["SortDirection"];
2496
2718
  /** @description Results limit (default: 10, max: 200) */
2497
2719
  limit?: number;
2498
- /** @description Offset-based pagination key */
2499
- pagination_key?: number;
2720
+ /** @description Cursor-based pagination key (base64-encoded, from previous response) */
2721
+ pagination_key?: string;
2500
2722
  /** @description Filter by event slug */
2501
2723
  event_slug?: string;
2502
2724
  };
@@ -2509,12 +2731,14 @@ export interface operations {
2509
2731
  };
2510
2732
  requestBody?: never;
2511
2733
  responses: {
2512
- /** @description Event-level PnL entries for this trader. Response includes `pagination: { has_more, pagination_key }` for offset-based pagination. */
2734
+ /** @description Event-level PnL entries for this trader */
2513
2735
  200: {
2514
2736
  headers: {
2515
2737
  [name: string]: unknown;
2516
2738
  };
2517
- content?: never;
2739
+ content: {
2740
+ "application/json": components["schemas"]["TraderEventPnlEntry"][];
2741
+ };
2518
2742
  };
2519
2743
  };
2520
2744
  };
@@ -2529,10 +2753,12 @@ export interface operations {
2529
2753
  sort_direction?: components["schemas"]["SortDirection"];
2530
2754
  /** @description Results limit (default: 10, max: 200) */
2531
2755
  limit?: number;
2532
- /** @description Offset-based pagination key */
2533
- pagination_key?: number;
2534
- /** @description Filter by condition ID */
2756
+ /** @description Cursor-based pagination key (base64-encoded, from previous response) */
2757
+ pagination_key?: string;
2758
+ /** @description Filter by condition ID (or use market_slug) */
2535
2759
  condition_id?: string;
2760
+ /** @description Filter by market slug (alternative to condition_id) */
2761
+ market_slug?: string;
2536
2762
  /** @description Filter by event slug */
2537
2763
  event_slug?: string;
2538
2764
  };
@@ -2545,54 +2771,36 @@ export interface operations {
2545
2771
  };
2546
2772
  requestBody?: never;
2547
2773
  responses: {
2548
- /** @description Market-level PnL entries for this trader. Response includes `pagination: { has_more, pagination_key }` for offset-based pagination. */
2774
+ /** @description Market-level PnL entries for this trader */
2549
2775
  200: {
2550
2776
  headers: {
2551
2777
  [name: string]: unknown;
2552
2778
  };
2553
- content?: never;
2554
- };
2555
- };
2556
- };
2557
- get_portfolio: {
2558
- parameters: {
2559
- query?: {
2560
- /** @description Stats timeframe: 7d, 30d, lifetime */
2561
- timeframe?: components["schemas"]["PnlTimeframe"];
2562
- };
2563
- header?: never;
2564
- path: {
2565
- /** @description Trader wallet address */
2566
- address: string;
2567
- };
2568
- cookie?: never;
2569
- };
2570
- requestBody?: never;
2571
- responses: {
2572
- /** @description Full portfolio with stats, positions, and PnL chart. Positions include `pagination: { has_more, pagination_key }` for offset-based pagination. */
2573
- 200: {
2574
- headers: {
2575
- [name: string]: unknown;
2779
+ content: {
2780
+ "application/json": components["schemas"]["TraderMarketPnlEntry"][];
2576
2781
  };
2577
- content?: never;
2578
2782
  };
2579
2783
  };
2580
2784
  };
2581
- get_portfolio_positions: {
2785
+ get_trader_position_pnl: {
2582
2786
  parameters: {
2583
2787
  query?: {
2584
- /** @description Sort field: shares_usd (default), shares, realized_pnl_usd, price, buy_usd */
2585
- sort_by?: string;
2788
+ /** @description Timeframe: 1d, 7d, 30d, lifetime (default: 7d) */
2789
+ timeframe?: components["schemas"]["PnlTimeframe"];
2790
+ /** @description Sort: realized_pnl_usd, buy_usd, sell_usd, total_buys, total_sells, total_fees (default: realized_pnl_usd) */
2791
+ sort_by?: components["schemas"]["PositionPnlSortBy"];
2586
2792
  /** @description Sort direction: asc, desc (default: desc) */
2587
2793
  sort_direction?: components["schemas"]["SortDirection"];
2588
- /** @description Filter by condition ID */
2589
- condition_id?: string;
2590
- /** @description Filter by event slug */
2591
- event_slug?: string;
2592
- /** @description Results limit (default: 50, max: 200) */
2794
+ /** @description Results limit (default: 10, max: 200) */
2593
2795
  limit?: number;
2594
- /** @description Offset-based pagination key (integer offset into result set) */
2595
- pagination_key?: number;
2796
+ /** @description Cursor-based pagination key (base64-encoded, from previous response) */
2797
+ pagination_key?: string;
2798
+ /** @description Filter by market condition ID (or use market_slug) */
2799
+ condition_id?: string;
2800
+ /** @description Filter by market slug (alternative to condition_id) */
2801
+ market_slug?: string;
2802
+ /** @description Filter by specific outcome token (position ID) */
2803
+ position_id?: string;
2596
2804
  };
2597
2805
  header?: never;
2598
2806
  path: {
@@ -2603,12 +2811,14 @@ export interface operations {
2603
2811
  };
2604
2812
  requestBody?: never;
2605
2813
  responses: {
2606
- /** @description Trader positions with market metadata and PnL. Response includes `pagination: { has_more, pagination_key }` for offset-based pagination. */
2814
+ /** @description Position-level PnL entries for this trader. Each entry is a specific outcome token with avg_entry_price and avg_exit_price. */
2607
2815
  200: {
2608
2816
  headers: {
2609
2817
  [name: string]: unknown;
2610
2818
  };
2611
- content?: never;
2819
+ content: {
2820
+ "application/json": components["schemas"]["TraderOutcomePnlEntry"][];
2821
+ };
2612
2822
  };
2613
2823
  };
2614
2824
  };
@@ -2654,7 +2864,7 @@ export interface operations {
2654
2864
  };
2655
2865
  requestBody?: never;
2656
2866
  responses: {
2657
- /** @description Map of trader addresses to their profile information */
2867
+ /** @description Array of trader profiles */
2658
2868
  200: {
2659
2869
  headers: {
2660
2870
  [name: string]: unknown;
@@ -2761,7 +2971,7 @@ export interface operations {
2761
2971
  [name: string]: unknown;
2762
2972
  };
2763
2973
  content: {
2764
- "application/json": components["schemas"]["TraderVolumeChartResponse"];
2974
+ "application/json": components["schemas"]["TraderVolumeDataPoint"][];
2765
2975
  };
2766
2976
  };
2767
2977
  };