@structbuild/sdk 0.1.10 → 0.1.11

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,18 @@ 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
+ name: string;
788
+ data: components["schemas"]["EventMarketChartDataPoint"][];
789
+ };
758
790
  /** @description Market outcome for event API responses */
759
791
  EventMarketOutcome: {
760
792
  name: string;
@@ -847,11 +879,7 @@ export interface components {
847
879
  shares_usd?: string | null;
848
880
  /** @description USD balance of wallet (USDe on Polygon) */
849
881
  usd_balance?: string | null;
850
- /**
851
- * Format: double
852
- * @description Lifetime realized PnL in USD
853
- */
854
- realized_pnl_usd?: number | null;
882
+ pnl?: null | components["schemas"]["PositionHolderPnl"];
855
883
  };
856
884
  /** @description Holder statistics data point (single time bucket) */
857
885
  HolderHistoryCandle: {
@@ -1109,11 +1137,6 @@ export interface components {
1109
1137
  * @default 0
1110
1138
  */
1111
1139
  sells: number;
1112
- /**
1113
- * Format: double
1114
- * @default 0
1115
- */
1116
- open_interest_change: number;
1117
1140
  /**
1118
1141
  * Format: double
1119
1142
  * @default null
@@ -1187,6 +1210,16 @@ export interface components {
1187
1210
  * @default 0
1188
1211
  */
1189
1212
  market_count: number;
1213
+ /**
1214
+ * Format: int64
1215
+ * @default null
1216
+ */
1217
+ created_time: number | null;
1218
+ /**
1219
+ * Format: int64
1220
+ * @default null
1221
+ */
1222
+ closed_time: number | null;
1190
1223
  /**
1191
1224
  * Format: int64
1192
1225
  * @default null
@@ -1220,16 +1253,6 @@ export interface components {
1220
1253
  markets: components["schemas"]["EventMarket"][];
1221
1254
  /** @default null */
1222
1255
  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
1256
  };
1234
1257
  /**
1235
1258
  * @description A Polymarket series from the Gamma API
@@ -1305,22 +1328,41 @@ export interface components {
1305
1328
  is_mod: boolean;
1306
1329
  created_at?: string | null;
1307
1330
  };
1308
- /** @description PnL data for a holder (position-level) */
1309
- PositionHolderPnl: {
1331
+ PositionChartDataPoint: {
1310
1332
  /** Format: double */
1311
- realized_pnl_usd?: number | null;
1333
+ value: number;
1334
+ /** Format: int64 */
1335
+ timestamp: number;
1336
+ };
1337
+ PositionChartOutcome: {
1338
+ position_id: string;
1339
+ name: string;
1340
+ /** Format: int32 */
1341
+ outcome_index: number;
1342
+ data: components["schemas"]["PositionChartDataPoint"][];
1343
+ };
1344
+ /** @description Position-level PnL data for a holder (outcome token, OrderFilled trades only) */
1345
+ PositionHolderPnl: {
1312
1346
  /** Format: double */
1313
1347
  buy_usd?: number | null;
1314
1348
  /** Format: double */
1315
1349
  sell_usd?: number | null;
1316
- /** Format: double */
1317
- total_fees?: number | null;
1318
- /** Format: double */
1319
- net_shares?: number | null;
1350
+ /**
1351
+ * Format: double
1352
+ * @description Average price paid per share across all buys (0–1 range)
1353
+ */
1354
+ avg_entry_price?: number | null;
1355
+ /**
1356
+ * Format: double
1357
+ * @description Average price received per share across all sells (0–1 range)
1358
+ */
1359
+ avg_exit_price?: number | null;
1320
1360
  /** Format: int64 */
1321
- buy_count?: number | null;
1361
+ total_buys?: number | null;
1322
1362
  /** Format: int64 */
1323
- sell_count?: number | null;
1363
+ total_sells?: number | null;
1364
+ /** Format: double */
1365
+ total_fees?: number | null;
1324
1366
  /** Format: int64 */
1325
1367
  first_trade_at?: number | null;
1326
1368
  /** Format: int64 */
@@ -1382,6 +1424,8 @@ export interface components {
1382
1424
  /** Format: double */
1383
1425
  price_close: number;
1384
1426
  };
1427
+ /** @enum {string} */
1428
+ PositionPnlSortBy: "realized_pnl_usd" | "buy_usd" | "sell_usd" | "total_buys" | "total_sells" | "total_fees";
1385
1429
  PositionVolumeChartResponse: {
1386
1430
  volumes: components["schemas"]["PositionVolumeDataPoint"][];
1387
1431
  has_more: boolean;
@@ -1498,11 +1542,6 @@ export interface components {
1498
1542
  * @default 0
1499
1543
  */
1500
1544
  unique_traders: number;
1501
- /**
1502
- * Format: double
1503
- * @default 0
1504
- */
1505
- open_interest_change: number;
1506
1545
  };
1507
1546
  /** @enum {string} */
1508
1547
  SortDirection: "asc" | "desc";
@@ -1533,6 +1572,44 @@ export interface components {
1533
1572
  x_username?: string | null;
1534
1573
  verified_badge?: boolean;
1535
1574
  };
1575
+ /** @description Event-level PnL entry */
1576
+ TraderEventPnlEntry: {
1577
+ event_slug?: string | null;
1578
+ /** Format: int64 */
1579
+ markets_traded?: number | null;
1580
+ /** Format: int64 */
1581
+ outcomes_traded?: number | null;
1582
+ /** Format: int64 */
1583
+ total_buys?: number | null;
1584
+ /** Format: int64 */
1585
+ total_sells?: number | null;
1586
+ /** Format: int64 */
1587
+ total_redemptions?: number | null;
1588
+ /** Format: int64 */
1589
+ total_merges?: number | null;
1590
+ /** Format: double */
1591
+ total_volume_usd?: number | null;
1592
+ /** Format: double */
1593
+ buy_usd?: number | null;
1594
+ /** Format: double */
1595
+ sell_usd?: number | null;
1596
+ /** Format: double */
1597
+ redemption_usd?: number | null;
1598
+ /** Format: double */
1599
+ merge_usd?: number | null;
1600
+ /** Format: double */
1601
+ realized_pnl_usd?: number | null;
1602
+ /** Format: int64 */
1603
+ winning_markets?: number | null;
1604
+ /** Format: int64 */
1605
+ losing_markets?: number | null;
1606
+ /** Format: double */
1607
+ total_fees?: number | null;
1608
+ /** Format: int64 */
1609
+ first_trade_at?: number | null;
1610
+ /** Format: int64 */
1611
+ last_trade_at?: number | null;
1612
+ };
1536
1613
  /** @description Trader profile info - backwards compatibility */
1537
1614
  TraderInfo: {
1538
1615
  address: string;
@@ -1542,6 +1619,72 @@ export interface components {
1542
1619
  x_username?: string | null;
1543
1620
  verified_badge?: boolean;
1544
1621
  };
1622
+ /** @description Market-level PnL entry */
1623
+ TraderMarketPnlEntry: {
1624
+ condition_id?: string | null;
1625
+ event_slug?: string | null;
1626
+ /** Format: int64 */
1627
+ outcomes_traded?: number | null;
1628
+ /** Format: int64 */
1629
+ total_buys?: number | null;
1630
+ /** Format: int64 */
1631
+ total_sells?: number | null;
1632
+ /** Format: int64 */
1633
+ total_redemptions?: number | null;
1634
+ /** Format: int64 */
1635
+ total_merges?: number | null;
1636
+ /** Format: double */
1637
+ buy_usd?: number | null;
1638
+ /** Format: double */
1639
+ sell_usd?: number | null;
1640
+ /** Format: double */
1641
+ redemption_usd?: number | null;
1642
+ /** Format: double */
1643
+ merge_usd?: number | null;
1644
+ /** Format: double */
1645
+ realized_pnl_usd?: number | null;
1646
+ /** Format: int64 */
1647
+ winning_outcomes?: number | null;
1648
+ /** Format: double */
1649
+ total_fees?: number | null;
1650
+ /** Format: int64 */
1651
+ first_trade_at?: number | null;
1652
+ /** Format: int64 */
1653
+ last_trade_at?: number | null;
1654
+ };
1655
+ /** @description Outcome-level PnL entry (per outcome token / position_id, OrderFilled trades only) */
1656
+ TraderOutcomePnlEntry: {
1657
+ position_id?: string | null;
1658
+ condition_id?: string | null;
1659
+ event_slug?: string | null;
1660
+ outcome?: string | null;
1661
+ /** Format: int32 */
1662
+ outcome_index?: number | null;
1663
+ /** Format: int64 */
1664
+ total_buys?: number | null;
1665
+ /** Format: int64 */
1666
+ total_sells?: number | null;
1667
+ /** Format: double */
1668
+ buy_usd?: number | null;
1669
+ /** Format: double */
1670
+ sell_usd?: number | null;
1671
+ /**
1672
+ * Format: double
1673
+ * @description VWAP price paid per share across all buys (0–1)
1674
+ */
1675
+ avg_entry_price?: number | null;
1676
+ /**
1677
+ * Format: double
1678
+ * @description VWAP price received per share across all sells (0–1)
1679
+ */
1680
+ avg_exit_price?: number | null;
1681
+ /** Format: double */
1682
+ total_fees?: number | null;
1683
+ /** Format: int64 */
1684
+ first_trade_at?: number | null;
1685
+ /** Format: int64 */
1686
+ last_trade_at?: number | null;
1687
+ };
1545
1688
  TraderVolumeChartResponse: {
1546
1689
  volumes: components["schemas"]["TraderVolumeDataPoint"][];
1547
1690
  has_more: boolean;
@@ -1643,6 +1786,45 @@ export interface operations {
1643
1786
  };
1644
1787
  };
1645
1788
  };
1789
+ get_event_chart: {
1790
+ parameters: {
1791
+ query: {
1792
+ /** @description Event slug (required) */
1793
+ event_slug: string;
1794
+ /** @description Comma-separated condition IDs to include (max 4, optional) */
1795
+ condition_ids?: string;
1796
+ /** @description Comma-separated market slugs to include (max 4, optional). Use either condition_ids or market_slugs, not both */
1797
+ market_slugs?: string;
1798
+ /** @description Number of top markets to include if neither condition_ids nor market_slugs specified (max 4, default: 4) */
1799
+ limit?: number;
1800
+ /** @description Time interval: 1, 5, 15, 30, 60, 240, D, 1D (default: 60) */
1801
+ resolution?: components["schemas"]["CandlestickResolution"];
1802
+ /** @description Number of data points (max: 2500) */
1803
+ count_back?: number;
1804
+ /** @description Start timestamp (Unix seconds) */
1805
+ from?: number;
1806
+ /** @description End timestamp (Unix seconds) */
1807
+ to?: number;
1808
+ /** @description Cursor-based pagination key for fetching next page */
1809
+ pagination_key?: string;
1810
+ };
1811
+ header?: never;
1812
+ path?: never;
1813
+ cookie?: never;
1814
+ };
1815
+ requestBody?: never;
1816
+ responses: {
1817
+ /** @description Price data over time for up to 4 markets with highest YES odds */
1818
+ 200: {
1819
+ headers: {
1820
+ [name: string]: unknown;
1821
+ };
1822
+ content: {
1823
+ "application/json": components["schemas"]["EventMarketChartOutcome"][];
1824
+ };
1825
+ };
1826
+ };
1827
+ };
1646
1828
  get_event_metrics: {
1647
1829
  parameters: {
1648
1830
  query: {
@@ -1685,25 +1867,24 @@ export interface operations {
1685
1867
  get_market_holders: {
1686
1868
  parameters: {
1687
1869
  query?: {
1870
+ /** @description Market condition ID (0x-prefixed hex) */
1871
+ condition_id?: string;
1872
+ /** @description Market slug (e.g. `will-trump-win`) */
1873
+ market_slug?: string;
1688
1874
  /** @description Results limit (default: 10, max: 100) */
1689
1875
  limit?: number;
1690
1876
  /** @description Minimum shares held (decimal string) */
1691
1877
  min_shares?: string;
1692
1878
  /** @description Maximum shares held (decimal string) */
1693
1879
  max_shares?: string;
1694
- /** @description PnL timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
1695
- timeframe?: components["schemas"]["PnlTimeframe"];
1696
1880
  };
1697
1881
  header?: never;
1698
- path: {
1699
- /** @description Market condition ID */
1700
- condition_id: string;
1701
- };
1882
+ path?: never;
1702
1883
  cookie?: never;
1703
1884
  };
1704
1885
  requestBody?: never;
1705
1886
  responses: {
1706
- /** @description Market holders grouped by outcome (sorted by shares DESC) */
1887
+ /** @description Market holders grouped by outcome (sorted by shares DESC). Each holder has `pnl: PositionHolderPnl` with outcome-specific trading stats. */
1707
1888
  200: {
1708
1889
  headers: {
1709
1890
  [name: string]: unknown;
@@ -1724,14 +1905,15 @@ export interface operations {
1724
1905
  get_market_holders_history: {
1725
1906
  parameters: {
1726
1907
  query?: {
1908
+ /** @description Market condition ID (0x-prefixed hex) */
1909
+ condition_id?: string;
1910
+ /** @description Market slug (e.g. `will-trump-win`) */
1911
+ market_slug?: string;
1727
1912
  /** @description Time range in hours (default: 24, max: 336 = 14 days) */
1728
1913
  hours?: number;
1729
1914
  };
1730
1915
  header?: never;
1731
- path: {
1732
- /** @description Market condition ID */
1733
- condition_id: string;
1734
- };
1916
+ path?: never;
1735
1917
  cookie?: never;
1736
1918
  };
1737
1919
  requestBody?: never;
@@ -1775,7 +1957,7 @@ export interface operations {
1775
1957
  };
1776
1958
  requestBody?: never;
1777
1959
  responses: {
1778
- /** @description Position holders (sorted by shares DESC). Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination. */
1960
+ /** @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
1961
  200: {
1780
1962
  headers: {
1781
1963
  [name: string]: unknown;
@@ -1976,6 +2158,43 @@ export interface operations {
1976
2158
  };
1977
2159
  };
1978
2160
  };
2161
+ get_chart: {
2162
+ parameters: {
2163
+ query?: {
2164
+ /** @description Market condition ID or market_slug (one required) */
2165
+ condition_id?: string;
2166
+ /** @description Market slug (alternative to condition_id) */
2167
+ market_slug?: string;
2168
+ /** @description Comma-separated list of position IDs (max 4, optional). Auto-selected if not provided */
2169
+ position_ids?: string;
2170
+ /** @description Time interval: 1, 5, 15, 30, 60, 240, D, 1D (default: 60) */
2171
+ resolution?: components["schemas"]["CandlestickResolution"];
2172
+ /** @description Number of data points (max: 2500) */
2173
+ count_back?: number;
2174
+ /** @description Start timestamp (Unix seconds) */
2175
+ from?: number;
2176
+ /** @description End timestamp (Unix seconds) */
2177
+ to?: number;
2178
+ /** @description Cursor-based pagination key for fetching next page */
2179
+ pagination_key?: string;
2180
+ };
2181
+ header?: never;
2182
+ path?: never;
2183
+ cookie?: never;
2184
+ };
2185
+ requestBody?: never;
2186
+ responses: {
2187
+ /** @description Price data over time for up to 4 market outcomes */
2188
+ 200: {
2189
+ headers: {
2190
+ [name: string]: unknown;
2191
+ };
2192
+ content: {
2193
+ "application/json": components["schemas"]["PositionChartOutcome"][];
2194
+ };
2195
+ };
2196
+ };
2197
+ };
1979
2198
  get_market_metrics: {
1980
2199
  parameters: {
1981
2200
  query: {
@@ -2111,7 +2330,7 @@ export interface operations {
2111
2330
  [name: string]: unknown;
2112
2331
  };
2113
2332
  content: {
2114
- "application/json": components["schemas"]["PositionVolumeChartResponse"];
2333
+ "application/json": components["schemas"]["PositionVolumeDataPoint"][];
2115
2334
  };
2116
2335
  };
2117
2336
  };
@@ -2179,9 +2398,11 @@ export interface operations {
2179
2398
  };
2180
2399
  get_market_volume_chart: {
2181
2400
  parameters: {
2182
- query: {
2183
- /** @description Market condition ID (required) */
2184
- condition_id: string;
2401
+ query?: {
2402
+ /** @description Market condition ID (or use market_slug) */
2403
+ condition_id?: string;
2404
+ /** @description Market slug (alternative to condition_id) */
2405
+ market_slug?: string;
2185
2406
  /** @description Time interval: 1, 5, 15, 30, 60, 240, D, 1D (default: 60) */
2186
2407
  resolution?: components["schemas"]["CandlestickResolution"];
2187
2408
  /** @description Number of data points (max: 2500) */
@@ -2203,7 +2424,7 @@ export interface operations {
2203
2424
  [name: string]: unknown;
2204
2425
  };
2205
2426
  content: {
2206
- "application/json": components["schemas"]["MarketVolumeChartResponse"];
2427
+ "application/json": components["schemas"]["MarketVolumeDataPoint"][];
2207
2428
  };
2208
2429
  };
2209
2430
  };
@@ -2495,8 +2716,8 @@ export interface operations {
2495
2716
  sort_direction?: components["schemas"]["SortDirection"];
2496
2717
  /** @description Results limit (default: 10, max: 200) */
2497
2718
  limit?: number;
2498
- /** @description Offset-based pagination key */
2499
- pagination_key?: number;
2719
+ /** @description Cursor-based pagination key (base64-encoded, from previous response) */
2720
+ pagination_key?: string;
2500
2721
  /** @description Filter by event slug */
2501
2722
  event_slug?: string;
2502
2723
  };
@@ -2509,12 +2730,14 @@ export interface operations {
2509
2730
  };
2510
2731
  requestBody?: never;
2511
2732
  responses: {
2512
- /** @description Event-level PnL entries for this trader. Response includes `pagination: { has_more, pagination_key }` for offset-based pagination. */
2733
+ /** @description Event-level PnL entries for this trader */
2513
2734
  200: {
2514
2735
  headers: {
2515
2736
  [name: string]: unknown;
2516
2737
  };
2517
- content?: never;
2738
+ content: {
2739
+ "application/json": components["schemas"]["TraderEventPnlEntry"][];
2740
+ };
2518
2741
  };
2519
2742
  };
2520
2743
  };
@@ -2529,10 +2752,12 @@ export interface operations {
2529
2752
  sort_direction?: components["schemas"]["SortDirection"];
2530
2753
  /** @description Results limit (default: 10, max: 200) */
2531
2754
  limit?: number;
2532
- /** @description Offset-based pagination key */
2533
- pagination_key?: number;
2534
- /** @description Filter by condition ID */
2755
+ /** @description Cursor-based pagination key (base64-encoded, from previous response) */
2756
+ pagination_key?: string;
2757
+ /** @description Filter by condition ID (or use market_slug) */
2535
2758
  condition_id?: string;
2759
+ /** @description Filter by market slug (alternative to condition_id) */
2760
+ market_slug?: string;
2536
2761
  /** @description Filter by event slug */
2537
2762
  event_slug?: string;
2538
2763
  };
@@ -2545,54 +2770,36 @@ export interface operations {
2545
2770
  };
2546
2771
  requestBody?: never;
2547
2772
  responses: {
2548
- /** @description Market-level PnL entries for this trader. Response includes `pagination: { has_more, pagination_key }` for offset-based pagination. */
2773
+ /** @description Market-level PnL entries for this trader */
2549
2774
  200: {
2550
2775
  headers: {
2551
2776
  [name: string]: unknown;
2552
2777
  };
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;
2778
+ content: {
2779
+ "application/json": components["schemas"]["TraderMarketPnlEntry"][];
2576
2780
  };
2577
- content?: never;
2578
2781
  };
2579
2782
  };
2580
2783
  };
2581
- get_portfolio_positions: {
2784
+ get_trader_position_pnl: {
2582
2785
  parameters: {
2583
2786
  query?: {
2584
- /** @description Sort field: shares_usd (default), shares, realized_pnl_usd, price, buy_usd */
2585
- sort_by?: string;
2787
+ /** @description Timeframe: 1d, 7d, 30d, lifetime (default: 7d) */
2788
+ timeframe?: components["schemas"]["PnlTimeframe"];
2789
+ /** @description Sort: realized_pnl_usd, buy_usd, sell_usd, total_buys, total_sells, total_fees (default: realized_pnl_usd) */
2790
+ sort_by?: components["schemas"]["PositionPnlSortBy"];
2586
2791
  /** @description Sort direction: asc, desc (default: desc) */
2587
2792
  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) */
2793
+ /** @description Results limit (default: 10, max: 200) */
2593
2794
  limit?: number;
2594
- /** @description Offset-based pagination key (integer offset into result set) */
2595
- pagination_key?: number;
2795
+ /** @description Cursor-based pagination key (base64-encoded, from previous response) */
2796
+ pagination_key?: string;
2797
+ /** @description Filter by market condition ID (or use market_slug) */
2798
+ condition_id?: string;
2799
+ /** @description Filter by market slug (alternative to condition_id) */
2800
+ market_slug?: string;
2801
+ /** @description Filter by specific outcome token (position ID) */
2802
+ position_id?: string;
2596
2803
  };
2597
2804
  header?: never;
2598
2805
  path: {
@@ -2603,12 +2810,14 @@ export interface operations {
2603
2810
  };
2604
2811
  requestBody?: never;
2605
2812
  responses: {
2606
- /** @description Trader positions with market metadata and PnL. Response includes `pagination: { has_more, pagination_key }` for offset-based pagination. */
2813
+ /** @description Position-level PnL entries for this trader. Each entry is a specific outcome token with avg_entry_price and avg_exit_price. */
2607
2814
  200: {
2608
2815
  headers: {
2609
2816
  [name: string]: unknown;
2610
2817
  };
2611
- content?: never;
2818
+ content: {
2819
+ "application/json": components["schemas"]["TraderOutcomePnlEntry"][];
2820
+ };
2612
2821
  };
2613
2822
  };
2614
2823
  };
@@ -2654,7 +2863,7 @@ export interface operations {
2654
2863
  };
2655
2864
  requestBody?: never;
2656
2865
  responses: {
2657
- /** @description Map of trader addresses to their profile information */
2866
+ /** @description Array of trader profiles */
2658
2867
  200: {
2659
2868
  headers: {
2660
2869
  [name: string]: unknown;
@@ -2761,7 +2970,7 @@ export interface operations {
2761
2970
  [name: string]: unknown;
2762
2971
  };
2763
2972
  content: {
2764
- "application/json": components["schemas"]["TraderVolumeChartResponse"];
2973
+ "application/json": components["schemas"]["TraderVolumeDataPoint"][];
2765
2974
  };
2766
2975
  };
2767
2976
  };