@structbuild/sdk 0.5.11 → 0.6.0

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.
@@ -634,26 +634,6 @@ export interface paths {
634
634
  patch?: never;
635
635
  trace?: never;
636
636
  };
637
- "/polymarket/events/top-traders": {
638
- parameters: {
639
- query?: never;
640
- header?: never;
641
- path?: never;
642
- cookie?: never;
643
- };
644
- /**
645
- * Get top traders for an event
646
- * @description Top traders ranked by realized PnL for a given event.
647
- */
648
- get: operations["get_event_top_traders"];
649
- put?: never;
650
- post?: never;
651
- delete?: never;
652
- options?: never;
653
- head?: never;
654
- patch?: never;
655
- trace?: never;
656
- };
657
637
  "/polymarket/events/{event_slug}/analytics/changes": {
658
638
  parameters: {
659
639
  query?: never;
@@ -734,6 +714,26 @@ export interface paths {
734
714
  patch?: never;
735
715
  trace?: never;
736
716
  };
717
+ "/polymarket/holders/events/{event_slug}/history": {
718
+ parameters: {
719
+ query?: never;
720
+ header?: never;
721
+ path?: never;
722
+ cookie?: never;
723
+ };
724
+ /**
725
+ * Get event holders history
726
+ * @description Retrieve historical unique holder counts for an event over a time range.
727
+ */
728
+ get: operations["get_event_holders_history"];
729
+ put?: never;
730
+ post?: never;
731
+ delete?: never;
732
+ options?: never;
733
+ head?: never;
734
+ patch?: never;
735
+ trace?: never;
736
+ };
737
737
  "/polymarket/holders/markets": {
738
738
  parameters: {
739
739
  query?: never;
@@ -743,7 +743,7 @@ export interface paths {
743
743
  };
744
744
  /**
745
745
  * Get market holders
746
- * @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. Set `include_pnl=true` to include a nested holder `pnl` object. Uses cursor-based pagination.
746
+ * @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. Set `include_pnl=true` to include a per-holder `pnl` object. Uses cursor-based pagination.
747
747
  */
748
748
  get: operations["get_market_holders"];
749
749
  put?: never;
@@ -763,7 +763,7 @@ export interface paths {
763
763
  };
764
764
  /**
765
765
  * Get market holders history
766
- * @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. Each candle includes timestamp `t`, holder count `h`, and the latest block represented by the candle.
766
+ * @description Retrieve historical unique holder counts for a market over a time range. Identify the market with either `condition_id` or `market_slug`.
767
767
  */
768
768
  get: operations["get_market_holders_history"];
769
769
  put?: never;
@@ -783,7 +783,7 @@ export interface paths {
783
783
  };
784
784
  /**
785
785
  * Get position holders
786
- * @description Retrieve holders of a specific position (ERC1155 token), sorted by shares held. Set `include_pnl=true` to include nested holder PnL. Uses cursor-based pagination for efficient traversal.
786
+ * @description Retrieve holders of a specific position (ERC1155 token), sorted by shares held. Set `include_pnl=true` to include a per-holder `pnl` object. Uses cursor-based pagination.
787
787
  */
788
788
  get: operations["get_position_holders"];
789
789
  put?: never;
@@ -803,7 +803,7 @@ export interface paths {
803
803
  };
804
804
  /**
805
805
  * Get position holders history
806
- * @description Retrieve historical holder snapshots for a position over a time range. Each candle includes timestamp `t`, holder count `h`, latest block, total open share balance, total holder cost basis, and optional market/event holder counts when available.
806
+ * @description Retrieve historical holder snapshots for a position over a time range.
807
807
  */
808
808
  get: operations["get_position_holders_history"];
809
809
  put?: never;
@@ -982,8 +982,8 @@ export interface paths {
982
982
  cookie?: never;
983
983
  };
984
984
  /**
985
- * Get top traders for a position id / outcome
986
- * @description Top traders ranked by realized PnL on a specific position (ERC1155 outcome token).
985
+ * Get top traders for a position
986
+ * @description Top traders for a position.
987
987
  */
988
988
  get: operations["get_position_top_traders"];
989
989
  put?: never;
@@ -1063,7 +1063,7 @@ export interface paths {
1063
1063
  };
1064
1064
  /**
1065
1065
  * Get top traders for a market
1066
- * @description Top traders ranked by realized PnL for a given market (condition_id or market_slug).
1066
+ * @description Top traders for a market, ranked by realized PnL desc.
1067
1067
  */
1068
1068
  get: operations["get_market_top_traders"];
1069
1069
  put?: never;
@@ -1374,6 +1374,26 @@ export interface paths {
1374
1374
  patch?: never;
1375
1375
  trace?: never;
1376
1376
  };
1377
+ "/polymarket/tags/top-traders": {
1378
+ parameters: {
1379
+ query?: never;
1380
+ header?: never;
1381
+ path?: never;
1382
+ cookie?: never;
1383
+ };
1384
+ /**
1385
+ * Get top traders for a category
1386
+ * @description Top traders for a category.
1387
+ */
1388
+ get: operations["get_category_top_traders"];
1389
+ put?: never;
1390
+ post?: never;
1391
+ delete?: never;
1392
+ options?: never;
1393
+ head?: never;
1394
+ patch?: never;
1395
+ trace?: never;
1396
+ };
1377
1397
  "/polymarket/tags/{identifier}": {
1378
1398
  parameters: {
1379
1399
  query?: never;
@@ -1462,8 +1482,8 @@ export interface paths {
1462
1482
  cookie?: never;
1463
1483
  };
1464
1484
  /**
1465
- * Get global leaderboard
1466
- * @description Retrieve the global PnL leaderboard ranked by profit and loss. Uses cursor-based pagination for efficient traversal of large datasets.
1485
+ * Get global PnL leaderboard
1486
+ * @description Trader leaderboard.
1467
1487
  */
1468
1488
  get: operations["get_global_pnl"];
1469
1489
  put?: never;
@@ -1474,7 +1494,7 @@ export interface paths {
1474
1494
  patch?: never;
1475
1495
  trace?: never;
1476
1496
  };
1477
- "/polymarket/trader/leaderboard": {
1497
+ "/polymarket/trader/pnl/{address}": {
1478
1498
  parameters: {
1479
1499
  query?: never;
1480
1500
  header?: never;
@@ -1482,10 +1502,10 @@ export interface paths {
1482
1502
  cookie?: never;
1483
1503
  };
1484
1504
  /**
1485
- * Get trader leaderboard
1486
- * @description Global trader leaderboard ranked by PnL or volume over the selected timeframe. Each entry carries the trader's identity, ranking score (`pnl`), and the full set of Struct trading metrics (volumes split by side, markets_won / markets_lost, win rate, average PnL per market and per trade, average hold time, best trade, fees, and first / last trade timestamps). Enrichment fields are `null` when we don't yet have a row for that address in the selected timeframe.
1505
+ * Get trader PnL summary
1506
+ * @description Trader PnL summary.
1487
1507
  */
1488
- get: operations["get_polymarket_leaderboard"];
1508
+ get: operations["get_trader_pnl"];
1489
1509
  put?: never;
1490
1510
  post?: never;
1491
1511
  delete?: never;
@@ -1494,7 +1514,7 @@ export interface paths {
1494
1514
  patch?: never;
1495
1515
  trace?: never;
1496
1516
  };
1497
- "/polymarket/trader/pnl/{address}": {
1517
+ "/polymarket/trader/pnl/{address}/calendar": {
1498
1518
  parameters: {
1499
1519
  query?: never;
1500
1520
  header?: never;
@@ -1502,10 +1522,10 @@ export interface paths {
1502
1522
  cookie?: never;
1503
1523
  };
1504
1524
  /**
1505
- * Get trader PnL summary
1506
- * @description Retrieve a trader's overall profit and loss summary
1525
+ * Get trader PnL calendar
1526
+ * @description Retrieve daily PnL candles for a trader.
1507
1527
  */
1508
- get: operations["get_trader_pnl"];
1528
+ get: operations["get_trader_pnl_calendar"];
1509
1529
  put?: never;
1510
1530
  post?: never;
1511
1531
  delete?: never;
@@ -1514,7 +1534,7 @@ export interface paths {
1514
1534
  patch?: never;
1515
1535
  trace?: never;
1516
1536
  };
1517
- "/polymarket/trader/pnl/{address}/calendar": {
1537
+ "/polymarket/trader/pnl/{address}/candles": {
1518
1538
  parameters: {
1519
1539
  query?: never;
1520
1540
  header?: never;
@@ -1522,10 +1542,10 @@ export interface paths {
1522
1542
  cookie?: never;
1523
1543
  };
1524
1544
  /**
1525
- * Get trader PnL calendar
1526
- * @description Retrieve raw per-day PnL. Each entry is the realized PnL for that calendar day. Paginate backwards using the pagination key.
1545
+ * Get trader PnL candles
1546
+ * @description PnL candles for a trader.
1527
1547
  */
1528
- get: operations["get_trader_pnl_calendar"];
1548
+ get: operations["get_trader_pnl_candles"];
1529
1549
  put?: never;
1530
1550
  post?: never;
1531
1551
  delete?: never;
@@ -1534,7 +1554,7 @@ export interface paths {
1534
1554
  patch?: never;
1535
1555
  trace?: never;
1536
1556
  };
1537
- "/polymarket/trader/pnl/{address}/candles": {
1557
+ "/polymarket/trader/pnl/{address}/categories": {
1538
1558
  parameters: {
1539
1559
  query?: never;
1540
1560
  header?: never;
@@ -1542,10 +1562,30 @@ export interface paths {
1542
1562
  cookie?: never;
1543
1563
  };
1544
1564
  /**
1545
- * Get trader PnL candles
1546
- * @description Retrieve PnL candles for charting a trader's equity curve over time.
1565
+ * Get trader category PnL
1566
+ * @description Per-category PnL for a trader.
1547
1567
  */
1548
- get: operations["get_trader_pnl_candles"];
1568
+ get: operations["get_trader_category_pnl"];
1569
+ put?: never;
1570
+ post?: never;
1571
+ delete?: never;
1572
+ options?: never;
1573
+ head?: never;
1574
+ patch?: never;
1575
+ trace?: never;
1576
+ };
1577
+ "/polymarket/trader/pnl/{address}/changes": {
1578
+ parameters: {
1579
+ query?: never;
1580
+ header?: never;
1581
+ path?: never;
1582
+ cookie?: never;
1583
+ };
1584
+ /**
1585
+ * Get trader PnL changes
1586
+ * @description PnL, portfolio, balance, and open-position changes per timeframe.
1587
+ */
1588
+ get: operations["get_trader_pnl_changes"];
1549
1589
  put?: never;
1550
1590
  post?: never;
1551
1591
  delete?: never;
@@ -1554,7 +1594,7 @@ export interface paths {
1554
1594
  patch?: never;
1555
1595
  trace?: never;
1556
1596
  };
1557
- "/polymarket/trader/pnl/{address}/events": {
1597
+ "/polymarket/trader/pnl/{address}/exits": {
1558
1598
  parameters: {
1559
1599
  query?: never;
1560
1600
  header?: never;
@@ -1562,10 +1602,10 @@ export interface paths {
1562
1602
  cookie?: never;
1563
1603
  };
1564
1604
  /**
1565
- * Get trader event PnL
1566
- * @description Retrieve event-level PnL breakdown for a trader
1605
+ * Get trader position exits
1606
+ * @description Position exits for a trader, to overlay on the PnL chart.
1567
1607
  */
1568
- get: operations["get_trader_event_pnl"];
1608
+ get: operations["get_trader_pnl_exits"];
1569
1609
  put?: never;
1570
1610
  post?: never;
1571
1611
  delete?: never;
@@ -1583,7 +1623,7 @@ export interface paths {
1583
1623
  };
1584
1624
  /**
1585
1625
  * Get trader market PnL
1586
- * @description Retrieve market-level PnL breakdown for a trader
1626
+ * @description Per-market PnL for a trader.
1587
1627
  */
1588
1628
  get: operations["get_trader_market_pnl"];
1589
1629
  put?: never;
@@ -1594,6 +1634,26 @@ export interface paths {
1594
1634
  patch?: never;
1595
1635
  trace?: never;
1596
1636
  };
1637
+ "/polymarket/trader/pnl/{address}/periods": {
1638
+ parameters: {
1639
+ query?: never;
1640
+ header?: never;
1641
+ path?: never;
1642
+ cookie?: never;
1643
+ };
1644
+ /**
1645
+ * Get trader best and worst PnL periods
1646
+ * @description Best and worst daily, weekly and monthly PnL and portfolio periods.
1647
+ */
1648
+ get: operations["get_trader_pnl_periods"];
1649
+ put?: never;
1650
+ post?: never;
1651
+ delete?: never;
1652
+ options?: never;
1653
+ head?: never;
1654
+ patch?: never;
1655
+ trace?: never;
1656
+ };
1597
1657
  "/polymarket/trader/pnl/{address}/positions": {
1598
1658
  parameters: {
1599
1659
  query?: never;
@@ -1603,7 +1663,7 @@ export interface paths {
1603
1663
  };
1604
1664
  /**
1605
1665
  * Get trader position PnL
1606
- * @description Retrieve per-outcome-token lifetime PnL for a trader. Includes open/closed state, win/loss outcome, redemption payouts, and share quantities. Filter by status and won/lost to segment portfolio views.
1666
+ * @description Per-position PnL for a trader. `status` is required — every position lookup is scoped to either currently-open positions or closed/resolved ones. `sort_by` and `search` can only be combined with a status; the per-status sort-by whitelists are exposed as `PositionOpenPnlSortBy` and `PositionClosedPnlSortBy`.
1607
1667
  */
1608
1668
  get: operations["get_trader_position_pnl"];
1609
1669
  put?: never;
@@ -1614,6 +1674,26 @@ export interface paths {
1614
1674
  patch?: never;
1615
1675
  trace?: never;
1616
1676
  };
1677
+ "/polymarket/trader/pnl/{address}/risk": {
1678
+ parameters: {
1679
+ query?: never;
1680
+ header?: never;
1681
+ path?: never;
1682
+ cookie?: never;
1683
+ };
1684
+ /**
1685
+ * Get trader PnL risk
1686
+ * @description Max drawdown, current drawdown, max runup, high, low and latest values.
1687
+ */
1688
+ get: operations["get_trader_pnl_risk"];
1689
+ put?: never;
1690
+ post?: never;
1691
+ delete?: never;
1692
+ options?: never;
1693
+ head?: never;
1694
+ patch?: never;
1695
+ trace?: never;
1696
+ };
1617
1697
  "/polymarket/trader/profile/{address}": {
1618
1698
  parameters: {
1619
1699
  query?: never;
@@ -1654,6 +1734,26 @@ export interface paths {
1654
1734
  patch?: never;
1655
1735
  trace?: never;
1656
1736
  };
1737
+ "/polymarket/trader/top_trades_markets": {
1738
+ parameters: {
1739
+ query?: never;
1740
+ header?: never;
1741
+ path?: never;
1742
+ cookie?: never;
1743
+ };
1744
+ /**
1745
+ * Get top markets across all traders
1746
+ * @description Top markets across all traders, ranked by total PnL desc.
1747
+ */
1748
+ get: operations["get_top_trades_markets"];
1749
+ put?: never;
1750
+ post?: never;
1751
+ delete?: never;
1752
+ options?: never;
1753
+ head?: never;
1754
+ patch?: never;
1755
+ trace?: never;
1756
+ };
1657
1757
  "/polymarket/trader/trades/{address}": {
1658
1758
  parameters: {
1659
1759
  query?: never;
@@ -1759,31 +1859,45 @@ export type webhooks = Record<string, never>;
1759
1859
  export interface components {
1760
1860
  schemas: {
1761
1861
  /**
1762
- * @description Bucket size for `/analytics/timeseries` and `/analytics/deltas` responses.
1763
- * Each value picks the time interval that one row in the output covers:
1764
- * `60` = 1 hour, `240` = 4 hours, `D`/`1D` = 1 day, `W`/`1W` = 7 days,
1765
- * `M`/`1M` = calendar month.
1862
+ * @description Lookback window for `/analytics/changes` endpoints.
1766
1863
  * @enum {string}
1767
1864
  */
1768
- AnalyticsResolution: "60" | "240" | "D" | "1D" | "W" | "1W" | "M" | "1M";
1769
- /** @description One builder's stats under a single tag. */
1770
- TagBuilderRow: {
1771
- builder_code: string;
1772
- /** Format: int64 */
1773
- block: number;
1774
- /** Format: int32 */
1865
+ AnalyticsChangeTimeframe: "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
1866
+ /**
1867
+ * @description Response body for `GET /polymarket/analytics/counts`.
1868
+ * Cumulative analytics metrics plus entity-count enrichment.
1869
+ */
1870
+ AnalyticsGlobalCountsResponse: {
1871
+ /**
1872
+ * Format: int32
1873
+ * @description Unix-second timestamp of the latest block reflected in the metrics.
1874
+ */
1775
1875
  ts: number;
1876
+ /**
1877
+ * Format: int64
1878
+ * @description Latest block number processed.
1879
+ */
1880
+ block: number;
1776
1881
  /** Format: double */
1777
1882
  volume_usd: number;
1778
1883
  /** Format: double */
1779
1884
  buy_volume_usd: number;
1780
1885
  /** Format: double */
1781
1886
  sell_volume_usd: number;
1782
- /** Format: int64 */
1887
+ /**
1888
+ * Format: int64
1889
+ * @description Distinct addresses that have ever traded on Polymarket (lifetime).
1890
+ */
1783
1891
  unique_traders: number;
1784
- /** Format: int64 */
1892
+ /**
1893
+ * Format: int64
1894
+ * @description Distinct makers ever active (lifetime distinct).
1895
+ */
1785
1896
  unique_makers: number;
1786
- /** Format: int64 */
1897
+ /**
1898
+ * Format: int64
1899
+ * @description Distinct takers ever active (lifetime distinct).
1900
+ */
1787
1901
  unique_takers: number;
1788
1902
  /** Format: int64 */
1789
1903
  txn_count: number;
@@ -1791,13 +1905,51 @@ export interface components {
1791
1905
  buy_count: number;
1792
1906
  /** Format: int64 */
1793
1907
  sell_count: number;
1908
+ /** Format: int64 */
1909
+ redemption_count: number;
1794
1910
  /** Format: double */
1795
- fees_usd: number;
1911
+ redemption_volume_usd: number;
1912
+ /** Format: int64 */
1913
+ merge_count: number;
1796
1914
  /** Format: double */
1797
- builder_fees: number;
1915
+ merge_volume_usd: number;
1916
+ /** Format: int64 */
1917
+ split_count: number;
1918
+ /** Format: double */
1919
+ split_volume_usd: number;
1920
+ /** Format: int64 */
1921
+ converted_count: number;
1922
+ /** Format: double */
1923
+ converted_collateral_usd: number;
1924
+ /** Format: double */
1925
+ converted_shares_gained: number;
1926
+ /** Format: double */
1927
+ converted_shares_lost: number;
1928
+ /** Format: int64 */
1929
+ maker_rebate_count: number;
1930
+ /** Format: double */
1931
+ maker_rebate_volume_usd: number;
1932
+ /** Format: int64 */
1933
+ reward_count: number;
1934
+ /** Format: double */
1935
+ reward_volume_usd: number;
1936
+ /** Format: int64 */
1937
+ yield_count: number;
1938
+ /** Format: double */
1939
+ yield_volume_usd: number;
1940
+ /** Format: double */
1941
+ fees_usd: number;
1798
1942
  /** Format: double */
1799
1943
  shares_volume: number;
1800
1944
  /** Format: double */
1945
+ buy_shares_volume: number;
1946
+ /** Format: double */
1947
+ sell_shares_volume: number;
1948
+ /** Format: double */
1949
+ yes_shares_volume: number;
1950
+ /** Format: double */
1951
+ no_shares_volume: number;
1952
+ /** Format: double */
1801
1953
  yes_volume_usd: number;
1802
1954
  /** Format: double */
1803
1955
  no_volume_usd: number;
@@ -1817,48 +1969,236 @@ export interface components {
1817
1969
  buy_dist_10k_50k: number;
1818
1970
  /** Format: int64 */
1819
1971
  buy_dist_50k_plus: number;
1820
- /** Format: int64 */
1821
- new_users: number;
1822
- /** Format: double */
1823
- avg_rev_per_user: number;
1824
- /** Format: double */
1825
- avg_vol_per_user: number;
1972
+ /**
1973
+ * Format: int64
1974
+ * @description Total number of tags.
1975
+ */
1976
+ tags: number;
1977
+ /**
1978
+ * Format: int64
1979
+ * @description Total number of events.
1980
+ */
1981
+ events: number;
1982
+ /**
1983
+ * Format: int64
1984
+ * @description Total number of markets.
1985
+ */
1986
+ markets: number;
1987
+ /**
1988
+ * Format: int64
1989
+ * @description Total number of unique positions / traders.
1990
+ */
1991
+ positions: number;
1826
1992
  };
1827
1993
  /**
1828
- * @description One bucket of derived order-book metrics for a position at a point in time.
1829
- * Only summary metrics are returned the underlying bid/ask ladders are
1830
- * available from the snapshot endpoint.
1994
+ * @description Per-metric % change. `None` when the window predates the entity's data
1995
+ * or the previous value was zero (division undefined).
1831
1996
  */
1832
- SpreadRow: {
1833
- /** Format: int64 */
1834
- ts: number;
1835
- position_id: string;
1836
- condition_id: string;
1997
+ AnalyticsMetricPctChange: {
1837
1998
  /** Format: double */
1838
- best_bid?: number | null;
1999
+ volume_usd?: number | null;
1839
2000
  /** Format: double */
1840
- best_ask?: number | null;
2001
+ buy_volume_usd?: number | null;
1841
2002
  /** Format: double */
1842
- mid_price?: number | null;
2003
+ sell_volume_usd?: number | null;
1843
2004
  /** Format: double */
1844
- spread?: number | null;
2005
+ merge_volume_usd?: number | null;
1845
2006
  /** Format: double */
1846
- bid_liquidity_usd?: number | null;
2007
+ split_volume_usd?: number | null;
1847
2008
  /** Format: double */
1848
- ask_liquidity_usd?: number | null;
1849
- /** Format: int32 */
1850
- bid_levels?: number | null;
1851
- /** Format: int32 */
1852
- ask_levels?: number | null;
1853
- };
1854
- /** @enum {string} */
1855
- TagChangeTimeframe: "1h" | "24h" | "7d" | "30d" | "1mo";
1856
- /**
1857
- * @description `TagBuilderRow` with builder display metadata (name, icon, links) merged
1858
- * onto each row. Returned by `/polymarket/builders/tags/{tag}`.
1859
- */
1860
- TagBuilderRowWithMetadata: components["schemas"]["TagBuilderRow"] & {
1861
- metadata?: null | components["schemas"]["BuilderMetadataInline"];
2009
+ converted_count?: number | null;
2010
+ /** Format: double */
2011
+ converted_collateral_usd?: number | null;
2012
+ /** Format: double */
2013
+ converted_shares_gained?: number | null;
2014
+ /** Format: double */
2015
+ converted_shares_lost?: number | null;
2016
+ /** Format: double */
2017
+ maker_rebate_count?: number | null;
2018
+ /** Format: double */
2019
+ maker_rebate_volume_usd?: number | null;
2020
+ /** Format: double */
2021
+ reward_count?: number | null;
2022
+ /** Format: double */
2023
+ reward_volume_usd?: number | null;
2024
+ /** Format: double */
2025
+ yield_count?: number | null;
2026
+ /** Format: double */
2027
+ yield_volume_usd?: number | null;
2028
+ /** Format: double */
2029
+ unique_traders?: number | null;
2030
+ /** Format: double */
2031
+ unique_makers?: number | null;
2032
+ /** Format: double */
2033
+ unique_takers?: number | null;
2034
+ /** Format: double */
2035
+ txn_count?: number | null;
2036
+ /** Format: double */
2037
+ fees_usd?: number | null;
2038
+ /** Format: double */
2039
+ shares_volume?: number | null;
2040
+ /** Format: double */
2041
+ buy_shares_volume?: number | null;
2042
+ /** Format: double */
2043
+ sell_shares_volume?: number | null;
2044
+ /** Format: double */
2045
+ yes_shares_volume?: number | null;
2046
+ /** Format: double */
2047
+ no_shares_volume?: number | null;
2048
+ /** Format: double */
2049
+ yes_volume_usd?: number | null;
2050
+ /** Format: double */
2051
+ no_volume_usd?: number | null;
2052
+ };
2053
+ /**
2054
+ * @description Bucket size for `/analytics/timeseries` and `/analytics/deltas` responses.
2055
+ * Each value picks the time interval that one row in the output covers:
2056
+ * `60` = 1 hour, `240` = 4 hours, `D`/`1D` = 1 day, `W`/`1W` = 7 days,
2057
+ * `M`/`1M` = calendar month.
2058
+ * @enum {string}
2059
+ */
2060
+ AnalyticsResolution: "60" | "240" | "D" | "1D" | "W" | "1W" | "M" | "1M";
2061
+ /**
2062
+ * @description Bucket row returned by both `/analytics/timeseries` (cumulative values
2063
+ * at end of bucket) and `/analytics/deltas` (per-bucket deltas). All metrics
2064
+ * the snapshot `/counts` returns are included.
2065
+ *
2066
+ * Short field names for compact JSON responses:
2067
+ * t=bucket (unix seconds), v=volume_usd, bv=buy_volume_usd, sv=sell_volume_usd,
2068
+ * ut=unique_traders, um=unique_makers, uk=unique_takers,
2069
+ * tc=txn_count, bc=buy_count, sc=sell_count,
2070
+ * rc=redemption_count, rv=redemption_volume_usd, mc=merge_count, mv=merge_volume_usd,
2071
+ * sp=split_count, spv=split_volume_usd, f=fees_usd, sh=shares_volume,
2072
+ * yv=yes_volume_usd, nv=no_volume_usd, yc=yes_count, nc=no_count,
2073
+ * bd_*=buy distribution by USD bucket
2074
+ */
2075
+ AnalyticsTimeBucketRow: {
2076
+ /** Format: int32 */
2077
+ t: number;
2078
+ /** Format: double */
2079
+ v: number;
2080
+ /** Format: double */
2081
+ bv: number;
2082
+ /** Format: double */
2083
+ sv: number;
2084
+ /** Format: int64 */
2085
+ tc: number;
2086
+ /** Format: int64 */
2087
+ bc: number;
2088
+ /** Format: int64 */
2089
+ sc: number;
2090
+ /** Format: int64 */
2091
+ rc: number;
2092
+ /** Format: double */
2093
+ rv: number;
2094
+ /** Format: int64 */
2095
+ mc: number;
2096
+ /** Format: double */
2097
+ mv: number;
2098
+ /** Format: int64 */
2099
+ sp: number;
2100
+ /** Format: double */
2101
+ spv: number;
2102
+ /** Format: int64 */
2103
+ cc: number;
2104
+ /** Format: double */
2105
+ ccu: number;
2106
+ /** Format: double */
2107
+ csg: number;
2108
+ /** Format: double */
2109
+ csl: number;
2110
+ /** Format: int64 */
2111
+ mrc: number;
2112
+ /** Format: double */
2113
+ mrv: number;
2114
+ /** Format: int64 */
2115
+ rwc: number;
2116
+ /** Format: double */
2117
+ rwv: number;
2118
+ /** Format: int64 */
2119
+ ydc: number;
2120
+ /** Format: double */
2121
+ ydv: number;
2122
+ /** Format: double */
2123
+ f: number;
2124
+ /** Format: double */
2125
+ sh: number;
2126
+ /** Format: double */
2127
+ bsh: number;
2128
+ /** Format: double */
2129
+ ssh: number;
2130
+ /** Format: double */
2131
+ ysh: number;
2132
+ /** Format: double */
2133
+ nsh: number;
2134
+ /** Format: double */
2135
+ yv: number;
2136
+ /** Format: double */
2137
+ nv: number;
2138
+ /** Format: int64 */
2139
+ yc: number;
2140
+ /** Format: int64 */
2141
+ nc: number;
2142
+ /**
2143
+ * Format: int64
2144
+ * @description Buy distribution — count of buy trades falling in each USD bucket.
2145
+ */
2146
+ bd_u10: number;
2147
+ /** Format: int64 */
2148
+ bd_100: number;
2149
+ /** Format: int64 */
2150
+ bd_1k: number;
2151
+ /** Format: int64 */
2152
+ bd_10k: number;
2153
+ /** Format: int64 */
2154
+ bd_50k: number;
2155
+ /** Format: int64 */
2156
+ bd_50p: number;
2157
+ /**
2158
+ * Format: int64
2159
+ * @description Distinct traders ACTIVE in this bucket (window-unique, not first-time).
2160
+ */
2161
+ ut: number;
2162
+ /**
2163
+ * Format: int64
2164
+ * @description Distinct makers active in this bucket.
2165
+ */
2166
+ um: number;
2167
+ /**
2168
+ * Format: int64
2169
+ * @description Distinct takers active in this bucket.
2170
+ */
2171
+ uk: number;
2172
+ };
2173
+ /**
2174
+ * @description Timeframe for `?sort=...` — defines the window the metric is summed over
2175
+ * (or `lifetime` for all-time cumulative).
2176
+ * @enum {string}
2177
+ */
2178
+ TagSortTimeframe: "lifetime" | "1h" | "24h" | "7d" | "30d" | "1mo";
2179
+ /**
2180
+ * @description Metric to order by when `sort=<value>` is provided.
2181
+ *
2182
+ * `unique_*` variants rank by the number of distinct wallet addresses
2183
+ * active in the selected timeframe.
2184
+ * @enum {string}
2185
+ */
2186
+ TagSortBy: "volume" | "builder_volume" | "shares_volume" | "builder_shares_volume" | "txns" | "builder_txns" | "unique_traders" | "unique_builder_traders" | "unique_makers" | "unique_takers" | "fees" | "builder_fees";
2187
+ TopTraderRow: {
2188
+ trader: string;
2189
+ /** Format: double */
2190
+ volume_usd: number;
2191
+ /** Format: int64 */
2192
+ txn_count: number;
2193
+ /** Format: double */
2194
+ fees_usd: number;
2195
+ /** Format: double */
2196
+ builder_fees: number;
2197
+ };
2198
+ /** @description Token outcome (position) */
2199
+ TokenOutcome: {
2200
+ token_id: string;
2201
+ outcome: string;
1862
2202
  };
1863
2203
  /** @description V3 UMA OOv3: an assertion was disputed. */
1864
2204
  AssertionDisputedEvent: {
@@ -1973,7 +2313,7 @@ export interface components {
1973
2313
  asset_close_price: number;
1974
2314
  /** Format: double */
1975
2315
  price_change_percentage?: number | null;
1976
- /** @description Generated column: "up" if close > open, "down" if close ≤ open, null if no close yet */
2316
+ /** @description Candle direction: "up" if close > open, "down" if close ≤ open, null if no close yet */
1977
2317
  outcome?: string | null;
1978
2318
  /** @description Time window: "5m", "15m", "1h", "1d" */
1979
2319
  variant: string;
@@ -1993,13 +2333,10 @@ export interface components {
1993
2333
  /** @enum {string} */
1994
2334
  AssetVariant: "5m" | "15m" | "1h" | "4h" | "1d";
1995
2335
  /**
1996
- * @description Metric to order by when `sort=<value>` is provided.
1997
- *
1998
- * `unique_*` variants rank by the number of distinct wallet addresses
1999
- * active in the selected timeframe.
2336
+ * @description Sort key for the top-traders ranking.
2000
2337
  * @enum {string}
2001
2338
  */
2002
- TagSortBy: "volume" | "builder_volume" | "shares_volume" | "builder_shares_volume" | "txns" | "builder_txns" | "unique_traders" | "unique_builder_traders" | "unique_makers" | "unique_takers" | "fees" | "builder_fees";
2339
+ TopTradersSortBy: "volume" | "txns" | "fees" | "builder_fees";
2003
2340
  BondMarket: {
2004
2341
  condition_id: string;
2005
2342
  title?: string | null;
@@ -2031,8 +2368,33 @@ export interface components {
2031
2368
  };
2032
2369
  /** @enum {string} */
2033
2370
  BondsSortBy: "end_date" | "apy" | "liquidity" | "volume";
2034
- /** @enum {string} */
2035
- SortDirection: "asc" | "desc";
2371
+ /**
2372
+ * @description One bucket of derived order-book metrics for a position at a point in time.
2373
+ * Only summary metrics are returned — the underlying bid/ask ladders are
2374
+ * available from the snapshot endpoint.
2375
+ */
2376
+ SpreadRow: {
2377
+ /** Format: int64 */
2378
+ ts: number;
2379
+ position_id: string;
2380
+ condition_id: string;
2381
+ /** Format: double */
2382
+ best_bid?: number | null;
2383
+ /** Format: double */
2384
+ best_ask?: number | null;
2385
+ /** Format: double */
2386
+ mid_price?: number | null;
2387
+ /** Format: double */
2388
+ spread?: number | null;
2389
+ /** Format: double */
2390
+ bid_liquidity_usd?: number | null;
2391
+ /** Format: double */
2392
+ ask_liquidity_usd?: number | null;
2393
+ /** Format: int32 */
2394
+ bid_levels?: number | null;
2395
+ /** Format: int32 */
2396
+ ask_levels?: number | null;
2397
+ };
2036
2398
  BuilderFeeRate: {
2037
2399
  code: string;
2038
2400
  /** Format: int32 */
@@ -2296,60 +2658,110 @@ export interface components {
2296
2658
  avg_vol_per_user: number;
2297
2659
  };
2298
2660
  /**
2299
- * @description Market metadata for the market a trader's best / worst trade landed in.
2300
- * Accompanies the existing flat `best_trade_pnl_usd` / `worst_trade_pnl_usd`
2301
- * numerics on trader / event / category PnL summaries.
2302
- */
2303
- TradeMarketRef: {
2304
- condition_id?: string | null;
2305
- market_slug?: string | null;
2306
- title?: string | null;
2307
- question?: string | null;
2308
- image_url?: string | null;
2309
- event_slug?: string | null;
2310
- };
2311
- /**
2312
- * @description Trader profile info embedded in API responses.
2313
- *
2314
- * Used in:
2315
- * - holders endpoints (market/event holders)
2316
- * - trades endpoints
2317
- * - leaderboard endpoints
2318
- */
2319
- Trader: {
2320
- address: string;
2321
- name?: string | null;
2322
- pseudonym?: string | null;
2323
- profile_image?: string | null;
2324
- x_username?: string | null;
2325
- verified_badge?: boolean;
2326
- };
2327
- /**
2328
- * @description Sort metric for the builders list endpoint.
2329
- * @enum {string}
2661
+ * @description Tagged enum for all trade types serializes with `"trade_type": "..."` discriminator
2662
+ * and only includes fields relevant to each type.
2330
2663
  */
2331
- BuilderSortBy: "volume" | "txns" | "traders" | "fees" | "builder_fees" | "new_users" | "avg_rev_per_user" | "avg_vol_per_user" | "builder_maker_fee_rate_bps" | "builder_taker_fee_rate_bps";
2332
- /** @description One tag's stats under a single builder. */
2333
- BuilderTagRow: {
2334
- tag: string;
2335
- /** Format: int64 */
2336
- block: number;
2337
- /** Format: int32 */
2338
- ts: number;
2339
- /** Format: double */
2340
- volume_usd: number;
2341
- /** Format: double */
2342
- buy_volume_usd: number;
2343
- /** Format: double */
2344
- sell_volume_usd: number;
2345
- /** Format: int64 */
2346
- unique_traders: number;
2347
- /** Format: int64 */
2348
- unique_makers: number;
2349
- /** Format: int64 */
2350
- unique_takers: number;
2351
- /** Format: int64 */
2352
- txn_count: number;
2664
+ TradeEvent: (components["schemas"]["OrderFilledTrade"] & {
2665
+ /** @enum {string} */
2666
+ trade_type: "OrderFilled";
2667
+ }) | (components["schemas"]["OrderFilledTrade"] & {
2668
+ /** @enum {string} */
2669
+ trade_type: "OrdersMatched";
2670
+ }) | (components["schemas"]["OrderFilledTrade"] & {
2671
+ /** @enum {string} */
2672
+ trade_type: "MakerRebate";
2673
+ }) | (components["schemas"]["OrderFilledTrade"] & {
2674
+ /** @enum {string} */
2675
+ trade_type: "Reward";
2676
+ }) | (components["schemas"]["OrderFilledTrade"] & {
2677
+ /** @enum {string} */
2678
+ trade_type: "Yield";
2679
+ }) | (components["schemas"]["RedemptionTrade"] & {
2680
+ /** @enum {string} */
2681
+ trade_type: "Redemption";
2682
+ }) | (components["schemas"]["MergeTrade"] & {
2683
+ /** @enum {string} */
2684
+ trade_type: "Merge";
2685
+ }) | (components["schemas"]["SplitTrade"] & {
2686
+ /** @enum {string} */
2687
+ trade_type: "Split";
2688
+ }) | (components["schemas"]["PositionsConvertedTrade"] & {
2689
+ /** @enum {string} */
2690
+ trade_type: "PositionsConverted";
2691
+ }) | (components["schemas"]["CancelledTrade"] & {
2692
+ /** @enum {string} */
2693
+ trade_type: "Cancelled";
2694
+ }) | (components["schemas"]["QuestionInitializedEvent"] & {
2695
+ /** @enum {string} */
2696
+ trade_type: "Initialization";
2697
+ }) | (components["schemas"]["AssertionMadeEvent"] & {
2698
+ /** @enum {string} */
2699
+ trade_type: "Proposal";
2700
+ }) | (components["schemas"]["AssertionDisputedEvent"] & {
2701
+ /** @enum {string} */
2702
+ trade_type: "Dispute";
2703
+ }) | (components["schemas"]["AssertionSettledEvent"] & {
2704
+ /** @enum {string} */
2705
+ trade_type: "Settled";
2706
+ }) | (components["schemas"]["QuestionResolvedEvent"] & {
2707
+ /** @enum {string} */
2708
+ trade_type: "Resolution";
2709
+ }) | (components["schemas"]["ConditionResolutionEvent"] & {
2710
+ /** @enum {string} */
2711
+ trade_type: "ConditionResolution";
2712
+ }) | (components["schemas"]["QuestionResetEvent"] & {
2713
+ /** @enum {string} */
2714
+ trade_type: "Reset";
2715
+ }) | (components["schemas"]["QuestionFlaggedEvent"] & {
2716
+ /** @enum {string} */
2717
+ trade_type: "Flag";
2718
+ }) | (components["schemas"]["QuestionUnflaggedEvent"] & {
2719
+ /** @enum {string} */
2720
+ trade_type: "Unflag";
2721
+ }) | (components["schemas"]["QuestionPausedEvent"] & {
2722
+ /** @enum {string} */
2723
+ trade_type: "Pause";
2724
+ }) | (components["schemas"]["QuestionUnpausedEvent"] & {
2725
+ /** @enum {string} */
2726
+ trade_type: "Unpause";
2727
+ }) | (components["schemas"]["QuestionEmergencyResolvedEvent"] & {
2728
+ /** @enum {string} */
2729
+ trade_type: "ManualResolution";
2730
+ }) | (components["schemas"]["NegRiskOutcomeReportedEvent"] & {
2731
+ /** @enum {string} */
2732
+ trade_type: "NegRiskOutcomeReported";
2733
+ }) | (components["schemas"]["RegisterTokenTrade"] & {
2734
+ /** @enum {string} */
2735
+ trade_type: "RegisterToken";
2736
+ });
2737
+ /** @enum {string} */
2738
+ TradeSide: "0" | "1";
2739
+ /**
2740
+ * @description Sort metric for the builders list endpoint.
2741
+ * @enum {string}
2742
+ */
2743
+ BuilderSortBy: "volume" | "txns" | "traders" | "fees" | "builder_fees" | "new_users" | "avg_rev_per_user" | "avg_vol_per_user" | "builder_maker_fee_rate_bps" | "builder_taker_fee_rate_bps";
2744
+ /** @description One tag's stats under a single builder. */
2745
+ BuilderTagRow: {
2746
+ tag: string;
2747
+ /** Format: int64 */
2748
+ block: number;
2749
+ /** Format: int32 */
2750
+ ts: number;
2751
+ /** Format: double */
2752
+ volume_usd: number;
2753
+ /** Format: double */
2754
+ buy_volume_usd: number;
2755
+ /** Format: double */
2756
+ sell_volume_usd: number;
2757
+ /** Format: int64 */
2758
+ unique_traders: number;
2759
+ /** Format: int64 */
2760
+ unique_makers: number;
2761
+ /** Format: int64 */
2762
+ unique_takers: number;
2763
+ /** Format: int64 */
2764
+ txn_count: number;
2353
2765
  /** Format: int64 */
2354
2766
  buy_count: number;
2355
2767
  /** Format: int64 */
@@ -2477,49 +2889,91 @@ export interface components {
2477
2889
  * @enum {string}
2478
2890
  */
2479
2891
  BuilderTimeframe: "lifetime" | "1d" | "7d" | "30d";
2480
- /** @description Token outcome (position) */
2481
- TokenOutcome: {
2482
- token_id: string;
2483
- outcome: string;
2484
- };
2485
- /** @description Market-level PnL entry */
2486
- TraderMarketPnlEntry: {
2487
- condition_id?: string | null;
2488
- market_slug?: string | null;
2489
- event_slug?: string | null;
2490
- question?: string | null;
2491
- image_url?: string | null;
2892
+ TraderAnalyticsTimeBucketRow: {
2893
+ /** Format: int32 */
2894
+ t: number;
2895
+ /** Format: double */
2896
+ v: number;
2897
+ /** Format: double */
2898
+ bv: number;
2899
+ /** Format: double */
2900
+ sv: number;
2492
2901
  /** Format: int64 */
2493
- outcomes_traded?: number | null;
2902
+ tc: number;
2494
2903
  /** Format: int64 */
2495
- total_buys?: number | null;
2904
+ bc: number;
2496
2905
  /** Format: int64 */
2497
- total_sells?: number | null;
2906
+ sc: number;
2498
2907
  /** Format: int64 */
2499
- total_redemptions?: number | null;
2908
+ rc: number;
2909
+ /** Format: double */
2910
+ rv: number;
2500
2911
  /** Format: int64 */
2501
- total_merges?: number | null;
2912
+ mc: number;
2502
2913
  /** Format: double */
2503
- buy_usd?: number | null;
2914
+ mv: number;
2915
+ /** Format: int64 */
2916
+ sp: number;
2504
2917
  /** Format: double */
2505
- sell_usd?: number | null;
2918
+ spv: number;
2919
+ /** Format: int64 */
2920
+ cc: number;
2506
2921
  /** Format: double */
2507
- redemption_usd?: number | null;
2922
+ ccu: number;
2508
2923
  /** Format: double */
2509
- merge_usd?: number | null;
2924
+ csg: number;
2510
2925
  /** Format: double */
2511
- realized_pnl_usd?: number | null;
2926
+ csl: number;
2512
2927
  /** Format: int64 */
2513
- winning_outcomes?: number | null;
2928
+ mrc: number;
2514
2929
  /** Format: double */
2515
- total_fees?: number | null;
2930
+ mrv: number;
2516
2931
  /** Format: int64 */
2517
- first_trade_at?: number | null;
2932
+ rwc: number;
2933
+ /** Format: double */
2934
+ rwv: number;
2518
2935
  /** Format: int64 */
2519
- last_trade_at?: number | null;
2936
+ ydc: number;
2520
2937
  /** Format: double */
2521
- realized_pnl_pct?: number | null;
2938
+ ydv: number;
2939
+ /** Format: double */
2940
+ f: number;
2941
+ /** Format: double */
2942
+ sh: number;
2943
+ /** Format: double */
2944
+ bsh: number;
2945
+ /** Format: double */
2946
+ ssh: number;
2947
+ /** Format: double */
2948
+ ysh: number;
2949
+ /** Format: double */
2950
+ nsh: number;
2951
+ /** Format: double */
2952
+ yv: number;
2953
+ /** Format: double */
2954
+ nv: number;
2955
+ /** Format: int64 */
2956
+ yc: number;
2957
+ /** Format: int64 */
2958
+ nc: number;
2959
+ /** Format: int64 */
2960
+ bd_u10: number;
2961
+ /** Format: int64 */
2962
+ bd_100: number;
2963
+ /** Format: int64 */
2964
+ bd_1k: number;
2965
+ /** Format: int64 */
2966
+ bd_10k: number;
2967
+ /** Format: int64 */
2968
+ bd_50k: number;
2969
+ /** Format: int64 */
2970
+ bd_50p: number;
2522
2971
  };
2972
+ /**
2973
+ * @description Sort metric for the trader → builders list.
2974
+ * @enum {string}
2975
+ */
2976
+ TraderBuilderSortBy: "volume" | "txns" | "fees";
2523
2977
  /** @description Output payload for Cancelled orders. */
2524
2978
  CancelledTrade: {
2525
2979
  id: string;
@@ -2543,104 +2997,154 @@ export interface components {
2543
2997
  };
2544
2998
  /** @enum {string} */
2545
2999
  CandlestickResolution: "1S" | "5S" | "10S" | "30S" | "1" | "5" | "15" | "30" | "60" | "240" | "D" | "1D";
2546
- /**
2547
- * @description Lookback window for `/analytics/changes` endpoints.
2548
- * @enum {string}
2549
- */
2550
- ChangeTimeframe: "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
2551
- /** @enum {string} */
2552
- ChartResolution: "1H" | "6H" | "1D" | "1W" | "1M" | "ALL";
2553
- TopTraderRow: {
2554
- trader: string;
3000
+ CategoryEntry: {
3001
+ category?: string | null;
3002
+ trader?: null | components["schemas"]["TraderProfile"];
2555
3003
  /** Format: double */
2556
- volume_usd: number;
2557
- /** Format: int64 */
2558
- txn_count: number;
3004
+ realized_pnl_usd: number;
2559
3005
  /** Format: double */
2560
- fees_usd: number;
3006
+ total_pnl_usd?: number;
2561
3007
  /** Format: double */
2562
- builder_fees: number;
2563
- };
2564
- /** @description Trader profile info - backwards compatibility */
2565
- TraderInfo: {
2566
- address: string;
2567
- name?: string | null;
2568
- pseudonym?: string | null;
2569
- profile_image?: string | null;
2570
- x_username?: string | null;
2571
- verified_badge?: boolean;
2572
- };
2573
- /** @description Outcome-level PnL entry (per outcome token / position_id) */
2574
- TraderOutcomePnlEntry: {
2575
- position_id?: string | null;
2576
- condition_id?: string | null;
2577
- market_slug?: string | null;
2578
- event_slug?: string | null;
2579
- title?: string | null;
2580
- image_url?: string | null;
2581
- outcome?: string | null;
2582
- /** Format: int32 */
2583
- outcome_index?: number | null;
2584
- /** @description TRUE = won, FALSE = lost, NULL = open or sold before resolution */
2585
- won?: boolean | null;
3008
+ unrealized_pnl_usd?: number;
3009
+ /** Format: double */
3010
+ realized_pnl_pct?: number | null;
3011
+ /** Format: double */
3012
+ total_pnl_pct?: number | null;
2586
3013
  /** Format: int64 */
2587
- total_buys?: number | null;
3014
+ markets_traded: number;
2588
3015
  /** Format: int64 */
2589
- total_sells?: number | null;
3016
+ markets_resolved: number;
3017
+ /** Format: int64 */
3018
+ markets_won: number;
3019
+ /** Format: int64 */
3020
+ markets_lost: number;
2590
3021
  /** Format: double */
2591
- total_shares_bought?: number | null;
3022
+ market_win_rate_pct: number;
2592
3023
  /** Format: double */
2593
- total_shares_sold?: number | null;
3024
+ avg_win_usd: number;
2594
3025
  /** Format: double */
2595
- total_buy_usd?: number | null;
3026
+ avg_loss_usd: number;
2596
3027
  /** Format: double */
2597
- total_sell_usd?: number | null;
2598
- /**
2599
- * Format: double
2600
- * @description Payout on redemption (non-zero only if won)
2601
- */
2602
- redemption_usd?: number | null;
3028
+ profit_factor: number;
3029
+ /** Format: int64 */
3030
+ total_buys: number;
3031
+ /** Format: int64 */
3032
+ total_sells: number;
3033
+ /** Format: int64 */
3034
+ total_redemptions: number;
3035
+ /** Format: int64 */
3036
+ total_merges: number;
2603
3037
  /**
2604
- * Format: double
2605
- * @description VWAP price paid per share across all buys (0–1)
3038
+ * Format: int64
3039
+ * @description Number of split transactions in the selected timeframe.
2606
3040
  */
2607
- avg_entry_price?: number | null;
3041
+ total_splits?: number;
3042
+ /** Format: double */
3043
+ total_volume_usd: number;
3044
+ /** Format: double */
3045
+ buy_volume_usd: number;
3046
+ /** Format: double */
3047
+ sell_volume_usd: number;
3048
+ /** Format: double */
3049
+ redemption_volume_usd: number;
3050
+ /** Format: double */
3051
+ merge_volume_usd: number;
3052
+ /** Format: double */
3053
+ convert_collateral_usd?: number;
2608
3054
  /**
2609
3055
  * Format: double
2610
- * @description VWAP price received per share across all sells (0–1)
3056
+ * @description USD collateral split into outcome tokens in the selected timeframe.
2611
3057
  */
2612
- avg_exit_price?: number | null;
3058
+ split_volume_usd?: number;
2613
3059
  /** Format: double */
2614
- realized_pnl_usd?: number | null;
3060
+ total_fees: number;
2615
3061
  /** Format: double */
2616
- total_fees?: number | null;
3062
+ total_wins_usd: number;
3063
+ /** Format: double */
3064
+ total_losses_usd: number;
3065
+ /** Format: double */
3066
+ best_trade_pnl_usd?: number | null;
3067
+ best_trade_condition_id?: string | null;
3068
+ /** Format: double */
3069
+ worst_trade_pnl_usd?: number | null;
3070
+ worst_trade_condition_id?: string | null;
3071
+ best_trade_metadata?: null | components["schemas"]["TradeMarketRef"];
3072
+ worst_trade_metadata?: null | components["schemas"]["TradeMarketRef"];
3073
+ /** Format: double */
3074
+ avg_hold_time_seconds: number;
3075
+ /** Format: double */
3076
+ total_shares_bought: number;
3077
+ /** Format: int64 */
3078
+ buy_count: number;
3079
+ /** Format: int64 */
3080
+ sell_count: number;
3081
+ /** Format: int64 */
3082
+ redeem_count: number;
3083
+ /** Format: int64 */
3084
+ merge_count: number;
3085
+ /** Format: int64 */
3086
+ split_count: number;
3087
+ /** Format: int64 */
3088
+ converted_count: number;
3089
+ /** Format: double */
3090
+ converted_shares_gained: number;
3091
+ /** Format: double */
3092
+ converted_shares_lost: number;
3093
+ /** Format: int64 */
3094
+ outcomes_traded: number;
2617
3095
  /** Format: int64 */
2618
3096
  first_trade_at?: number | null;
2619
3097
  /** Format: int64 */
2620
3098
  last_trade_at?: number | null;
2621
- /**
2622
- * Format: double
2623
- * @description Last traded price for this outcome (0–1). NULL if market_outcomes has no price yet.
2624
- */
2625
- current_price?: number | null;
2626
- /**
2627
- * Format: double
2628
- * @description Current shares held: balance / 1e6.
2629
- */
2630
- current_shares_balance?: number | null;
2631
- /**
2632
- * Format: double
2633
- * @description Estimated current USD value of held shares: (balance / 1e6) * current_price.
2634
- * Only meaningful for open positions (balance above dust threshold).
2635
- */
2636
- current_value?: number | null;
2637
- /**
2638
- * Format: double
2639
- * @description Realized PnL as a percentage of total spend: (realized_pnl_usd / total_buy_usd) * 100.
2640
- * NULL when total_buy_usd = 0.
2641
- */
2642
- realized_pnl_pct?: number | null;
3099
+ /** Format: int64 */
3100
+ last_block: number;
2643
3101
  };
3102
+ /**
3103
+ * @description Sort field for category PnL results. Supported values cover realized
3104
+ * PnL, volume, trade counts, fees, rewards, positions, and trade timing.
3105
+ * @enum {string}
3106
+ */
3107
+ CategoryPnlSortBy: "realized_pnl_usd" | "total_pnl_usd" | "unrealized_pnl_usd" | "total_volume_usd" | "buy_volume_usd" | "sell_volume_usd" | "redemption_volume_usd" | "merge_volume_usd" | "split_volume_usd" | "total_converts" | "total_fees" | "total_buys" | "total_sells" | "total_splits" | "total_shares_bought" | "markets_traded" | "markets_resolved" | "markets_won" | "markets_lost" | "market_win_rate_pct" | "avg_win_usd" | "avg_loss_usd" | "profit_factor" | "total_wins_usd" | "total_losses_usd" | "best_trade_pnl_usd" | "worst_trade_pnl_usd" | "avg_hold_time_seconds" | "buy_count" | "sell_count" | "redeem_count" | "merge_count" | "split_count" | "outcomes_traded" | "first_trade_at" | "last_trade_at";
3108
+ /**
3109
+ * @description Lookback window for percentage-change endpoints.
3110
+ * @enum {string}
3111
+ */
3112
+ ChangeTimeframe: "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
3113
+ /** @enum {string} */
3114
+ ChartResolution: "1H" | "6H" | "1D" | "1W" | "1M" | "ALL";
3115
+ /**
3116
+ * @description Direction filter for spike webhooks.
3117
+ * @enum {string}
3118
+ */
3119
+ SpikeDirection: "up" | "down" | "both";
3120
+ /** @description Output payload for Split trades (deposit collateral → receive outcome tokens). */
3121
+ SplitTrade: {
3122
+ id: string;
3123
+ hash: string;
3124
+ /** Format: int64 */
3125
+ block?: number | null;
3126
+ /** Format: int64 */
3127
+ confirmed_at?: number | null;
3128
+ /** Format: int64 */
3129
+ received_at?: number | null;
3130
+ /** Format: int64 */
3131
+ log_index?: number | null;
3132
+ /** Format: int64 */
3133
+ block_index?: number | null;
3134
+ trader: components["schemas"]["TraderInfo"];
3135
+ condition_id?: string | null;
3136
+ question?: string | null;
3137
+ image_url?: string | null;
3138
+ slug?: string | null;
3139
+ event_slug?: string | null;
3140
+ /** Format: double */
3141
+ usd_amount: number;
3142
+ /** @description Per-position mint amounts */
3143
+ position_details?: components["schemas"]["PositionDetail"][];
3144
+ exchange: components["schemas"]["PolymarketExchange"];
3145
+ };
3146
+ /** @enum {string} */
3147
+ SortDirection: "asc" | "desc";
2644
3148
  /** @description CLOB reward (public API format) */
2645
3149
  ClobReward: {
2646
3150
  id: string;
@@ -2951,6 +3455,110 @@ export interface components {
2951
3455
  slug?: string | null;
2952
3456
  event_slug?: string | null;
2953
3457
  };
3458
+ EventEntry: {
3459
+ event_slug?: string | null;
3460
+ title?: string | null;
3461
+ image_url?: string | null;
3462
+ trader?: null | components["schemas"]["TraderProfile"];
3463
+ /** Format: double */
3464
+ realized_pnl_usd: number;
3465
+ /** Format: double */
3466
+ total_pnl_usd?: number;
3467
+ /** Format: double */
3468
+ unrealized_pnl_usd?: number;
3469
+ /** Format: double */
3470
+ realized_pnl_pct?: number | null;
3471
+ /** Format: double */
3472
+ total_pnl_pct?: number | null;
3473
+ /** Format: double */
3474
+ total_volume_usd: number;
3475
+ /** Format: double */
3476
+ buy_usd: number;
3477
+ /** Format: double */
3478
+ sell_usd: number;
3479
+ /** Format: double */
3480
+ redemption_usd: number;
3481
+ /** Format: double */
3482
+ merge_usd: number;
3483
+ /** Format: double */
3484
+ convert_collateral_usd?: number;
3485
+ /**
3486
+ * Format: double
3487
+ * @description USD collateral split into outcome tokens in the selected timeframe.
3488
+ */
3489
+ split_volume_usd?: number;
3490
+ /** Format: double */
3491
+ total_fees: number;
3492
+ /** Format: int64 */
3493
+ total_buys: number;
3494
+ /** Format: int64 */
3495
+ total_sells: number;
3496
+ /** Format: int64 */
3497
+ total_redemptions: number;
3498
+ /** Format: int64 */
3499
+ total_merges: number;
3500
+ /**
3501
+ * Format: int64
3502
+ * @description Number of split transactions in the selected timeframe.
3503
+ */
3504
+ total_splits?: number;
3505
+ /** Format: double */
3506
+ total_shares_bought: number;
3507
+ /** Format: int64 */
3508
+ markets_traded: number;
3509
+ /** Format: int64 */
3510
+ markets_resolved: number;
3511
+ /** Format: int64 */
3512
+ winning_markets: number;
3513
+ /** Format: int64 */
3514
+ losing_markets: number;
3515
+ /** Format: double */
3516
+ market_win_rate_pct: number;
3517
+ /** Format: double */
3518
+ avg_win_usd: number;
3519
+ /** Format: double */
3520
+ avg_loss_usd: number;
3521
+ /** Format: double */
3522
+ profit_factor: number;
3523
+ /** Format: double */
3524
+ total_wins_usd: number;
3525
+ /** Format: double */
3526
+ total_losses_usd: number;
3527
+ /** Format: double */
3528
+ best_trade_pnl_usd?: number | null;
3529
+ best_trade_condition_id?: string | null;
3530
+ /** Format: double */
3531
+ worst_trade_pnl_usd?: number | null;
3532
+ worst_trade_condition_id?: string | null;
3533
+ best_trade_metadata?: null | components["schemas"]["TradeMarketRef"];
3534
+ worst_trade_metadata?: null | components["schemas"]["TradeMarketRef"];
3535
+ /** Format: double */
3536
+ avg_hold_time_seconds: number;
3537
+ /** Format: int64 */
3538
+ buy_count: number;
3539
+ /** Format: int64 */
3540
+ sell_count: number;
3541
+ /** Format: int64 */
3542
+ redeem_count: number;
3543
+ /** Format: int64 */
3544
+ merge_count: number;
3545
+ /** Format: int64 */
3546
+ split_count: number;
3547
+ /** Format: int64 */
3548
+ converted_count: number;
3549
+ /** Format: double */
3550
+ converted_shares_gained: number;
3551
+ /** Format: double */
3552
+ converted_shares_lost: number;
3553
+ /** Format: int64 */
3554
+ outcomes_traded: number;
3555
+ /** Format: int64 */
3556
+ first_trade_at?: number | null;
3557
+ /** Format: int64 */
3558
+ last_trade_at?: number | null;
3559
+ /** Format: int64 */
3560
+ last_block: number;
3561
+ };
2954
3562
  /** @description Enriched market data for event API responses */
2955
3563
  EventMarket: {
2956
3564
  /** @default */
@@ -3034,115 +3642,92 @@ export interface components {
3034
3642
  event_slug: string;
3035
3643
  timeframe: string;
3036
3644
  /** Format: double */
3037
- volume_usd: number;
3645
+ volume_usd: number;
3646
+ /** Format: double */
3647
+ shares_volume: number;
3648
+ /** Format: double */
3649
+ builder_usd_volume: number;
3650
+ /** Format: double */
3651
+ builder_shares_volume: number;
3652
+ /** Format: double */
3653
+ fees: number;
3654
+ /** Format: double */
3655
+ builder_fees: number;
3656
+ /** Format: int32 */
3657
+ txns: number;
3658
+ /** Format: int32 */
3659
+ builder_txns: number;
3660
+ /** Format: int32 */
3661
+ unique_traders: number;
3662
+ /** Format: int32 */
3663
+ unique_makers: number;
3664
+ /** Format: int32 */
3665
+ unique_takers: number;
3666
+ /** Format: int32 */
3667
+ unique_builder_traders: number;
3668
+ /** Format: double */
3669
+ avg_trade_usd: number;
3670
+ /** Format: double */
3671
+ avg_trade_shares: number;
3672
+ };
3673
+ /**
3674
+ * @description Sort field for event PnL results. Supported values cover realized PnL,
3675
+ * total volume, shares bought, and first or last trade time.
3676
+ * @enum {string}
3677
+ */
3678
+ EventPnlSortBy: "realized_pnl_usd" | "total_pnl_usd" | "unrealized_pnl_usd" | "total_volume_usd" | "total_shares_bought" | "first_trade_at" | "last_trade_at";
3679
+ /** @enum {string} */
3680
+ EventSortBy: "volume" | "txns" | "unique_traders" | "title" | "creation_date" | "start_date" | "end_date" | "relevance";
3681
+ TraderAnalyticsMetricPctChange: {
3682
+ /** Format: double */
3683
+ volume_usd?: number | null;
3684
+ /** Format: double */
3685
+ buy_volume_usd?: number | null;
3686
+ /** Format: double */
3687
+ sell_volume_usd?: number | null;
3688
+ /** Format: double */
3689
+ merge_volume_usd?: number | null;
3690
+ /** Format: double */
3691
+ split_volume_usd?: number | null;
3692
+ /** Format: double */
3693
+ converted_count?: number | null;
3694
+ /** Format: double */
3695
+ converted_collateral_usd?: number | null;
3696
+ /** Format: double */
3697
+ converted_shares_gained?: number | null;
3698
+ /** Format: double */
3699
+ converted_shares_lost?: number | null;
3700
+ /** Format: double */
3701
+ maker_rebate_count?: number | null;
3702
+ /** Format: double */
3703
+ maker_rebate_volume_usd?: number | null;
3704
+ /** Format: double */
3705
+ reward_count?: number | null;
3706
+ /** Format: double */
3707
+ reward_volume_usd?: number | null;
3708
+ /** Format: double */
3709
+ yield_count?: number | null;
3038
3710
  /** Format: double */
3039
- shares_volume: number;
3711
+ yield_volume_usd?: number | null;
3040
3712
  /** Format: double */
3041
- builder_usd_volume: number;
3713
+ txn_count?: number | null;
3042
3714
  /** Format: double */
3043
- builder_shares_volume: number;
3715
+ fees_usd?: number | null;
3044
3716
  /** Format: double */
3045
- fees: number;
3717
+ shares_volume?: number | null;
3046
3718
  /** Format: double */
3047
- builder_fees: number;
3048
- /** Format: int32 */
3049
- txns: number;
3050
- /** Format: int32 */
3051
- builder_txns: number;
3052
- /** Format: int32 */
3053
- unique_traders: number;
3054
- /** Format: int32 */
3055
- unique_makers: number;
3056
- /** Format: int32 */
3057
- unique_takers: number;
3058
- /** Format: int32 */
3059
- unique_builder_traders: number;
3719
+ buy_shares_volume?: number | null;
3060
3720
  /** Format: double */
3061
- avg_trade_usd: number;
3721
+ sell_shares_volume?: number | null;
3062
3722
  /** Format: double */
3063
- avg_trade_shares: number;
3723
+ yes_shares_volume?: number | null;
3724
+ /** Format: double */
3725
+ no_shares_volume?: number | null;
3726
+ /** Format: double */
3727
+ yes_volume_usd?: number | null;
3728
+ /** Format: double */
3729
+ no_volume_usd?: number | null;
3064
3730
  };
3065
- /** @enum {string} */
3066
- EventPnlSortBy: "realized_pnl_usd" | "total_volume_usd" | "markets_traded" | "total_fees" | "realized_pnl_pct";
3067
- /** @enum {string} */
3068
- EventSortBy: "volume" | "txns" | "unique_traders" | "title" | "creation_date" | "start_date" | "end_date" | "relevance";
3069
- /**
3070
- * @description Tagged enum for all trade types — serializes with `"trade_type": "..."` discriminator
3071
- * and only includes fields relevant to each type.
3072
- */
3073
- TradeEvent: (components["schemas"]["OrderFilledTrade"] & {
3074
- /** @enum {string} */
3075
- trade_type: "OrderFilled";
3076
- }) | (components["schemas"]["OrderFilledTrade"] & {
3077
- /** @enum {string} */
3078
- trade_type: "OrdersMatched";
3079
- }) | (components["schemas"]["OrderFilledTrade"] & {
3080
- /** @enum {string} */
3081
- trade_type: "MakerRebate";
3082
- }) | (components["schemas"]["OrderFilledTrade"] & {
3083
- /** @enum {string} */
3084
- trade_type: "Reward";
3085
- }) | (components["schemas"]["OrderFilledTrade"] & {
3086
- /** @enum {string} */
3087
- trade_type: "Yield";
3088
- }) | (components["schemas"]["RedemptionTrade"] & {
3089
- /** @enum {string} */
3090
- trade_type: "Redemption";
3091
- }) | (components["schemas"]["MergeTrade"] & {
3092
- /** @enum {string} */
3093
- trade_type: "Merge";
3094
- }) | (components["schemas"]["SplitTrade"] & {
3095
- /** @enum {string} */
3096
- trade_type: "Split";
3097
- }) | (components["schemas"]["PositionsConvertedTrade"] & {
3098
- /** @enum {string} */
3099
- trade_type: "PositionsConverted";
3100
- }) | (components["schemas"]["CancelledTrade"] & {
3101
- /** @enum {string} */
3102
- trade_type: "Cancelled";
3103
- }) | (components["schemas"]["QuestionInitializedEvent"] & {
3104
- /** @enum {string} */
3105
- trade_type: "Initialization";
3106
- }) | (components["schemas"]["AssertionMadeEvent"] & {
3107
- /** @enum {string} */
3108
- trade_type: "Proposal";
3109
- }) | (components["schemas"]["AssertionDisputedEvent"] & {
3110
- /** @enum {string} */
3111
- trade_type: "Dispute";
3112
- }) | (components["schemas"]["AssertionSettledEvent"] & {
3113
- /** @enum {string} */
3114
- trade_type: "Settled";
3115
- }) | (components["schemas"]["QuestionResolvedEvent"] & {
3116
- /** @enum {string} */
3117
- trade_type: "Resolution";
3118
- }) | (components["schemas"]["ConditionResolutionEvent"] & {
3119
- /** @enum {string} */
3120
- trade_type: "ConditionResolution";
3121
- }) | (components["schemas"]["QuestionResetEvent"] & {
3122
- /** @enum {string} */
3123
- trade_type: "Reset";
3124
- }) | (components["schemas"]["QuestionFlaggedEvent"] & {
3125
- /** @enum {string} */
3126
- trade_type: "Flag";
3127
- }) | (components["schemas"]["QuestionUnflaggedEvent"] & {
3128
- /** @enum {string} */
3129
- trade_type: "Unflag";
3130
- }) | (components["schemas"]["QuestionPausedEvent"] & {
3131
- /** @enum {string} */
3132
- trade_type: "Pause";
3133
- }) | (components["schemas"]["QuestionUnpausedEvent"] & {
3134
- /** @enum {string} */
3135
- trade_type: "Unpause";
3136
- }) | (components["schemas"]["QuestionEmergencyResolvedEvent"] & {
3137
- /** @enum {string} */
3138
- trade_type: "ManualResolution";
3139
- }) | (components["schemas"]["NegRiskOutcomeReportedEvent"] & {
3140
- /** @enum {string} */
3141
- trade_type: "NegRiskOutcomeReported";
3142
- }) | (components["schemas"]["RegisterTokenTrade"] & {
3143
- /** @enum {string} */
3144
- trade_type: "RegisterToken";
3145
- });
3146
3731
  /**
3147
3732
  * @description One tag's stats aggregated across every builder routing activity into it.
3148
3733
  *
@@ -3212,104 +3797,113 @@ export interface components {
3212
3797
  };
3213
3798
  /** @enum {string} */
3214
3799
  GlobalChangeTimeframe: "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
3215
- /**
3216
- * @description Response body for `GET /polymarket/analytics/counts`.
3217
- * Cumulative analytics metrics plus entity-count enrichment.
3218
- */
3219
- GlobalCountsResponse: {
3800
+ GlobalEntry: {
3801
+ trader: components["schemas"]["TraderProfile"];
3802
+ /** Format: double */
3803
+ realized_pnl_usd: number;
3804
+ /** Format: double */
3805
+ total_pnl_usd?: number;
3806
+ /** Format: double */
3807
+ unrealized_pnl_usd?: number;
3220
3808
  /**
3221
- * Format: int32
3222
- * @description Unix-second timestamp of the latest block reflected in the metrics.
3809
+ * Format: double
3810
+ * @description Wallet cash held in pUSD + USDC at this point in time. Stable per block.
3223
3811
  */
3224
- ts: number;
3812
+ usd_balance?: number;
3813
+ /** Format: double */
3814
+ realized_pnl_pct?: number | null;
3815
+ /** Format: double */
3816
+ total_pnl_pct?: number | null;
3817
+ /** Format: double */
3818
+ open_positions_value: number;
3819
+ /** Format: int64 */
3820
+ events_traded: number;
3821
+ /** Format: int64 */
3822
+ categories_traded: number;
3823
+ /** Format: int64 */
3824
+ markets_traded: number;
3825
+ /** Format: int64 */
3826
+ markets_won: number;
3827
+ /** Format: int64 */
3828
+ markets_lost: number;
3829
+ /** Format: double */
3830
+ market_win_rate_pct: number;
3831
+ /** Format: double */
3832
+ avg_win_usd: number;
3833
+ /** Format: double */
3834
+ avg_loss_usd: number;
3835
+ /** Format: double */
3836
+ profit_factor: number;
3837
+ /** Format: int64 */
3838
+ total_buys: number;
3839
+ /** Format: int64 */
3840
+ total_sells: number;
3841
+ /** Format: int64 */
3842
+ total_redemptions: number;
3843
+ /** Format: int64 */
3844
+ total_merges: number;
3225
3845
  /**
3226
3846
  * Format: int64
3227
- * @description Latest block number processed.
3847
+ * @description Number of split transactions in the selected timeframe.
3228
3848
  */
3229
- block: number;
3849
+ total_splits?: number;
3850
+ /** Format: int64 */
3851
+ converted_count: number;
3230
3852
  /** Format: double */
3231
- volume_usd: number;
3853
+ converted_shares_gained: number;
3854
+ /** Format: double */
3855
+ converted_shares_lost: number;
3856
+ /** Format: double */
3857
+ total_volume_usd: number;
3232
3858
  /** Format: double */
3233
3859
  buy_volume_usd: number;
3234
3860
  /** Format: double */
3235
3861
  sell_volume_usd: number;
3236
- /**
3237
- * Format: int64
3238
- * @description Distinct addresses that have ever traded on Polymarket (lifetime).
3239
- */
3240
- unique_traders: number;
3241
- /**
3242
- * Format: int64
3243
- * @description Distinct makers ever active (lifetime distinct).
3244
- */
3245
- unique_makers: number;
3246
- /**
3247
- * Format: int64
3248
- * @description Distinct takers ever active (lifetime distinct).
3249
- */
3250
- unique_takers: number;
3251
- /** Format: int64 */
3252
- txn_count: number;
3253
- /** Format: int64 */
3254
- buy_count: number;
3255
- /** Format: int64 */
3256
- sell_count: number;
3257
- /** Format: int64 */
3258
- redemption_count: number;
3259
3862
  /** Format: double */
3260
3863
  redemption_volume_usd: number;
3261
- /** Format: int64 */
3262
- merge_count: number;
3263
3864
  /** Format: double */
3264
3865
  merge_volume_usd: number;
3265
- /** Format: int64 */
3266
- split_count: number;
3267
3866
  /** Format: double */
3268
- split_volume_usd: number;
3867
+ convert_collateral_usd?: number;
3868
+ /**
3869
+ * Format: double
3870
+ * @description USD collateral split into outcome tokens in the selected timeframe.
3871
+ */
3872
+ split_volume_usd?: number;
3269
3873
  /** Format: double */
3270
- fees_usd: number;
3874
+ total_fees: number;
3271
3875
  /** Format: double */
3272
- shares_volume: number;
3876
+ total_wins_usd: number;
3273
3877
  /** Format: double */
3274
- yes_volume_usd: number;
3878
+ total_losses_usd: number;
3275
3879
  /** Format: double */
3276
- no_volume_usd: number;
3277
- /** Format: int64 */
3278
- yes_count: number;
3279
- /** Format: int64 */
3280
- no_count: number;
3880
+ best_trade_pnl_usd?: number | null;
3881
+ best_trade_condition_id?: string | null;
3882
+ /** Format: double */
3883
+ worst_trade_pnl_usd?: number | null;
3884
+ worst_trade_condition_id?: string | null;
3885
+ best_trade_metadata?: null | components["schemas"]["TradeMarketRef"];
3886
+ worst_trade_metadata?: null | components["schemas"]["TradeMarketRef"];
3887
+ /** Format: double */
3888
+ avg_hold_time_seconds: number;
3281
3889
  /** Format: int64 */
3282
- buy_dist_under_10: number;
3890
+ first_trade_at?: number | null;
3283
3891
  /** Format: int64 */
3284
- buy_dist_10_100: number;
3892
+ last_trade_at?: number | null;
3285
3893
  /** Format: int64 */
3286
- buy_dist_100_1k: number;
3894
+ maker_rebate_count: number;
3895
+ /** Format: double */
3896
+ maker_rebate_usd: number;
3287
3897
  /** Format: int64 */
3288
- buy_dist_1k_10k: number;
3898
+ reward_count: number;
3899
+ /** Format: double */
3900
+ reward_usd: number;
3289
3901
  /** Format: int64 */
3290
- buy_dist_10k_50k: number;
3902
+ yield_count: number;
3903
+ /** Format: double */
3904
+ yield_usd: number;
3291
3905
  /** Format: int64 */
3292
- buy_dist_50k_plus: number;
3293
- /**
3294
- * Format: int64
3295
- * @description Total number of tags.
3296
- */
3297
- tags: number;
3298
- /**
3299
- * Format: int64
3300
- * @description Total number of events.
3301
- */
3302
- events: number;
3303
- /**
3304
- * Format: int64
3305
- * @description Total number of markets.
3306
- */
3307
- markets: number;
3308
- /**
3309
- * Format: int64
3310
- * @description Total number of unique positions / traders.
3311
- */
3312
- positions: number;
3906
+ open_position_count: number;
3313
3907
  };
3314
3908
  GlobalPctChange: {
3315
3909
  /** Format: double */
@@ -3418,23 +4012,11 @@ export interface components {
3418
4012
  /** Format: int64 */
3419
4013
  last_trade_at?: number | null;
3420
4014
  };
3421
- /** @description Individual holder data */
3422
- Holder: {
3423
- /** @description Trader profile information */
3424
- trader: components["schemas"]["Trader"];
3425
- /** @description Position shares held (raw balance as string for precision) */
3426
- shares: string;
3427
- /** @description USD value of shares (shares * latest price) */
3428
- shares_usd?: string | null;
3429
- /** @description USD balance of wallet (USDe on Polygon) */
3430
- usd_balance?: string | null;
3431
- pnl?: null | components["schemas"]["HolderPnl"];
3432
- };
3433
- /** @description Holder statistics data point (single time bucket) */
3434
- HolderHistoryCandle: {
4015
+ /** @description Holder count at a point in a history series. */
4016
+ HolderCountHistoryCandle: {
3435
4017
  /**
3436
4018
  * Format: int64
3437
- * @description Bucket timestamp (Unix seconds).
4019
+ * @description Bucket timestamp as Unix seconds.
3438
4020
  */
3439
4021
  t: number;
3440
4022
  /**
@@ -3447,134 +4029,175 @@ export interface components {
3447
4029
  * @description Latest block represented by this bucket.
3448
4030
  */
3449
4031
  block?: number | null;
3450
- /**
3451
- * Format: double
3452
- * @description Total open share balance at the end of the bucket. Position history only.
3453
- */
3454
- total_balance?: number | null;
3455
- /**
3456
- * Format: double
3457
- * @description Total holder cost basis at the end of the bucket. Position history only.
3458
- */
3459
- total_cost_basis?: number | null;
3460
- /**
3461
- * Format: int64
3462
- * @description Unique holders across the market at the end of the bucket. Position history only.
3463
- */
3464
- condition_holder_count?: number | null;
4032
+ };
4033
+ MarketEntry: {
4034
+ condition_id?: string | null;
4035
+ event_slug?: string | null;
4036
+ market_slug?: string | null;
4037
+ title?: string | null;
4038
+ image_url?: string | null;
4039
+ question?: string | null;
4040
+ trader?: null | components["schemas"]["TraderProfile"];
4041
+ /** Format: double */
4042
+ realized_pnl_usd: number;
4043
+ /** Format: double */
4044
+ total_pnl_usd?: number;
4045
+ /** Format: double */
4046
+ unrealized_pnl_usd?: number;
4047
+ /** Format: double */
4048
+ realized_pnl_pct?: number | null;
4049
+ /** Format: double */
4050
+ total_pnl_pct?: number | null;
4051
+ /** Format: double */
4052
+ total_volume_usd: number;
4053
+ /** Format: double */
4054
+ buy_volume_usd: number;
4055
+ /** Format: double */
4056
+ sell_volume_usd: number;
4057
+ /** Format: double */
4058
+ redemption_volume_usd: number;
4059
+ /** Format: double */
4060
+ merge_volume_usd: number;
4061
+ /** Format: double */
4062
+ convert_collateral_usd?: number;
4063
+ /** Format: double */
4064
+ total_fees: number;
4065
+ /** Format: int64 */
4066
+ total_buys: number;
4067
+ /** Format: int64 */
4068
+ total_sells: number;
3465
4069
  /**
3466
4070
  * Format: int64
3467
- * @description Unique holders across the event at the end of the bucket. Position history only.
4071
+ * @description Number of split transactions in the selected timeframe.
3468
4072
  */
3469
- event_holder_count?: number | null;
3470
- };
3471
- /** @description Holder-level PnL data, included when `include_pnl=true` */
3472
- HolderPnl: {
3473
- /** Format: double */
3474
- avg_entry_price?: number | null;
3475
- total_cost_usd?: string | null;
3476
- unrealized_pnl_usd?: string | null;
3477
- realized_sell_pnl_usd?: string | null;
3478
- /** Format: double */
3479
- avg_exit_price?: number | null;
4073
+ total_splits?: number;
3480
4074
  /** Format: double */
3481
- buy_usd?: number | null;
4075
+ total_shares_bought: number;
3482
4076
  /** Format: double */
3483
- sell_usd?: number | null;
4077
+ total_shares_sold: number;
3484
4078
  /** Format: int64 */
3485
- total_buys?: number | null;
4079
+ buy_count: number;
3486
4080
  /** Format: int64 */
3487
- total_sells?: number | null;
3488
- /** Format: double */
3489
- total_fees?: number | null;
4081
+ sell_count: number;
3490
4082
  /** Format: int64 */
3491
- first_trade_at?: number | null;
4083
+ redeem_count: number;
3492
4084
  /** Format: int64 */
3493
- last_trade_at?: number | null;
3494
- };
3495
- /**
3496
- * @description Market category filter for the trader leaderboard.
3497
- * Mirrors `common::gamma::categories::Category` plus `overall` (= all).
3498
- * @enum {string}
3499
- */
3500
- LeaderboardCategory: "overall" | "politics" | "sports" | "crypto" | "finance" | "culture" | "mentions" | "weather" | "economics" | "tech";
3501
- /**
3502
- * @description Flat response row. `trader` is the canonical `TraderInfo` used across
3503
- * endpoints; enrichment fields sit at the top level. Fields other than
3504
- * `trader`, `rank`, `pnl`, and `timeframe` may be `null` when PnL data for
3505
- * the trader in the selected timeframe isn't yet available.
3506
- */
3507
- LeaderboardEntry: {
4085
+ merge_count: number;
3508
4086
  /** Format: int64 */
3509
- rank?: number | null;
3510
- trader: components["schemas"]["TraderInfo"];
4087
+ split_count: number;
4088
+ /**
4089
+ * Format: double
4090
+ * @description USD collateral split into outcome tokens in the selected timeframe.
4091
+ */
4092
+ split_volume_usd?: number;
4093
+ /** Format: int64 */
4094
+ converted_count: number;
3511
4095
  /** Format: double */
3512
- pnl?: number | null;
4096
+ converted_shares_gained: number;
4097
+ /** Format: double */
4098
+ converted_shares_lost: number;
3513
4099
  /** Format: int64 */
3514
- events_traded?: number | null;
4100
+ outcomes_traded: number;
4101
+ resolved: boolean;
4102
+ won?: boolean | null;
3515
4103
  /** Format: int64 */
3516
- markets_traded?: number | null;
4104
+ first_trade_at?: number | null;
3517
4105
  /** Format: int64 */
3518
- markets_won?: number | null;
4106
+ last_trade_at?: number | null;
3519
4107
  /** Format: int64 */
3520
- markets_lost?: number | null;
4108
+ snapshot_ts?: number | null;
4109
+ /** Format: int64 */
4110
+ last_block: number;
4111
+ };
4112
+ /** @description Market outcome holder. */
4113
+ MarketHolder: {
4114
+ /** @description Trader profile. */
4115
+ trader: components["schemas"]["Trader"];
4116
+ /** @description Position shares held (raw balance as decimal string for precision). */
4117
+ shares: string;
4118
+ /** @description USD value of shares (shares × latest price). */
4119
+ shares_usd?: string | null;
4120
+ /** @description USD balance of the holder's wallet. */
4121
+ usd_balance?: string | null;
4122
+ pnl?: null | components["schemas"]["MarketHolderPnl"];
4123
+ };
4124
+ /** @description Market-level PnL for a holder, included when `include_pnl=true`. */
4125
+ MarketHolderPnl: {
3521
4126
  /** Format: double */
3522
- market_win_rate_pct?: number | null;
4127
+ realized_pnl_usd: number;
3523
4128
  /** Format: double */
3524
- total_volume_usd?: number | null;
4129
+ total_pnl_usd: number;
3525
4130
  /** Format: double */
3526
- buy_volume_usd?: number | null;
4131
+ unrealized_pnl_usd: number;
3527
4132
  /** Format: double */
3528
- sell_volume_usd?: number | null;
4133
+ realized_pnl_pct?: number | null;
3529
4134
  /** Format: double */
3530
- redemption_volume_usd?: number | null;
4135
+ total_pnl_pct?: number | null;
3531
4136
  /** Format: double */
3532
- merge_volume_usd?: number | null;
3533
- /** Format: int64 */
3534
- total_buys?: number | null;
3535
- /** Format: int64 */
3536
- total_sells?: number | null;
4137
+ total_volume_usd: number;
4138
+ /** Format: double */
4139
+ buy_volume_usd: number;
4140
+ /** Format: double */
4141
+ sell_volume_usd: number;
4142
+ /** Format: double */
4143
+ redemption_volume_usd: number;
4144
+ /** Format: double */
4145
+ merge_volume_usd: number;
4146
+ /** Format: double */
4147
+ convert_collateral_usd: number;
4148
+ /** Format: double */
4149
+ total_fees: number;
3537
4150
  /** Format: int64 */
3538
- total_redemptions?: number | null;
4151
+ total_buys: number;
3539
4152
  /** Format: int64 */
3540
- total_merges?: number | null;
4153
+ total_sells: number;
3541
4154
  /** Format: int64 */
3542
- total_trades?: number | null;
4155
+ total_splits: number;
3543
4156
  /** Format: double */
3544
- total_fees?: number | null;
4157
+ total_shares_bought: number;
3545
4158
  /** Format: double */
3546
- avg_pnl_per_market?: number | null;
4159
+ total_shares_sold: number;
4160
+ /** Format: int64 */
4161
+ buy_count: number;
4162
+ /** Format: int64 */
4163
+ sell_count: number;
4164
+ /** Format: int64 */
4165
+ redeem_count: number;
4166
+ /** Format: int64 */
4167
+ merge_count: number;
4168
+ /** Format: int64 */
4169
+ split_count: number;
3547
4170
  /** Format: double */
3548
- avg_pnl_per_trade?: number | null;
4171
+ split_volume_usd: number;
4172
+ /** Format: int64 */
4173
+ converted_count: number;
3549
4174
  /** Format: double */
3550
- avg_hold_time_seconds?: number | null;
4175
+ converted_shares_gained: number;
3551
4176
  /** Format: double */
3552
- best_trade_pnl_usd?: number | null;
3553
- best_trade_condition_id?: string | null;
4177
+ converted_shares_lost: number;
4178
+ /** Format: int64 */
4179
+ outcomes_traded: number;
4180
+ resolved: boolean;
4181
+ won?: boolean | null;
3554
4182
  /** Format: int64 */
3555
4183
  first_trade_at?: number | null;
3556
4184
  /** Format: int64 */
3557
4185
  last_trade_at?: number | null;
3558
4186
  };
3559
- /**
3560
- * @description Sort key for the trader leaderboard (`GET /polymarket/trader/leaderboard`).
3561
- * @enum {string}
3562
- */
3563
- LeaderboardSortBy: "pnl" | "volume";
3564
- /** @description Response for market (condition_id) holders endpoint */
4187
+ /** @description Response for market (condition_id) holders endpoint. */
3565
4188
  MarketHoldersResponse: {
3566
- /** @description Market condition ID */
4189
+ /** @description Market condition ID. */
3567
4190
  condition_id: string;
3568
- /** @description Market question/title */
4191
+ /** @description Market question / title. */
3569
4192
  question?: string | null;
3570
- /** @description Market slug */
4193
+ /** @description Market slug. */
3571
4194
  slug?: string | null;
3572
4195
  /**
3573
4196
  * Format: int64
3574
4197
  * @description Total unique holders across all outcomes of this market.
3575
4198
  */
3576
4199
  total_holders: number;
3577
- /** @description Holders grouped by outcome */
4200
+ /** @description Holders grouped by outcome. */
3578
4201
  outcomes: components["schemas"]["OutcomeHolders"][];
3579
4202
  };
3580
4203
  /** @description Market outcome with timeframe metrics (websocket API format) */
@@ -3627,8 +4250,11 @@ export interface components {
3627
4250
  */
3628
4251
  latest_confirmed_at: number | null;
3629
4252
  };
3630
- /** @enum {string} */
3631
- MarketPnlSortBy: "realized_pnl_usd" | "buy_usd" | "total_buys" | "total_fees" | "outcomes_traded" | "realized_pnl_pct";
4253
+ /**
4254
+ * @description Sort field for per-trader market PnL results.
4255
+ * @enum {string}
4256
+ */
4257
+ MarketPnlSortBy: "realized_pnl_usd" | "total_pnl_usd" | "unrealized_pnl_usd" | "total_volume_usd" | "buy_volume_usd" | "sell_volume_usd" | "redemption_volume_usd" | "merge_volume_usd" | "split_volume_usd" | "total_fees" | "total_buys" | "total_sells" | "total_splits" | "total_shares_bought" | "total_shares_sold" | "redeem_count" | "merge_count" | "split_count" | "outcomes_traded" | "first_trade_at" | "last_trade_at" | "last_block";
3632
4258
  /** @description Formatted market response with structured metrics, tags, outcomes, and event */
3633
4259
  MarketResponse: {
3634
4260
  condition_id: string;
@@ -3737,38 +4363,6 @@ export interface components {
3737
4363
  position_details?: components["schemas"]["PositionDetail"][];
3738
4364
  exchange: components["schemas"]["PolymarketExchange"];
3739
4365
  };
3740
- /**
3741
- * @description Per-metric % change. `None` when the window predates the entity's data
3742
- * or the previous value was zero (division undefined).
3743
- */
3744
- MetricPctChange: {
3745
- /** Format: double */
3746
- volume_usd?: number | null;
3747
- /** Format: double */
3748
- buy_volume_usd?: number | null;
3749
- /** Format: double */
3750
- sell_volume_usd?: number | null;
3751
- /** Format: double */
3752
- merge_volume_usd?: number | null;
3753
- /** Format: double */
3754
- split_volume_usd?: number | null;
3755
- /** Format: double */
3756
- unique_traders?: number | null;
3757
- /** Format: double */
3758
- unique_makers?: number | null;
3759
- /** Format: double */
3760
- unique_takers?: number | null;
3761
- /** Format: double */
3762
- txn_count?: number | null;
3763
- /** Format: double */
3764
- fees_usd?: number | null;
3765
- /** Format: double */
3766
- shares_volume?: number | null;
3767
- /** Format: double */
3768
- yes_volume_usd?: number | null;
3769
- /** Format: double */
3770
- no_volume_usd?: number | null;
3771
- };
3772
4366
  /** @enum {string} */
3773
4367
  MetricsTimeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d" | "lifetime";
3774
4368
  /** @description NegRisk Adapter: outcome reported for a neg-risk market question. */
@@ -3793,31 +4387,12 @@ export interface components {
3793
4387
  slug?: string | null;
3794
4388
  event_slug?: string | null;
3795
4389
  };
3796
- /** @description Output payload for Split trades (deposit collateral → receive outcome tokens). */
3797
- SplitTrade: {
3798
- id: string;
3799
- hash: string;
3800
- /** Format: int64 */
3801
- block?: number | null;
3802
- /** Format: int64 */
3803
- confirmed_at?: number | null;
3804
- /** Format: int64 */
3805
- received_at?: number | null;
3806
- /** Format: int64 */
3807
- log_index?: number | null;
3808
- /** Format: int64 */
3809
- block_index?: number | null;
3810
- trader: components["schemas"]["TraderInfo"];
3811
- condition_id?: string | null;
3812
- question?: string | null;
3813
- image_url?: string | null;
3814
- slug?: string | null;
3815
- event_slug?: string | null;
3816
- /** Format: double */
3817
- usd_amount: number;
3818
- /** @description Per-position mint amounts */
3819
- position_details?: components["schemas"]["PositionDetail"][];
3820
- exchange: components["schemas"]["PolymarketExchange"];
4390
+ /**
4391
+ * @description `TagBuilderRow` with builder display metadata (name, icon, links) merged
4392
+ * onto each row. Returned by `/polymarket/builders/tags/{tag}`.
4393
+ */
4394
+ TagBuilderRowWithMetadata: components["schemas"]["TagBuilderRow"] & {
4395
+ metadata?: null | components["schemas"]["BuilderMetadataInline"];
3821
4396
  };
3822
4397
  /**
3823
4398
  * @description Tagged enum for all oracle event types — serializes with `"event_type": "..."` discriminator
@@ -3928,38 +4503,13 @@ export interface components {
3928
4503
  */
3929
4504
  builder_fee?: number | null;
3930
4505
  };
3931
- TopTraderMarketEntry: {
3932
- trader: components["schemas"]["TraderInfo"];
3933
- /** Format: double */
3934
- realized_pnl_usd?: number | null;
3935
- /** Format: double */
3936
- realized_pnl_pct?: number | null;
3937
- /** Format: double */
3938
- buy_usd?: number | null;
3939
- /** Format: double */
3940
- sell_usd?: number | null;
3941
- /** Format: double */
3942
- redemption_usd?: number | null;
3943
- /** Format: double */
3944
- merge_usd?: number | null;
3945
- /** Format: double */
3946
- total_fees?: number | null;
3947
- /** Format: int64 */
3948
- total_buys?: number | null;
3949
- /** Format: int64 */
3950
- total_sells?: number | null;
3951
- /** Format: int64 */
3952
- total_redemptions?: number | null;
3953
- /** Format: int64 */
3954
- total_merges?: number | null;
3955
- /** Format: int64 */
3956
- outcomes_traded?: number | null;
3957
- /** Format: int64 */
3958
- winning_outcomes?: number | null;
3959
- /** Format: int64 */
3960
- first_trade_at?: number | null;
3961
- /** Format: int64 */
3962
- last_trade_at?: number | null;
4506
+ TraderProfile: {
4507
+ address: string;
4508
+ name?: string | null;
4509
+ pseudonym?: string | null;
4510
+ profile_image?: string | null;
4511
+ x_username?: string | null;
4512
+ verified_badge: boolean;
3963
4513
  };
3964
4514
  OrderbookHistoryRow: {
3965
4515
  /** Format: int64 */
@@ -4018,29 +4568,29 @@ export interface components {
4018
4568
  /** Format: int32 */
4019
4569
  ask_levels?: number | null;
4020
4570
  };
4021
- /** @description Holder data grouped by outcome for market-level queries */
4571
+ /** @description Holders grouped by outcome. */
4022
4572
  OutcomeHolders: {
4023
4573
  /**
4024
4574
  * Format: int32
4025
- * @description Outcome index (0, 1, etc.)
4575
+ * @description Outcome index (0, 1, etc.).
4026
4576
  */
4027
4577
  outcome_index: number;
4028
- /** @description Outcome name (Yes, No, etc.) */
4578
+ /** @description Outcome name (Yes, No, etc.). */
4029
4579
  outcome_name: string;
4030
- /** @description Position ID for this outcome */
4580
+ /** @description Position ID for this outcome. */
4031
4581
  position_id: string;
4032
4582
  /**
4033
4583
  * Format: double
4034
- * @description Current price/probability
4584
+ * @description Current price / probability.
4035
4585
  */
4036
4586
  price?: number | null;
4037
4587
  /**
4038
4588
  * Format: int64
4039
- * @description Total holders count for this outcome.
4589
+ * @description Total holders for this outcome.
4040
4590
  */
4041
4591
  total_holders: number;
4042
- /** @description Top holders for this outcome */
4043
- holders: components["schemas"]["Holder"][];
4592
+ /** @description Top holders for this outcome. */
4593
+ holders: components["schemas"]["MarketHolder"][];
4044
4594
  };
4045
4595
  /** @enum {string} */
4046
4596
  OutcomeIndex: "0" | "1";
@@ -4198,16 +4748,17 @@ export interface components {
4198
4748
  /** @description Pagination key for the next page (if has_more is true) */
4199
4749
  pagination_key?: string | null;
4200
4750
  };
4201
- /** @description A single PnL candle entry */
4751
+ /** @enum {string} */
4752
+ PnlAnalyticsTimeframe: "1d" | "24h" | "7d" | "30d" | "lifetime";
4202
4753
  PnlCandleEntry: {
4203
4754
  /**
4204
4755
  * Format: int64
4205
- * @description Timestamp in epoch seconds (start of bucket window)
4756
+ * @description Timestamp in epoch seconds (start of bucket window).
4206
4757
  */
4207
4758
  t: number;
4208
4759
  /**
4209
4760
  * Format: double
4210
- * @description Realized PnL in this bucket (USD)
4761
+ * @description Daily PnL in USD for this calendar bucket.
4211
4762
  */
4212
4763
  pnl: number;
4213
4764
  };
@@ -4215,160 +4766,262 @@ export interface components {
4215
4766
  PnlCandleResolution: "1m" | "1h" | "4h" | "1d" | "auto";
4216
4767
  /** @enum {string} */
4217
4768
  PnlCandleTimeframe: "1d" | "7d" | "30d" | "lifetime";
4218
- /** @enum {string} */
4219
- PnlTimeframe: "1d" | "7d" | "30d" | "lifetime";
4220
- /**
4221
- * @description Crypto asset symbols accepted by `asset_price_tick` and `asset_price_window_update` filters.
4222
- * @enum {string}
4223
- */
4224
- WebhookAssetSymbol: "BTC" | "ETH" | "SOL" | "XRP" | "DOGE" | "BNB" | "HYPE";
4225
- /**
4226
- * @description Timeframe values accepted by webhook metric, milestone, spike, and asset-price filters.
4227
- * @enum {string}
4228
- */
4229
- WebhookTimeframe: "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "6h" | "1d" | "24h" | "7d" | "30d" | "lifetime";
4230
- /**
4231
- * @description Sort metric for the trader → builders list.
4232
- * @enum {string}
4233
- */
4234
- TraderBuilderSortBy: "volume" | "txns" | "fees";
4235
- TraderWithPnl: components["schemas"]["Trader"] & {
4236
- pnl?: null | components["schemas"]["TraderPnlSummary"];
4237
- };
4238
- /**
4239
- * @description Timeframe for `?sort=...` — defines the window the metric is summed over
4240
- * (or `lifetime` for all-time cumulative).
4241
- * @enum {string}
4242
- */
4243
- TagSortTimeframe: "lifetime" | "1h" | "24h" | "7d" | "30d" | "1mo";
4244
- /** @description Trader's global PnL summary (single trader) */
4245
- TraderPnlSummary: {
4246
- trader?: string | null;
4769
+ PnlCandlestickBar: {
4770
+ /**
4771
+ * Format: int64
4772
+ * @description Timestamp in epoch seconds at the start of the candle bucket.
4773
+ */
4774
+ t: number;
4775
+ /**
4776
+ * Format: int64
4777
+ * @description Opening block for this candle.
4778
+ */
4779
+ ob: number;
4780
+ /**
4781
+ * Format: int64
4782
+ * @description Closing block for this candle.
4783
+ */
4784
+ cb: number;
4785
+ /**
4786
+ * Format: double
4787
+ * @description Latest USDC balance at candle close.
4788
+ */
4789
+ ub: number;
4790
+ /**
4791
+ * Format: double
4792
+ * @description Latest pUSD balance at candle close.
4793
+ */
4794
+ pb: number;
4795
+ /**
4796
+ * Format: int32
4797
+ * @description Latest open position count at candle close.
4798
+ */
4799
+ nop: number;
4800
+ /**
4801
+ * Format: double
4802
+ * @description Total PnL low value for the candle (= realized + unrealized).
4803
+ */
4804
+ l?: number | null;
4247
4805
  /** Format: double */
4248
- realized_pnl_usd?: number | null;
4249
- /** Format: int64 */
4250
- events_traded?: number | null;
4251
- /** Format: int64 */
4252
- markets_traded?: number | null;
4253
- /** Format: int64 */
4254
- total_buys?: number | null;
4255
- /** Format: int64 */
4256
- total_sells?: number | null;
4257
- /** Format: int64 */
4258
- total_redemptions?: number | null;
4259
- /** Format: int64 */
4260
- total_merges?: number | null;
4806
+ h?: number | null;
4807
+ /** Format: double */
4808
+ o?: number | null;
4809
+ /** Format: double */
4810
+ c?: number | null;
4261
4811
  /** Format: double */
4262
- total_volume_usd?: number | null;
4812
+ rl?: number | null;
4263
4813
  /** Format: double */
4264
- buy_volume_usd?: number | null;
4814
+ rh?: number | null;
4265
4815
  /** Format: double */
4266
- sell_volume_usd?: number | null;
4816
+ ro?: number | null;
4267
4817
  /** Format: double */
4268
- redemption_volume_usd?: number | null;
4818
+ rc?: number | null;
4269
4819
  /** Format: double */
4270
- merge_volume_usd?: number | null;
4271
- /** Format: int64 */
4272
- markets_won?: number | null;
4273
- /** Format: int64 */
4274
- markets_lost?: number | null;
4820
+ ul?: number | null;
4275
4821
  /** Format: double */
4276
- market_win_rate_pct?: number | null;
4822
+ uh?: number | null;
4277
4823
  /** Format: double */
4278
- avg_pnl_per_market?: number | null;
4824
+ uo?: number | null;
4279
4825
  /** Format: double */
4280
- avg_pnl_per_trade?: number | null;
4826
+ uc?: number | null;
4281
4827
  /** Format: double */
4282
- avg_hold_time_seconds?: number | null;
4828
+ pl?: number | null;
4283
4829
  /** Format: double */
4284
- total_fees?: number | null;
4830
+ ph?: number | null;
4285
4831
  /** Format: double */
4286
- best_trade_pnl_usd?: number | null;
4287
- best_trade_condition_id?: string | null;
4288
- /** Format: int64 */
4289
- first_trade_at?: number | null;
4290
- /** Format: int64 */
4291
- last_trade_at?: number | null;
4832
+ po?: number | null;
4833
+ /** Format: double */
4834
+ pc?: number | null;
4292
4835
  };
4293
- TraderVolumeDataPoint: {
4836
+ PnlChangeWindow: {
4837
+ timeframe: string;
4294
4838
  /** Format: int64 */
4295
- t: number;
4839
+ from: number;
4840
+ /** Format: int64 */
4841
+ to: number;
4296
4842
  /** Format: double */
4297
- v: number;
4843
+ total_pnl_start: number;
4298
4844
  /** Format: double */
4299
- bv: number;
4845
+ total_pnl_end: number;
4300
4846
  /** Format: double */
4301
- sv: number;
4302
- /** Format: int32 */
4303
- tc: number;
4304
- /** Format: int32 */
4305
- btc: number;
4847
+ total_pnl_change: number;
4848
+ /** Format: double */
4849
+ total_pnl_change_pct?: number | null;
4850
+ /** Format: double */
4851
+ portfolio_start: number;
4852
+ /** Format: double */
4853
+ portfolio_end: number;
4854
+ /** Format: double */
4855
+ portfolio_change: number;
4856
+ /** Format: double */
4857
+ portfolio_change_pct?: number | null;
4858
+ /** Format: double */
4859
+ realized_pnl_change: number;
4860
+ /** Format: double */
4861
+ unrealized_pnl_change: number;
4862
+ /** Format: double */
4863
+ usdc_balance_change: number;
4864
+ /** Format: double */
4865
+ pusd_balance_change: number;
4306
4866
  /** Format: int32 */
4307
- stc: number;
4867
+ open_positions_change: number;
4308
4868
  };
4309
- TraderVolumeChartResponse: {
4310
- volumes: components["schemas"]["TraderVolumeDataPoint"][];
4311
- has_more: boolean;
4869
+ PnlChangesResponse: {
4870
+ latest?: null | components["schemas"]["PnlLatestSnapshot"];
4871
+ changes: components["schemas"]["PnlChangeWindow"][];
4872
+ };
4873
+ /** @description A single position exit, sized and labelled for overlay on the PnL chart. */
4874
+ PnlExitMarker: {
4875
+ /**
4876
+ * Format: int64
4877
+ * @description Exit time in unix seconds.
4878
+ */
4879
+ t: number;
4880
+ /**
4881
+ * Format: int64
4882
+ * @description Block number the exit was recorded at.
4883
+ */
4884
+ block: number;
4885
+ /** @description Market condition id. */
4886
+ condition: string;
4887
+ /** @description Outcome token id. */
4888
+ position: string;
4889
+ /** @description Event slug. */
4890
+ event_slug: string;
4891
+ /** @description Market slug. */
4892
+ market_slug: string;
4893
+ /** @description Market title. */
4894
+ title: string;
4895
+ /** @description Market question. */
4896
+ question: string;
4897
+ /** @description Market image URL. */
4898
+ image_url: string;
4899
+ /** @description Outcome name. */
4900
+ outcome: string;
4901
+ /**
4902
+ * Format: int32
4903
+ * @description Outcome index within the market, when known.
4904
+ */
4905
+ outcome_index?: number | null;
4906
+ /**
4907
+ * @description Polymarket top-level category (e.g. "Politics"). Empty when the
4908
+ * market's tags hadn't resolved to a category at exit time.
4909
+ */
4910
+ category: string;
4911
+ /**
4912
+ * Format: double
4913
+ * @description Realized PnL in USD for the position at exit.
4914
+ */
4915
+ pnl_usd: number;
4916
+ /**
4917
+ * Format: double
4918
+ * @description Realized PnL percent for the position at exit.
4919
+ */
4920
+ pnl_pct: number;
4921
+ /**
4922
+ * Format: double
4923
+ * @description Amount paid into the position, in USD.
4924
+ */
4925
+ cost_basis_usd: number;
4926
+ /** @description Why the position closed. */
4927
+ reason: components["schemas"]["PnlExitReason"];
4312
4928
  };
4313
4929
  /**
4314
- * @description Bucket row returned by the per-trader `/analytics/timeseries` and
4315
- * `/analytics/deltas` endpoints. Mirrors `TimeBucketRow` minus the
4316
- * distinct-address counters (`new_*` / `unique_*`) — those only carry
4317
- * information for aggregations over many addresses (market, event, tag,
4318
- * global), not for a single trader.
4930
+ * @description Reason a position closed: a 2×2 of resolved-vs-sold and win-vs-loss.
4931
+ * @enum {string}
4319
4932
  */
4320
- TraderTimeBucketRow: {
4321
- /** Format: int32 */
4933
+ PnlExitReason: "resolved_win" | "resolved_loss" | "sold_win" | "sold_loss";
4934
+ PnlLatestSnapshot: {
4935
+ /** Format: int64 */
4322
4936
  t: number;
4323
4937
  /** Format: double */
4324
- v: number;
4938
+ total_pnl: number;
4325
4939
  /** Format: double */
4326
- bv: number;
4940
+ realized_pnl: number;
4327
4941
  /** Format: double */
4328
- sv: number;
4942
+ unrealized_pnl: number;
4943
+ /** Format: double */
4944
+ portfolio_value: number;
4945
+ /** Format: double */
4946
+ usdc_balance: number;
4947
+ /** Format: double */
4948
+ pusd_balance: number;
4949
+ /** Format: int32 */
4950
+ num_open_positions: number;
4951
+ };
4952
+ PnlPeriodExtremes: {
4953
+ best?: null | components["schemas"]["PnlPeriodMetric"];
4954
+ worst?: null | components["schemas"]["PnlPeriodMetric"];
4955
+ };
4956
+ PnlPeriodMetric: {
4329
4957
  /** Format: int64 */
4330
- tc: number;
4958
+ from: number;
4331
4959
  /** Format: int64 */
4332
- bc: number;
4960
+ to: number;
4961
+ /** Format: double */
4962
+ change: number;
4963
+ /** Format: double */
4964
+ change_pct?: number | null;
4965
+ };
4966
+ PnlPeriodsResponse: {
4967
+ timeframe: string;
4968
+ resolution: string;
4333
4969
  /** Format: int64 */
4334
- sc: number;
4970
+ from?: number | null;
4335
4971
  /** Format: int64 */
4336
- rc: number;
4972
+ to?: number | null;
4973
+ points: number;
4974
+ total_pnl_day: components["schemas"]["PnlPeriodExtremes"];
4975
+ total_pnl_week: components["schemas"]["PnlPeriodExtremes"];
4976
+ total_pnl_month: components["schemas"]["PnlPeriodExtremes"];
4977
+ portfolio_day: components["schemas"]["PnlPeriodExtremes"];
4978
+ portfolio_week: components["schemas"]["PnlPeriodExtremes"];
4979
+ portfolio_month: components["schemas"]["PnlPeriodExtremes"];
4980
+ };
4981
+ PnlRiskMarketMetadata: {
4982
+ condition_id: string;
4983
+ market_slug?: string | null;
4984
+ event_slug?: string | null;
4985
+ question?: string | null;
4986
+ title?: string | null;
4987
+ image_url?: string | null;
4988
+ };
4989
+ PnlRiskMetric: {
4337
4990
  /** Format: double */
4338
- rv: number;
4339
- /** Format: int64 */
4340
- mc: number;
4991
+ max_drawdown: number;
4341
4992
  /** Format: double */
4342
- mv: number;
4343
- /** Format: int64 */
4344
- sp: number;
4993
+ max_drawdown_pct?: number | null;
4994
+ max_drawdown_market?: null | components["schemas"]["PnlRiskMarketMetadata"];
4345
4995
  /** Format: double */
4346
- spv: number;
4996
+ current_drawdown: number;
4347
4997
  /** Format: double */
4348
- f: number;
4998
+ current_drawdown_pct?: number | null;
4999
+ current_drawdown_market?: null | components["schemas"]["PnlRiskMarketMetadata"];
4349
5000
  /** Format: double */
4350
- sh: number;
5001
+ max_runup: number;
4351
5002
  /** Format: double */
4352
- yv: number;
5003
+ max_runup_pct?: number | null;
5004
+ max_runup_market?: null | components["schemas"]["PnlRiskMarketMetadata"];
4353
5005
  /** Format: double */
4354
- nv: number;
4355
- /** Format: int64 */
4356
- yc: number;
4357
- /** Format: int64 */
4358
- nc: number;
4359
- /** Format: int64 */
4360
- bd_u10: number;
4361
- /** Format: int64 */
4362
- bd_100: number;
4363
- /** Format: int64 */
4364
- bd_1k: number;
4365
- /** Format: int64 */
4366
- bd_10k: number;
5006
+ high: number;
5007
+ /** Format: double */
5008
+ low: number;
5009
+ /** Format: double */
5010
+ latest: number;
5011
+ };
5012
+ PnlRiskResponse: {
5013
+ timeframe: string;
5014
+ resolution: string;
4367
5015
  /** Format: int64 */
4368
- bd_50k: number;
5016
+ from?: number | null;
4369
5017
  /** Format: int64 */
4370
- bd_50p: number;
5018
+ to?: number | null;
5019
+ points: number;
5020
+ total_pnl?: null | components["schemas"]["PnlRiskMetric"];
5021
+ portfolio?: null | components["schemas"]["PnlRiskMetric"];
4371
5022
  };
5023
+ /** @enum {string} */
5024
+ PnlTimeframe: "1d" | "7d" | "30d" | "lifetime";
4372
5025
  /**
4373
5026
  * @description Polymarket UI category.
4374
5027
  * @enum {string}
@@ -4449,8 +5102,6 @@ export interface components {
4449
5102
  };
4450
5103
  /**
4451
5104
  * @description Polymarket exchange contract types.
4452
- * `repr(u8)` discriminants double as the database column value — DO NOT renumber
4453
- * existing variants. New variants get fresh numbers.
4454
5105
  * @enum {string}
4455
5106
  */
4456
5107
  PolymarketExchange: "CTFExchange" | "NegRiskExchange" | "ConditionalTokens" | "NegRiskAdapter" | "CTFExchangeV2" | "NegRiskExchangeV2" | "Unknown";
@@ -4568,6 +5219,15 @@ export interface components {
4568
5219
  outcome_index: number;
4569
5220
  data: components["schemas"]["PositionChartDataPoint"][];
4570
5221
  };
5222
+ /**
5223
+ * @description Sort options accepted when `status=closed` is set on the positions
5224
+ * endpoint. `redemption_usd` is closed-only (the proceeds from
5225
+ * claiming the resolved outcome). Open-only fields such as
5226
+ * `current_value` and `redeemable` are excluded — once a position is
5227
+ * closed those values are no longer meaningful.
5228
+ * @enum {string}
5229
+ */
5230
+ PositionClosedPnlSortBy: "realized_pnl_usd" | "total_buy_usd" | "total_sell_usd" | "redemption_usd" | "total_buys" | "total_sells" | "total_shares_bought" | "total_shares_sold" | "avg_entry_price" | "avg_exit_price" | "avg_price" | "total_fees" | "first_trade_at" | "last_trade_at" | "realized_pnl_pct" | "total_pnl_pct" | "title" | "merge_count" | "split_count" | "end_date" | "is_neg_risk";
4571
5231
  /** @description Per-position detail for Split/Merge/Redemption trades. */
4572
5232
  PositionDetail: {
4573
5233
  /** @description Market condition ID for this ERC1155 position. */
@@ -4575,38 +5235,231 @@ export interface components {
4575
5235
  /** @description ERC1155 position ID */
4576
5236
  position_id: string;
4577
5237
  /**
4578
- * Format: int32
4579
- * @description Outcome index (0 = Yes, 1 = No for binary)
5238
+ * Format: int32
5239
+ * @description Outcome index (0 = Yes, 1 = No for binary)
5240
+ */
5241
+ outcome_index: number;
5242
+ /** @description Outcome name (e.g. "Yes", "No"). Optional — may be omitted when the market metadata isn't yet available. */
5243
+ outcome?: string | null;
5244
+ /** @description Amount of shares created/burned/redeemed for this position */
5245
+ amount: string;
5246
+ /**
5247
+ * @description Collateral paid out for this specific position, when applicable.
5248
+ *
5249
+ * For NegRisk PositionsConverted this is allocated only to burned NO
5250
+ * inputs. YES output details intentionally carry zero collateral.
5251
+ */
5252
+ collateral_amount?: string;
5253
+ };
5254
+ PositionEntry: {
5255
+ position_id?: string | null;
5256
+ condition_id?: string | null;
5257
+ market_slug?: string | null;
5258
+ event_slug?: string | null;
5259
+ /**
5260
+ * @description Market category slug — mirror of `PositionRollup.category_id`
5261
+ * resolved server-side. Enables `?category=<slug>` filtering on
5262
+ * the positions endpoint.
5263
+ */
5264
+ category?: string | null;
5265
+ title?: string | null;
5266
+ question?: string | null;
5267
+ image_url?: string | null;
5268
+ trader?: null | components["schemas"]["TraderProfile"];
5269
+ outcome?: string | null;
5270
+ /** Format: int32 */
5271
+ outcome_index?: number | null;
5272
+ won?: boolean | null;
5273
+ /** Format: int64 */
5274
+ total_buys?: number | null;
5275
+ /** Format: int64 */
5276
+ total_sells?: number | null;
5277
+ /** Format: int64 */
5278
+ converted_count?: number | null;
5279
+ /** Format: double */
5280
+ converted_shares_gained?: number | null;
5281
+ /** Format: double */
5282
+ converted_shares_lost?: number | null;
5283
+ /** Format: double */
5284
+ total_shares_bought?: number | null;
5285
+ /** Format: double */
5286
+ total_shares_sold?: number | null;
5287
+ /** Format: double */
5288
+ total_buy_usd?: number | null;
5289
+ /** Format: double */
5290
+ total_sell_usd?: number | null;
5291
+ /** Format: double */
5292
+ redemption_usd?: number | null;
5293
+ /**
5294
+ * Format: double
5295
+ * @description USD value from merge activity.
5296
+ */
5297
+ merge_usd?: number | null;
5298
+ /** Format: double */
5299
+ convert_collateral_usd?: number | null;
5300
+ /** Format: double */
5301
+ avg_entry_price?: number | null;
5302
+ /** Format: double */
5303
+ avg_exit_price?: number | null;
5304
+ /**
5305
+ * Format: double
5306
+ * @description Volume-weighted average trade price across buys and sells.
5307
+ */
5308
+ avg_price?: number | null;
5309
+ /** Format: double */
5310
+ realized_pnl_usd?: number | null;
5311
+ /** Format: double */
5312
+ total_fees?: number | null;
5313
+ /** Format: int64 */
5314
+ first_trade_at?: number | null;
5315
+ /** Format: int64 */
5316
+ last_trade_at?: number | null;
5317
+ /** Format: double */
5318
+ current_price?: number | null;
5319
+ /** Format: double */
5320
+ last_traded_price?: number | null;
5321
+ /** Format: double */
5322
+ current_shares_balance?: number | null;
5323
+ /** Format: double */
5324
+ current_value?: number | null;
5325
+ /** Format: double */
5326
+ realized_pnl_pct?: number | null;
5327
+ /** Format: double */
5328
+ total_pnl_pct?: number | null;
5329
+ /** Format: int64 */
5330
+ end_date?: number | null;
5331
+ is_neg_risk?: boolean | null;
5332
+ redeemable?: boolean | null;
5333
+ mergeable?: boolean | null;
5334
+ };
5335
+ /**
5336
+ * @description Sort field for trader position exits.
5337
+ * @enum {string}
5338
+ */
5339
+ PositionExitPnlSortBy: "exit_time" | "pnl_usd" | "pnl_pct" | "cost_basis_usd";
5340
+ /** @description Position holder. */
5341
+ PositionHolder: {
5342
+ /** @description Trader profile. */
5343
+ trader: components["schemas"]["Trader"];
5344
+ /** @description Position shares held (raw balance as decimal string for precision). */
5345
+ shares: string;
5346
+ /** @description USD value of shares (shares × latest price). */
5347
+ shares_usd?: string | null;
5348
+ /** @description USD balance of the holder's wallet. */
5349
+ usd_balance?: string | null;
5350
+ pnl?: null | components["schemas"]["PositionHolderPnl"];
5351
+ };
5352
+ /** @description Position holder history candle. */
5353
+ PositionHolderHistoryCandle: {
5354
+ /**
5355
+ * Format: int64
5356
+ * @description Unix seconds.
5357
+ */
5358
+ t: number;
5359
+ /**
5360
+ * Format: int64
5361
+ * @description Holder count.
5362
+ */
5363
+ h?: number | null;
5364
+ /**
5365
+ * Format: int64
5366
+ * @description Latest block.
5367
+ */
5368
+ block?: number | null;
5369
+ /**
5370
+ * Format: double
5371
+ * @description Total open share balance.
5372
+ */
5373
+ tosb?: number | null;
5374
+ /**
5375
+ * Format: double
5376
+ * @description Total cost basis.
5377
+ */
5378
+ cb?: number | null;
5379
+ /**
5380
+ * Format: int64
5381
+ * @description Market holder count.
5382
+ */
5383
+ mh?: number | null;
5384
+ /**
5385
+ * Format: int64
5386
+ * @description Event holder count.
5387
+ */
5388
+ eh?: number | null;
5389
+ };
5390
+ /** @description Position-level PnL for a holder, included when `include_pnl=true`. */
5391
+ PositionHolderPnl: {
5392
+ /** Format: int64 */
5393
+ total_buys?: number | null;
5394
+ /** Format: int64 */
5395
+ total_sells?: number | null;
5396
+ /** Format: double */
5397
+ total_shares_bought?: number | null;
5398
+ /** Format: double */
5399
+ total_shares_sold?: number | null;
5400
+ /** Format: double */
5401
+ total_buy_usd?: number | null;
5402
+ /** Format: double */
5403
+ total_sell_usd?: number | null;
5404
+ /** Format: double */
5405
+ redemption_usd?: number | null;
5406
+ /**
5407
+ * Format: double
5408
+ * @description Merge proceeds (combining outcome tokens back to collateral).
5409
+ * Counted toward realized PnL alongside sells and redemptions.
4580
5410
  */
4581
- outcome_index: number;
4582
- /** @description Outcome name (e.g. "Yes", "No"). Optional — may be omitted when the market metadata isn't yet available. */
4583
- outcome?: string | null;
4584
- /** @description Amount of shares created/burned/redeemed for this position */
4585
- amount: string;
5411
+ merge_usd?: number | null;
5412
+ /** Format: double */
5413
+ convert_collateral_usd?: number | null;
5414
+ /** Format: int64 */
5415
+ converted_count?: number | null;
5416
+ /** Format: double */
5417
+ converted_shares_gained?: number | null;
5418
+ /** Format: double */
5419
+ converted_shares_lost?: number | null;
5420
+ /** Format: double */
5421
+ avg_entry_price?: number | null;
5422
+ /** Format: double */
5423
+ avg_exit_price?: number | null;
4586
5424
  /**
4587
- * @description Collateral paid out for this specific position, when applicable.
4588
- *
4589
- * For NegRisk PositionsConverted this is allocated only to burned NO
4590
- * inputs. YES output details intentionally carry zero collateral.
5425
+ * Format: double
5426
+ * @description Volume-weighted average trade price across buys + sells.
4591
5427
  */
4592
- collateral_amount?: string;
5428
+ avg_price?: number | null;
5429
+ /** Format: double */
5430
+ realized_pnl_usd?: number | null;
5431
+ /** Format: double */
5432
+ total_fees?: number | null;
5433
+ /** Format: int64 */
5434
+ first_trade_at?: number | null;
5435
+ /** Format: int64 */
5436
+ last_trade_at?: number | null;
5437
+ /** Format: double */
5438
+ last_traded_price?: number | null;
5439
+ /** Format: double */
5440
+ realized_pnl_pct?: number | null;
5441
+ /** Format: double */
5442
+ total_pnl_pct?: number | null;
5443
+ won?: boolean | null;
5444
+ redeemable?: boolean | null;
5445
+ mergeable?: boolean | null;
4593
5446
  };
4594
- /** @description Response for position (position_id) holders endpoint */
5447
+ /** @description Response for position (position_id) holders endpoint. */
4595
5448
  PositionHoldersResponse: {
4596
- /** @description Position ID (ERC1155 token ID) */
5449
+ /** @description Position ID (ERC1155 token ID). */
4597
5450
  position_id: string;
4598
- /** @description Condition ID this position belongs to */
5451
+ /** @description Condition ID this position belongs to. */
4599
5452
  condition_id?: string | null;
4600
- /** @description Outcome name */
5453
+ /** @description Outcome name (Yes, No, etc.). */
4601
5454
  outcome_name?: string | null;
4602
5455
  /**
4603
5456
  * Format: int32
4604
- * @description Outcome index
5457
+ * @description Outcome index.
4605
5458
  */
4606
5459
  outcome_index?: number | null;
4607
5460
  /**
4608
5461
  * Format: double
4609
- * @description Current price
5462
+ * @description Current price / probability.
4610
5463
  */
4611
5464
  price?: number | null;
4612
5465
  /**
@@ -4614,8 +5467,8 @@ export interface components {
4614
5467
  * @description Total holders of this position.
4615
5468
  */
4616
5469
  total_holders: number;
4617
- /** @description Top holders */
4618
- holders: components["schemas"]["Holder"][];
5470
+ /** @description Top holders. */
5471
+ holders: components["schemas"]["PositionHolder"][];
4619
5472
  };
4620
5473
  /** @description Response type for position metrics query */
4621
5474
  PositionMetricsResponse: {
@@ -4691,12 +5544,26 @@ export interface components {
4691
5544
  /** Format: double */
4692
5545
  avg_sell_shares: number;
4693
5546
  };
4694
- /** @enum {string} */
4695
- PositionPnlSortBy: "realized_pnl_usd" | "total_buy_usd" | "total_sell_usd" | "redemption_usd" | "total_buys" | "total_sells" | "total_shares_bought" | "total_shares_sold" | "avg_entry_price" | "avg_exit_price" | "total_fees" | "first_trade_at" | "last_trade_at" | "current_value" | "realized_pnl_pct" | "title";
4696
5547
  /**
4697
- * @description Position status filter for open/closed positions.
5548
+ * @description Sort options accepted when `status=open` is set on the positions
5549
+ * endpoint. Mark-to-market fields (`current_value`, `current_price`,
5550
+ * `current_shares_balance`) and the per-position action flags
5551
+ * (`redeemable`, `mergeable`) are exclusive to open positions.
5552
+ * @enum {string}
5553
+ */
5554
+ PositionOpenPnlSortBy: "realized_pnl_usd" | "total_buy_usd" | "total_sell_usd" | "total_buys" | "total_sells" | "total_shares_bought" | "total_shares_sold" | "avg_entry_price" | "avg_exit_price" | "avg_price" | "total_fees" | "first_trade_at" | "last_trade_at" | "current_value" | "realized_pnl_pct" | "total_pnl_pct" | "title" | "current_price" | "current_shares_balance" | "merge_count" | "split_count" | "end_date" | "is_neg_risk" | "redeemable" | "mergeable";
5555
+ /**
5556
+ * @description Union of every sort_by value accepted by the positions endpoint
5557
+ * across both `status=open` and `status=closed`. Note that some
5558
+ * options are only meaningful for one status — for example
5559
+ * `current_value` / `current_price` / `redeemable` / `mergeable`
5560
+ * only apply to open positions, while `redemption_usd` only applies
5561
+ * to closed ones. See `PositionOpenPnlSortBy` and
5562
+ * `PositionClosedPnlSortBy` for the exact per-status whitelists.
4698
5563
  * @enum {string}
4699
5564
  */
5565
+ PositionPnlSortBy: "realized_pnl_usd" | "total_buy_usd" | "total_sell_usd" | "redemption_usd" | "total_buys" | "total_sells" | "total_shares_bought" | "total_shares_sold" | "avg_entry_price" | "avg_exit_price" | "avg_price" | "total_fees" | "first_trade_at" | "last_trade_at" | "current_value" | "realized_pnl_pct" | "total_pnl_pct" | "current_price" | "current_shares_balance" | "merge_count" | "split_count" | "title" | "end_date" | "is_neg_risk" | "redeemable" | "mergeable";
5566
+ /** @enum {string} */
4700
5567
  PositionStatus: "open" | "closed";
4701
5568
  PositionVolumeChartResponse: {
4702
5569
  volumes: components["schemas"]["PositionVolumeDataPoint"][];
@@ -4750,36 +5617,25 @@ export interface components {
4750
5617
  exchange: components["schemas"]["PolymarketExchange"];
4751
5618
  };
4752
5619
  /**
4753
- * @description Sort key for the top-traders ranking.
5620
+ * @description Timeframe values accepted by webhook metric, milestone, spike, and asset-price filters.
4754
5621
  * @enum {string}
4755
5622
  */
4756
- TopTradersSortBy: "volume" | "txns" | "fees" | "builder_fees";
5623
+ WebhookTimeframe: "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "6h" | "1d" | "24h" | "7d" | "30d" | "lifetime";
4757
5624
  /**
4758
- * @description Per-metric percentage change over a lookback window for one trader
4759
- * address. A `null` field means the window predates the trader's first
4760
- * activity or the prior value was zero (percentage undefined).
5625
+ * @description Trader profile info embedded in API responses.
5626
+ *
5627
+ * Used in:
5628
+ * - holders endpoints (market/event holders)
5629
+ * - trades endpoints
5630
+ * - leaderboard endpoints
4761
5631
  */
4762
- TraderMetricPctChange: {
4763
- /** Format: double */
4764
- volume_usd?: number | null;
4765
- /** Format: double */
4766
- buy_volume_usd?: number | null;
4767
- /** Format: double */
4768
- sell_volume_usd?: number | null;
4769
- /** Format: double */
4770
- merge_volume_usd?: number | null;
4771
- /** Format: double */
4772
- split_volume_usd?: number | null;
4773
- /** Format: double */
4774
- txn_count?: number | null;
4775
- /** Format: double */
4776
- fees_usd?: number | null;
4777
- /** Format: double */
4778
- shares_volume?: number | null;
4779
- /** Format: double */
4780
- yes_volume_usd?: number | null;
4781
- /** Format: double */
4782
- no_volume_usd?: number | null;
5632
+ Trader: {
5633
+ address: string;
5634
+ name?: string | null;
5635
+ pseudonym?: string | null;
5636
+ profile_image?: string | null;
5637
+ x_username?: string | null;
5638
+ verified_badge?: boolean;
4783
5639
  };
4784
5640
  PredictionCandlestickBar: {
4785
5641
  /** Format: double */
@@ -5057,10 +5913,13 @@ export interface components {
5057
5913
  position_details?: components["schemas"]["PositionDetail"][];
5058
5914
  exchange: components["schemas"]["PolymarketExchange"];
5059
5915
  };
5916
+ /**
5917
+ * @description Crypto asset symbols accepted by `asset_price_tick` and `asset_price_window_update` filters.
5918
+ * @enum {string}
5919
+ */
5920
+ WebhookAssetSymbol: "BTC" | "ETH" | "SOL" | "XRP" | "DOGE" | "BNB" | "HYPE";
5060
5921
  /** @enum {string} */
5061
- TradeSide: "0" | "1";
5062
- /** @enum {string} */
5063
- TradeType: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "22" | "23" | "24";
5922
+ TraderPnlSortBy: "realized_pnl_usd" | "total_pnl_usd" | "unrealized_pnl_usd" | "realized_pnl_pct" | "total_pnl_pct" | "usd_balance" | "total_volume_usd" | "markets_traded" | "events_traded" | "categories_traded" | "markets_won" | "markets_lost" | "market_win_rate_pct" | "avg_win_usd" | "avg_loss_usd" | "profit_factor" | "total_buys" | "total_sells" | "total_redemptions" | "total_merges" | "total_fees" | "total_wins_usd" | "total_losses_usd" | "best_trade_pnl_usd" | "worst_trade_pnl_usd" | "buy_volume_usd" | "sell_volume_usd" | "redemption_volume_usd" | "merge_volume_usd" | "split_volume_usd" | "total_splits" | "total_converts" | "maker_rebate_count" | "maker_rebate_usd" | "reward_count" | "reward_usd" | "yield_count" | "yield_usd" | "avg_hold_time_seconds" | "first_trade_at" | "last_trade_at" | "open_positions_value" | "open_position_count";
5064
5923
  /** @description Output payload for RegisterToken events (YES/NO token pair registered for a condition). */
5065
5924
  RegisterTokenTrade: {
5066
5925
  id: string;
@@ -5084,44 +5943,14 @@ export interface components {
5084
5943
  event_slug?: string | null;
5085
5944
  exchange: components["schemas"]["PolymarketExchange"];
5086
5945
  };
5087
- TopTraderEventEntry: {
5088
- trader: components["schemas"]["TraderInfo"];
5089
- /** Format: double */
5090
- realized_pnl_usd?: number | null;
5091
- /** Format: double */
5092
- realized_pnl_pct?: number | null;
5093
- /** Format: double */
5094
- total_volume_usd?: number | null;
5095
- /** Format: double */
5096
- buy_usd?: number | null;
5097
- /** Format: double */
5098
- sell_usd?: number | null;
5099
- /** Format: double */
5100
- redemption_usd?: number | null;
5101
- /** Format: double */
5102
- merge_usd?: number | null;
5103
- /** Format: double */
5104
- total_fees?: number | null;
5105
- /** Format: int64 */
5106
- total_buys?: number | null;
5107
- /** Format: int64 */
5108
- total_sells?: number | null;
5109
- /** Format: int64 */
5110
- total_redemptions?: number | null;
5111
- /** Format: int64 */
5112
- total_merges?: number | null;
5113
- /** Format: int64 */
5114
- markets_traded?: number | null;
5115
- /** Format: int64 */
5116
- outcomes_traded?: number | null;
5117
- /** Format: int64 */
5118
- winning_markets?: number | null;
5119
- /** Format: int64 */
5120
- losing_markets?: number | null;
5121
- /** Format: int64 */
5122
- first_trade_at?: number | null;
5123
- /** Format: int64 */
5124
- last_trade_at?: number | null;
5946
+ /** @description Trader profile info - backwards compatibility */
5947
+ TraderInfo: {
5948
+ address: string;
5949
+ name?: string | null;
5950
+ pseudonym?: string | null;
5951
+ profile_image?: string | null;
5952
+ x_username?: string | null;
5953
+ verified_badge?: boolean;
5125
5954
  };
5126
5955
  /** @description V2 UMA OOv2: a price request was made (market initialization). */
5127
5956
  RequestPriceEvent: {
@@ -5176,132 +6005,23 @@ export interface components {
5176
6005
  /** Format: double */
5177
6006
  d30: number;
5178
6007
  };
5179
- /** @description Event-level PnL entry */
5180
- TraderEventPnlEntry: {
5181
- event_slug?: string | null;
5182
- question?: string | null;
5183
- image_url?: string | null;
5184
- /** Format: int64 */
5185
- markets_traded?: number | null;
5186
- /** Format: int64 */
5187
- outcomes_traded?: number | null;
5188
- /** Format: int64 */
5189
- total_buys?: number | null;
5190
- /** Format: int64 */
5191
- total_sells?: number | null;
5192
- /** Format: int64 */
5193
- total_redemptions?: number | null;
5194
- /** Format: int64 */
5195
- total_merges?: number | null;
5196
- /** Format: double */
5197
- total_volume_usd?: number | null;
5198
- /** Format: double */
5199
- buy_usd?: number | null;
5200
- /** Format: double */
5201
- sell_usd?: number | null;
5202
- /** Format: double */
5203
- redemption_usd?: number | null;
5204
- /** Format: double */
5205
- merge_usd?: number | null;
5206
- /** Format: double */
5207
- realized_pnl_usd?: number | null;
5208
- /** Format: int64 */
5209
- winning_markets?: number | null;
5210
- /** Format: int64 */
5211
- losing_markets?: number | null;
5212
- /** Format: double */
5213
- total_fees?: number | null;
5214
- /** Format: int64 */
5215
- first_trade_at?: number | null;
5216
- /** Format: int64 */
5217
- last_trade_at?: number | null;
5218
- /** Format: double */
5219
- realized_pnl_pct?: number | null;
5220
- };
5221
- /**
5222
- * @description Bucket row returned by both `/analytics/timeseries` (cumulative values
5223
- * at end of bucket) and `/analytics/deltas` (per-bucket deltas). All metrics
5224
- * the snapshot `/counts` returns are included.
5225
- *
5226
- * Short field names for compact JSON responses:
5227
- * t=bucket (unix seconds), v=volume_usd, bv=buy_volume_usd, sv=sell_volume_usd,
5228
- * ut=unique_traders, um=unique_makers, uk=unique_takers,
5229
- * tc=txn_count, bc=buy_count, sc=sell_count,
5230
- * rc=redemption_count, rv=redemption_volume_usd, mc=merge_count, mv=merge_volume_usd,
5231
- * sp=split_count, spv=split_volume_usd, f=fees_usd, sh=shares_volume,
5232
- * yv=yes_volume_usd, nv=no_volume_usd, yc=yes_count, nc=no_count,
5233
- * bd_*=buy distribution by USD bucket
5234
- */
5235
- TimeBucketRow: {
5236
- /** Format: int32 */
5237
- t: number;
5238
- /** Format: double */
5239
- v: number;
5240
- /** Format: double */
5241
- bv: number;
5242
- /** Format: double */
5243
- sv: number;
5244
- /** Format: int64 */
5245
- tc: number;
5246
- /** Format: int64 */
5247
- bc: number;
5248
- /** Format: int64 */
5249
- sc: number;
5250
- /** Format: int64 */
5251
- rc: number;
5252
- /** Format: double */
5253
- rv: number;
5254
- /** Format: int64 */
5255
- mc: number;
5256
- /** Format: double */
5257
- mv: number;
5258
- /** Format: int64 */
5259
- sp: number;
5260
- /** Format: double */
5261
- spv: number;
5262
- /** Format: double */
5263
- f: number;
5264
- /** Format: double */
5265
- sh: number;
5266
- /** Format: double */
5267
- yv: number;
5268
- /** Format: double */
5269
- nv: number;
5270
- /** Format: int64 */
5271
- yc: number;
5272
- /** Format: int64 */
5273
- nc: number;
5274
- /**
5275
- * Format: int64
5276
- * @description Buy distribution — count of buy trades falling in each USD bucket.
5277
- */
5278
- bd_u10: number;
5279
- /** Format: int64 */
5280
- bd_100: number;
5281
- /** Format: int64 */
5282
- bd_1k: number;
5283
- /** Format: int64 */
5284
- bd_10k: number;
5285
- /** Format: int64 */
5286
- bd_50k: number;
5287
- /** Format: int64 */
5288
- bd_50p: number;
5289
- /**
5290
- * Format: int64
5291
- * @description Distinct traders ACTIVE in this bucket (window-unique, not first-time).
5292
- */
5293
- ut: number;
5294
- /**
5295
- * Format: int64
5296
- * @description Distinct makers active in this bucket.
5297
- */
5298
- um: number;
5299
- /**
5300
- * Format: int64
5301
- * @description Distinct takers active in this bucket.
5302
- */
5303
- uk: number;
5304
- };
6008
+ TraderVolumeChartResponse: {
6009
+ volumes: components["schemas"]["TraderVolumeDataPoint"][];
6010
+ has_more: boolean;
6011
+ };
6012
+ /**
6013
+ * @description Market metadata for the market a trader's best / worst trade landed in.
6014
+ * Accompanies the existing flat `best_trade_pnl_usd` / `worst_trade_pnl_usd`
6015
+ * numerics on trader / event / category PnL summaries.
6016
+ */
6017
+ TradeMarketRef: {
6018
+ condition_id?: string | null;
6019
+ market_slug?: string | null;
6020
+ title?: string | null;
6021
+ question?: string | null;
6022
+ image_url?: string | null;
6023
+ event_slug?: string | null;
6024
+ };
5305
6025
  SearchResponse: {
5306
6026
  events?: components["schemas"]["PolymarketEvent"][] | null;
5307
6027
  events_pagination?: null | components["schemas"]["PaginationMeta"];
@@ -5349,11 +6069,64 @@ export interface components {
5349
6069
  slug?: string | null;
5350
6070
  event_slug?: string | null;
5351
6071
  };
5352
- /**
5353
- * @description Direction filter for spike webhooks.
5354
- * @enum {string}
5355
- */
5356
- SpikeDirection: "up" | "down" | "both";
6072
+ /** @description One builder's stats under a single tag. */
6073
+ TagBuilderRow: {
6074
+ builder_code: string;
6075
+ /** Format: int64 */
6076
+ block: number;
6077
+ /** Format: int32 */
6078
+ ts: number;
6079
+ /** Format: double */
6080
+ volume_usd: number;
6081
+ /** Format: double */
6082
+ buy_volume_usd: number;
6083
+ /** Format: double */
6084
+ sell_volume_usd: number;
6085
+ /** Format: int64 */
6086
+ unique_traders: number;
6087
+ /** Format: int64 */
6088
+ unique_makers: number;
6089
+ /** Format: int64 */
6090
+ unique_takers: number;
6091
+ /** Format: int64 */
6092
+ txn_count: number;
6093
+ /** Format: int64 */
6094
+ buy_count: number;
6095
+ /** Format: int64 */
6096
+ sell_count: number;
6097
+ /** Format: double */
6098
+ fees_usd: number;
6099
+ /** Format: double */
6100
+ builder_fees: number;
6101
+ /** Format: double */
6102
+ shares_volume: number;
6103
+ /** Format: double */
6104
+ yes_volume_usd: number;
6105
+ /** Format: double */
6106
+ no_volume_usd: number;
6107
+ /** Format: int64 */
6108
+ yes_count: number;
6109
+ /** Format: int64 */
6110
+ no_count: number;
6111
+ /** Format: int64 */
6112
+ buy_dist_under_10: number;
6113
+ /** Format: int64 */
6114
+ buy_dist_10_100: number;
6115
+ /** Format: int64 */
6116
+ buy_dist_100_1k: number;
6117
+ /** Format: int64 */
6118
+ buy_dist_1k_10k: number;
6119
+ /** Format: int64 */
6120
+ buy_dist_10k_50k: number;
6121
+ /** Format: int64 */
6122
+ buy_dist_50k_plus: number;
6123
+ /** Format: int64 */
6124
+ new_users: number;
6125
+ /** Format: double */
6126
+ avg_rev_per_user: number;
6127
+ /** Format: double */
6128
+ avg_vol_per_user: number;
6129
+ };
5357
6130
  SimpleTimeframeMetrics: {
5358
6131
  /**
5359
6132
  * Format: double
@@ -5416,36 +6189,187 @@ export interface components {
5416
6189
  */
5417
6190
  unique_builder_traders: number;
5418
6191
  };
5419
- TopTraderPositionEntry: {
5420
- trader: components["schemas"]["TraderInfo"];
6192
+ TraderAnalyticsDeltaTimeBucketRow: {
6193
+ /** Format: int32 */
6194
+ t: number;
5421
6195
  /** Format: double */
5422
- realized_pnl_usd?: number | null;
6196
+ v: number;
5423
6197
  /** Format: double */
5424
- realized_pnl_pct?: number | null;
6198
+ bv: number;
5425
6199
  /** Format: double */
5426
- shares?: number | null;
6200
+ sv: number;
6201
+ /** Format: int64 */
6202
+ tc: number;
6203
+ /** Format: int64 */
6204
+ bc: number;
6205
+ /** Format: int64 */
6206
+ sc: number;
6207
+ /** Format: int64 */
6208
+ rc: number;
5427
6209
  /** Format: double */
5428
- buy_usd?: number | null;
6210
+ rv: number;
6211
+ /** Format: int64 */
6212
+ mc: number;
5429
6213
  /** Format: double */
5430
- sell_usd?: number | null;
6214
+ mv: number;
6215
+ /** Format: int64 */
6216
+ sp: number;
5431
6217
  /** Format: double */
5432
- redemption_usd?: number | null;
6218
+ spv: number;
6219
+ /** Format: int64 */
6220
+ cc: number;
5433
6221
  /** Format: double */
5434
- total_fees?: number | null;
6222
+ ccu: number;
5435
6223
  /** Format: double */
5436
- avg_entry_price?: number | null;
6224
+ csg: number;
5437
6225
  /** Format: double */
5438
- avg_exit_price?: number | null;
6226
+ csl: number;
5439
6227
  /** Format: int64 */
5440
- total_buys?: number | null;
6228
+ mrc: number;
6229
+ /** Format: double */
6230
+ mrv: number;
5441
6231
  /** Format: int64 */
5442
- total_sells?: number | null;
5443
- won?: boolean | null;
6232
+ rwc: number;
6233
+ /** Format: double */
6234
+ rwv: number;
5444
6235
  /** Format: int64 */
5445
- first_trade_at?: number | null;
6236
+ ydc: number;
6237
+ /** Format: double */
6238
+ ydv: number;
6239
+ /** Format: double */
6240
+ f: number;
6241
+ /** Format: double */
6242
+ sh: number;
6243
+ /** Format: double */
6244
+ bsh: number;
6245
+ /** Format: double */
6246
+ ssh: number;
6247
+ /** Format: double */
6248
+ ysh: number;
6249
+ /** Format: double */
6250
+ nsh: number;
6251
+ /** Format: double */
6252
+ yv: number;
6253
+ /** Format: double */
6254
+ nv: number;
5446
6255
  /** Format: int64 */
5447
- last_trade_at?: number | null;
6256
+ yc: number;
6257
+ /** Format: int64 */
6258
+ nc: number;
6259
+ /** Format: int64 */
6260
+ bd_u10: number;
6261
+ /** Format: int64 */
6262
+ bd_100: number;
6263
+ /** Format: int64 */
6264
+ bd_1k: number;
6265
+ /** Format: int64 */
6266
+ bd_10k: number;
6267
+ /** Format: int64 */
6268
+ bd_50k: number;
6269
+ /** Format: int64 */
6270
+ bd_50p: number;
6271
+ /** Format: int64 */
6272
+ buy_price_cnt_0_10: number;
6273
+ /** Format: int64 */
6274
+ buy_price_cnt_10_20: number;
6275
+ /** Format: int64 */
6276
+ buy_price_cnt_20_30: number;
6277
+ /** Format: int64 */
6278
+ buy_price_cnt_30_40: number;
6279
+ /** Format: int64 */
6280
+ buy_price_cnt_40_50: number;
6281
+ /** Format: int64 */
6282
+ buy_price_cnt_50_60: number;
6283
+ /** Format: int64 */
6284
+ buy_price_cnt_60_70: number;
6285
+ /** Format: int64 */
6286
+ buy_price_cnt_70_80: number;
6287
+ /** Format: int64 */
6288
+ buy_price_cnt_80_90: number;
6289
+ /** Format: int64 */
6290
+ buy_price_cnt_90_100: number;
6291
+ /** Format: double */
6292
+ buy_price_vol_0_10: number;
6293
+ /** Format: double */
6294
+ buy_price_vol_10_20: number;
6295
+ /** Format: double */
6296
+ buy_price_vol_20_30: number;
6297
+ /** Format: double */
6298
+ buy_price_vol_30_40: number;
6299
+ /** Format: double */
6300
+ buy_price_vol_40_50: number;
6301
+ /** Format: double */
6302
+ buy_price_vol_50_60: number;
6303
+ /** Format: double */
6304
+ buy_price_vol_60_70: number;
6305
+ /** Format: double */
6306
+ buy_price_vol_70_80: number;
6307
+ /** Format: double */
6308
+ buy_price_vol_80_90: number;
6309
+ /** Format: double */
6310
+ buy_price_vol_90_100: number;
6311
+ /** Format: int64 */
6312
+ sell_price_cnt_0_10: number;
6313
+ /** Format: int64 */
6314
+ sell_price_cnt_10_20: number;
6315
+ /** Format: int64 */
6316
+ sell_price_cnt_20_30: number;
6317
+ /** Format: int64 */
6318
+ sell_price_cnt_30_40: number;
6319
+ /** Format: int64 */
6320
+ sell_price_cnt_40_50: number;
6321
+ /** Format: int64 */
6322
+ sell_price_cnt_50_60: number;
6323
+ /** Format: int64 */
6324
+ sell_price_cnt_60_70: number;
6325
+ /** Format: int64 */
6326
+ sell_price_cnt_70_80: number;
6327
+ /** Format: int64 */
6328
+ sell_price_cnt_80_90: number;
6329
+ /** Format: int64 */
6330
+ sell_price_cnt_90_100: number;
6331
+ /** Format: double */
6332
+ sell_price_vol_0_10: number;
6333
+ /** Format: double */
6334
+ sell_price_vol_10_20: number;
6335
+ /** Format: double */
6336
+ sell_price_vol_20_30: number;
6337
+ /** Format: double */
6338
+ sell_price_vol_30_40: number;
6339
+ /** Format: double */
6340
+ sell_price_vol_40_50: number;
6341
+ /** Format: double */
6342
+ sell_price_vol_50_60: number;
6343
+ /** Format: double */
6344
+ sell_price_vol_60_70: number;
6345
+ /** Format: double */
6346
+ sell_price_vol_70_80: number;
6347
+ /** Format: double */
6348
+ sell_price_vol_80_90: number;
6349
+ /** Format: double */
6350
+ sell_price_vol_90_100: number;
6351
+ };
6352
+ TraderVolumeDataPoint: {
6353
+ /** Format: int64 */
6354
+ t: number;
6355
+ /** Format: double */
6356
+ v: number;
6357
+ /** Format: double */
6358
+ bv: number;
6359
+ /** Format: double */
6360
+ sv: number;
6361
+ /** Format: int64 */
6362
+ tc: number;
6363
+ /** Format: int64 */
6364
+ btc: number;
6365
+ /** Format: int64 */
6366
+ stc: number;
6367
+ };
6368
+ TraderWithPnl: components["schemas"]["Trader"] & {
6369
+ pnl?: unknown;
5448
6370
  };
6371
+ /** @enum {string} */
6372
+ TradeType: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "22" | "23" | "24";
5449
6373
  };
5450
6374
  responses: never;
5451
6375
  parameters: never;
@@ -5459,7 +6383,7 @@ export interface operations {
5459
6383
  parameters: {
5460
6384
  query?: {
5461
6385
  /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
5462
- timeframe?: components["schemas"]["ChangeTimeframe"];
6386
+ timeframe?: components["schemas"]["AnalyticsChangeTimeframe"];
5463
6387
  };
5464
6388
  header?: never;
5465
6389
  path?: never;
@@ -5473,7 +6397,7 @@ export interface operations {
5473
6397
  [name: string]: unknown;
5474
6398
  };
5475
6399
  content: {
5476
- "application/json": components["schemas"]["MetricPctChange"];
6400
+ "application/json": components["schemas"]["AnalyticsMetricPctChange"];
5477
6401
  };
5478
6402
  };
5479
6403
  };
@@ -5493,7 +6417,7 @@ export interface operations {
5493
6417
  [name: string]: unknown;
5494
6418
  };
5495
6419
  content: {
5496
- "application/json": components["schemas"]["GlobalCountsResponse"];
6420
+ "application/json": components["schemas"]["AnalyticsGlobalCountsResponse"];
5497
6421
  };
5498
6422
  };
5499
6423
  };
@@ -5524,7 +6448,7 @@ export interface operations {
5524
6448
  [name: string]: unknown;
5525
6449
  };
5526
6450
  content: {
5527
- "application/json": components["schemas"]["TimeBucketRow"][];
6451
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
5528
6452
  };
5529
6453
  };
5530
6454
  };
@@ -5555,7 +6479,7 @@ export interface operations {
5555
6479
  [name: string]: unknown;
5556
6480
  };
5557
6481
  content: {
5558
- "application/json": components["schemas"]["TimeBucketRow"][];
6482
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
5559
6483
  };
5560
6484
  };
5561
6485
  };
@@ -5987,7 +6911,7 @@ export interface operations {
5987
6911
  parameters: {
5988
6912
  query?: {
5989
6913
  /** @description Lookback window (default: 24h). */
5990
- timeframe?: components["schemas"]["ChangeTimeframe"];
6914
+ timeframe?: "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
5991
6915
  };
5992
6916
  header?: never;
5993
6917
  path: {
@@ -6488,40 +7412,11 @@ export interface operations {
6488
7412
  };
6489
7413
  };
6490
7414
  };
6491
- get_event_top_traders: {
6492
- parameters: {
6493
- query: {
6494
- /** @description Event slug */
6495
- event_slug: string;
6496
- /** @description Timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
6497
- timeframe?: components["schemas"]["PnlTimeframe"];
6498
- /** @description Results limit (default: 10, max: 200) */
6499
- limit?: number;
6500
- /** @description Pagination key from the previous response */
6501
- pagination_key?: string;
6502
- };
6503
- header?: never;
6504
- path?: never;
6505
- cookie?: never;
6506
- };
6507
- requestBody?: never;
6508
- responses: {
6509
- /** @description Top traders sorted by realized PnL desc. */
6510
- 200: {
6511
- headers: {
6512
- [name: string]: unknown;
6513
- };
6514
- content: {
6515
- "application/json": components["schemas"]["TopTraderEventEntry"][];
6516
- };
6517
- };
6518
- };
6519
- };
6520
7415
  get_event_analytics_changes: {
6521
7416
  parameters: {
6522
7417
  query?: {
6523
7418
  /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
6524
- timeframe?: components["schemas"]["ChangeTimeframe"];
7419
+ timeframe?: components["schemas"]["AnalyticsChangeTimeframe"];
6525
7420
  };
6526
7421
  header?: never;
6527
7422
  path: {
@@ -6538,7 +7433,7 @@ export interface operations {
6538
7433
  [name: string]: unknown;
6539
7434
  };
6540
7435
  content: {
6541
- "application/json": components["schemas"]["MetricPctChange"];
7436
+ "application/json": components["schemas"]["AnalyticsMetricPctChange"];
6542
7437
  };
6543
7438
  };
6544
7439
  };
@@ -6572,7 +7467,7 @@ export interface operations {
6572
7467
  [name: string]: unknown;
6573
7468
  };
6574
7469
  content: {
6575
- "application/json": components["schemas"]["TimeBucketRow"][];
7470
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
6576
7471
  };
6577
7472
  };
6578
7473
  };
@@ -6600,45 +7495,86 @@ export interface operations {
6600
7495
  };
6601
7496
  requestBody?: never;
6602
7497
  responses: {
6603
- /** @description Cumulative time-bucketed event analytics */
7498
+ /** @description Cumulative time-bucketed event analytics */
7499
+ 200: {
7500
+ headers: {
7501
+ [name: string]: unknown;
7502
+ };
7503
+ content: {
7504
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
7505
+ };
7506
+ };
7507
+ };
7508
+ };
7509
+ get_event: {
7510
+ parameters: {
7511
+ query?: {
7512
+ /** @description Include tags array (default: true) */
7513
+ include_tags?: boolean;
7514
+ /** @description Include markets array with outcomes (default: true) */
7515
+ include_markets?: boolean;
7516
+ /** @description Include metrics object with all timeframes (default: true) */
7517
+ include_metrics?: boolean;
7518
+ /** @description Return truncated response optimized for AI consumers (default: false) */
7519
+ ai?: boolean;
7520
+ };
7521
+ header?: never;
7522
+ path: {
7523
+ /** @description Event ID or slug */
7524
+ identifier: string;
7525
+ };
7526
+ cookie?: never;
7527
+ };
7528
+ requestBody?: never;
7529
+ responses: {
7530
+ /** @description Event with nested tags, markets, and series */
6604
7531
  200: {
6605
7532
  headers: {
6606
7533
  [name: string]: unknown;
6607
7534
  };
6608
7535
  content: {
6609
- "application/json": components["schemas"]["TimeBucketRow"][];
7536
+ "application/json": components["schemas"]["PolymarketEvent"];
7537
+ };
7538
+ };
7539
+ /** @description Event not found */
7540
+ 404: {
7541
+ headers: {
7542
+ [name: string]: unknown;
6610
7543
  };
7544
+ content?: never;
6611
7545
  };
6612
7546
  };
6613
7547
  };
6614
- get_event: {
7548
+ get_event_holders_history: {
6615
7549
  parameters: {
6616
7550
  query?: {
6617
- /** @description Include tags array (default: true) */
6618
- include_tags?: boolean;
6619
- /** @description Include markets array with outcomes (default: true) */
6620
- include_markets?: boolean;
6621
- /** @description Include metrics object with all timeframes (default: true) */
6622
- include_metrics?: boolean;
6623
- /** @description Return truncated response optimized for AI consumers (default: false) */
6624
- ai?: boolean;
7551
+ /** @description Start timestamp (Unix seconds). If omitted, derived from `hours`. */
7552
+ from?: number;
7553
+ /** @description End timestamp (Unix seconds). Defaults to now. */
7554
+ to?: number;
7555
+ /** @description Number of candles to return (default: 500, max: 2500) */
7556
+ count_back?: number;
7557
+ /** @description Fallback time range in hours when `from`/`to` are not provided (default: 24, max: 336 = 14 days) */
7558
+ hours?: number;
7559
+ /** @description Cursor-based pagination key from previous response */
7560
+ pagination_key?: string;
6625
7561
  };
6626
7562
  header?: never;
6627
7563
  path: {
6628
- /** @description Event ID or slug */
6629
- identifier: string;
7564
+ /** @description Event slug */
7565
+ event_slug: string;
6630
7566
  };
6631
7567
  cookie?: never;
6632
7568
  };
6633
7569
  requestBody?: never;
6634
7570
  responses: {
6635
- /** @description Event with nested tags, markets, and series */
7571
+ /** @description Event holder count history. */
6636
7572
  200: {
6637
7573
  headers: {
6638
7574
  [name: string]: unknown;
6639
7575
  };
6640
7576
  content: {
6641
- "application/json": components["schemas"]["PolymarketEvent"];
7577
+ "application/json": components["schemas"]["HolderCountHistoryCandle"][];
6642
7578
  };
6643
7579
  };
6644
7580
  /** @description Event not found */
@@ -6655,7 +7591,7 @@ export interface operations {
6655
7591
  query?: {
6656
7592
  /** @description Market condition ID (0x-prefixed hex) */
6657
7593
  condition_id?: string;
6658
- /** @description Market slug (e.g. `will-trump-win`) */
7594
+ /** @description Market slug */
6659
7595
  market_slug?: string;
6660
7596
  /** @description Results limit per outcome (default: 10, max: 100) */
6661
7597
  limit?: number;
@@ -6667,8 +7603,6 @@ export interface operations {
6667
7603
  max_shares?: string;
6668
7604
  /** @description Include nested holder PnL data (default: false, +1 credit) */
6669
7605
  include_pnl?: boolean;
6670
- /** @description Return truncated response optimized for AI consumers (default: false) */
6671
- ai?: boolean;
6672
7606
  };
6673
7607
  header?: never;
6674
7608
  path?: never;
@@ -6676,7 +7610,7 @@ export interface operations {
6676
7610
  };
6677
7611
  requestBody?: never;
6678
7612
  responses: {
6679
- /** @description Market holders grouped by outcome (sorted by shares DESC). Holder `pnl` is included only when `include_pnl=true`. Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination. */
7613
+ /** @description Market holders grouped by outcome (sorted by shares DESC). */
6680
7614
  200: {
6681
7615
  headers: {
6682
7616
  [name: string]: unknown;
@@ -6699,9 +7633,9 @@ export interface operations {
6699
7633
  query?: {
6700
7634
  /** @description Market condition ID (0x-prefixed hex) */
6701
7635
  condition_id?: string;
6702
- /** @description Market slug (e.g. `will-trump-win`) */
7636
+ /** @description Market slug */
6703
7637
  market_slug?: string;
6704
- /** @description Start timestamp (Unix seconds). If omitted, derived from `hours` param. */
7638
+ /** @description Start timestamp (Unix seconds). If omitted, derived from `hours`. */
6705
7639
  from?: number;
6706
7640
  /** @description End timestamp (Unix seconds). Defaults to now. */
6707
7641
  to?: number;
@@ -6718,13 +7652,13 @@ export interface operations {
6718
7652
  };
6719
7653
  requestBody?: never;
6720
7654
  responses: {
6721
- /** @description Market holder count history with automatic granularity (1m/5m/15m/1h/6h buckets) */
7655
+ /** @description Market holder count history. */
6722
7656
  200: {
6723
7657
  headers: {
6724
7658
  [name: string]: unknown;
6725
7659
  };
6726
7660
  content: {
6727
- "application/json": components["schemas"]["HolderHistoryCandle"][];
7661
+ "application/json": components["schemas"]["HolderCountHistoryCandle"][];
6728
7662
  };
6729
7663
  };
6730
7664
  /** @description Market not found */
@@ -6749,8 +7683,6 @@ export interface operations {
6749
7683
  max_shares?: string;
6750
7684
  /** @description Include nested holder PnL data (default: false, +1 credit) */
6751
7685
  include_pnl?: boolean;
6752
- /** @description Return truncated response optimized for AI consumers (default: false) */
6753
- ai?: boolean;
6754
7686
  };
6755
7687
  header?: never;
6756
7688
  path: {
@@ -6761,7 +7693,7 @@ export interface operations {
6761
7693
  };
6762
7694
  requestBody?: never;
6763
7695
  responses: {
6764
- /** @description Position holders (sorted by shares DESC). Holder `pnl` is included only when `include_pnl=true`. Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination. */
7696
+ /** @description Position holders (sorted by shares DESC). Holder `pnl` is included only when `include_pnl=true`. */
6765
7697
  200: {
6766
7698
  headers: {
6767
7699
  [name: string]: unknown;
@@ -6782,7 +7714,7 @@ export interface operations {
6782
7714
  get_position_holders_history: {
6783
7715
  parameters: {
6784
7716
  query?: {
6785
- /** @description Start timestamp (Unix seconds). If omitted, derived from `hours` param. */
7717
+ /** @description Start timestamp (Unix seconds). If omitted, derived from `hours`. */
6786
7718
  from?: number;
6787
7719
  /** @description End timestamp (Unix seconds). Defaults to now. */
6788
7720
  to?: number;
@@ -6802,13 +7734,13 @@ export interface operations {
6802
7734
  };
6803
7735
  requestBody?: never;
6804
7736
  responses: {
6805
- /** @description Position holder count history with automatic granularity (1m/5m/15m/1h/6h buckets) */
7737
+ /** @description Position holder history. */
6806
7738
  200: {
6807
7739
  headers: {
6808
7740
  [name: string]: unknown;
6809
7741
  };
6810
7742
  content: {
6811
- "application/json": components["schemas"]["HolderHistoryCandle"][];
7743
+ "application/json": components["schemas"]["PositionHolderHistoryCandle"][];
6812
7744
  };
6813
7745
  };
6814
7746
  /** @description Position not found */
@@ -7150,13 +8082,17 @@ export interface operations {
7150
8082
  get_position_top_traders: {
7151
8083
  parameters: {
7152
8084
  query: {
7153
- /** @description Position ID (ERC1155 token ID) */
8085
+ /** @description Outcome-token ID */
7154
8086
  position_id: string;
7155
- /** @description Filter by position status (omit for all) */
7156
- status?: "open" | "closed";
7157
- /** @description Results limit (default: 10, max: 200) */
8087
+ /** @description Default: realized_pnl_usd */
8088
+ sort_by?: components["schemas"]["PositionPnlSortBy"];
8089
+ /** @description Default: desc */
8090
+ sort_direction?: components["schemas"]["SortDirection"];
8091
+ /** @description Default 50, max 200 */
7158
8092
  limit?: number;
7159
- /** @description Pagination key from the previous response */
8093
+ /** @description Max 2500. Takes precedence over pagination_key. */
8094
+ offset?: number;
8095
+ /** @description Cursor from a previous response */
7160
8096
  pagination_key?: string;
7161
8097
  };
7162
8098
  header?: never;
@@ -7165,14 +8101,21 @@ export interface operations {
7165
8101
  };
7166
8102
  requestBody?: never;
7167
8103
  responses: {
7168
- /** @description Top traders sorted by realized PnL desc. */
8104
+ /** @description Top traders for the position */
7169
8105
  200: {
7170
8106
  headers: {
7171
8107
  [name: string]: unknown;
7172
8108
  };
7173
8109
  content: {
7174
- "application/json": components["schemas"]["TopTraderPositionEntry"][];
8110
+ "application/json": components["schemas"]["PositionEntry"][];
8111
+ };
8112
+ };
8113
+ /** @description Invalid params */
8114
+ 400: {
8115
+ headers: {
8116
+ [name: string]: unknown;
7175
8117
  };
8118
+ content?: never;
7176
8119
  };
7177
8120
  };
7178
8121
  };
@@ -7304,13 +8247,15 @@ export interface operations {
7304
8247
  query?: {
7305
8248
  /** @description Market condition ID */
7306
8249
  condition_id?: string;
7307
- /** @description Market slug (alternative to condition_id) */
8250
+ /** @description Market slug */
7308
8251
  market_slug?: string;
7309
- /** @description Timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
8252
+ /** @description Default: lifetime */
7310
8253
  timeframe?: components["schemas"]["PnlTimeframe"];
7311
- /** @description Results limit (default: 10, max: 200) */
8254
+ /** @description Default 50, max 200 */
7312
8255
  limit?: number;
7313
- /** @description Pagination key from the previous response */
8256
+ /** @description Max 2500. Takes precedence over pagination_key. */
8257
+ offset?: number;
8258
+ /** @description Cursor from a previous response */
7314
8259
  pagination_key?: string;
7315
8260
  };
7316
8261
  header?: never;
@@ -7319,14 +8264,21 @@ export interface operations {
7319
8264
  };
7320
8265
  requestBody?: never;
7321
8266
  responses: {
7322
- /** @description Top traders sorted by realized PnL desc. */
8267
+ /** @description Top traders for the market */
7323
8268
  200: {
7324
8269
  headers: {
7325
8270
  [name: string]: unknown;
7326
8271
  };
7327
8272
  content: {
7328
- "application/json": components["schemas"]["TopTraderMarketEntry"][];
8273
+ "application/json": components["schemas"]["MarketEntry"][];
8274
+ };
8275
+ };
8276
+ /** @description Invalid params */
8277
+ 400: {
8278
+ headers: {
8279
+ [name: string]: unknown;
7329
8280
  };
8281
+ content?: never;
7330
8282
  };
7331
8283
  };
7332
8284
  };
@@ -7491,7 +8443,7 @@ export interface operations {
7491
8443
  parameters: {
7492
8444
  query?: {
7493
8445
  /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
7494
- timeframe?: components["schemas"]["ChangeTimeframe"];
8446
+ timeframe?: components["schemas"]["AnalyticsChangeTimeframe"];
7495
8447
  };
7496
8448
  header?: never;
7497
8449
  path: {
@@ -7508,7 +8460,7 @@ export interface operations {
7508
8460
  [name: string]: unknown;
7509
8461
  };
7510
8462
  content: {
7511
- "application/json": components["schemas"]["MetricPctChange"];
8463
+ "application/json": components["schemas"]["AnalyticsMetricPctChange"];
7512
8464
  };
7513
8465
  };
7514
8466
  };
@@ -7542,7 +8494,7 @@ export interface operations {
7542
8494
  [name: string]: unknown;
7543
8495
  };
7544
8496
  content: {
7545
- "application/json": components["schemas"]["TimeBucketRow"][];
8497
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
7546
8498
  };
7547
8499
  };
7548
8500
  };
@@ -7576,7 +8528,7 @@ export interface operations {
7576
8528
  [name: string]: unknown;
7577
8529
  };
7578
8530
  content: {
7579
- "application/json": components["schemas"]["TimeBucketRow"][];
8531
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
7580
8532
  };
7581
8533
  };
7582
8534
  };
@@ -8036,6 +8988,48 @@ export interface operations {
8036
8988
  };
8037
8989
  };
8038
8990
  };
8991
+ get_category_top_traders: {
8992
+ parameters: {
8993
+ query: {
8994
+ /** @description Polymarket category */
8995
+ category: components["schemas"]["PolymarketCategory"];
8996
+ /** @description Default: lifetime */
8997
+ timeframe?: components["schemas"]["PnlTimeframe"];
8998
+ /** @description Default: realized_pnl_usd */
8999
+ sort_by?: components["schemas"]["CategoryPnlSortBy"];
9000
+ /** @description Default: desc */
9001
+ sort_direction?: components["schemas"]["SortDirection"];
9002
+ /** @description Default 50, max 200 */
9003
+ limit?: number;
9004
+ /** @description Max 2500. Takes precedence over pagination_key. */
9005
+ offset?: number;
9006
+ /** @description Cursor from a previous response */
9007
+ pagination_key?: string;
9008
+ };
9009
+ header?: never;
9010
+ path?: never;
9011
+ cookie?: never;
9012
+ };
9013
+ requestBody?: never;
9014
+ responses: {
9015
+ /** @description Top traders for the category */
9016
+ 200: {
9017
+ headers: {
9018
+ [name: string]: unknown;
9019
+ };
9020
+ content: {
9021
+ "application/json": components["schemas"]["CategoryEntry"][];
9022
+ };
9023
+ };
9024
+ /** @description Invalid params */
9025
+ 400: {
9026
+ headers: {
9027
+ [name: string]: unknown;
9028
+ };
9029
+ content?: never;
9030
+ };
9031
+ };
9032
+ };
8039
9033
  get_tag_by_id: {
8040
9034
  parameters: {
8041
9035
  query?: {
@@ -8074,8 +9068,8 @@ export interface operations {
8074
9068
  get_tag_analytics_changes: {
8075
9069
  parameters: {
8076
9070
  query?: {
8077
- /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo (default: 24h) */
8078
- timeframe?: components["schemas"]["TagChangeTimeframe"];
9071
+ /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
9072
+ timeframe?: components["schemas"]["AnalyticsChangeTimeframe"];
8079
9073
  };
8080
9074
  header?: never;
8081
9075
  path: {
@@ -8092,7 +9086,7 @@ export interface operations {
8092
9086
  [name: string]: unknown;
8093
9087
  };
8094
9088
  content: {
8095
- "application/json": components["schemas"]["MetricPctChange"];
9089
+ "application/json": components["schemas"]["AnalyticsMetricPctChange"];
8096
9090
  };
8097
9091
  };
8098
9092
  };
@@ -8126,7 +9120,7 @@ export interface operations {
8126
9120
  [name: string]: unknown;
8127
9121
  };
8128
9122
  content: {
8129
- "application/json": components["schemas"]["TimeBucketRow"][];
9123
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
8130
9124
  };
8131
9125
  };
8132
9126
  };
@@ -8160,7 +9154,7 @@ export interface operations {
8160
9154
  [name: string]: unknown;
8161
9155
  };
8162
9156
  content: {
8163
- "application/json": components["schemas"]["TimeBucketRow"][];
9157
+ "application/json": components["schemas"]["AnalyticsTimeBucketRow"][];
8164
9158
  };
8165
9159
  };
8166
9160
  };
@@ -8168,15 +9162,15 @@ export interface operations {
8168
9162
  get_global_pnl: {
8169
9163
  parameters: {
8170
9164
  query?: {
8171
- /** @description Timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
9165
+ /** @description Default: lifetime */
8172
9166
  timeframe?: components["schemas"]["PnlTimeframe"];
8173
- /** @description Sort: realized_pnl_usd, buys, sells, redemptions, merges, avg_hold_time, markets_traded, events_traded, markets_won, volume_usd, fees, best_trade (default: realized_pnl_usd) */
8174
- sort_by?: components["schemas"]["GlobalPnlSortBy"];
8175
- /** @description Sort direction: asc, desc (default: desc) */
9167
+ /** @description Default: total_pnl_usd */
9168
+ sort_by?: components["schemas"]["TraderPnlSortBy"];
9169
+ /** @description Default: desc */
8176
9170
  sort_direction?: components["schemas"]["SortDirection"];
8177
- /** @description Results limit (default: 10, max: 200) */
9171
+ /** @description Default 50, max 500 */
8178
9172
  limit?: number;
8179
- /** @description Cursor-based pagination key */
9173
+ /** @description Cursor from a previous response */
8180
9174
  pagination_key?: string;
8181
9175
  };
8182
9176
  header?: never;
@@ -8185,67 +9179,102 @@ export interface operations {
8185
9179
  };
8186
9180
  requestBody?: never;
8187
9181
  responses: {
8188
- /** @description Global PnL leaderboard with trader stats. Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination. */
9182
+ /** @description Leaderboard page */
8189
9183
  200: {
8190
9184
  headers: {
8191
9185
  [name: string]: unknown;
8192
9186
  };
8193
9187
  content: {
8194
- "application/json": components["schemas"]["GlobalPnlTrader"][];
9188
+ "application/json": components["schemas"]["GlobalEntry"][];
9189
+ };
9190
+ };
9191
+ /** @description Invalid params */
9192
+ 400: {
9193
+ headers: {
9194
+ [name: string]: unknown;
8195
9195
  };
9196
+ content?: never;
8196
9197
  };
8197
9198
  };
8198
9199
  };
8199
- get_polymarket_leaderboard: {
9200
+ get_trader_pnl: {
8200
9201
  parameters: {
8201
9202
  query?: {
8202
- /** @description Aggregation window (default: lifetime) */
9203
+ /** @description Default: lifetime */
8203
9204
  timeframe?: components["schemas"]["PnlTimeframe"];
8204
- /** @description Order by: pnl or volume (default: pnl). Case-insensitive. */
8205
- sort_by?: components["schemas"]["LeaderboardSortBy"];
8206
- /** @description Rows per page, 1..=50 (default: 20) */
8207
- limit?: number;
8208
- /** @description Offset for pagination (default: 0) */
8209
- offset?: number;
8210
- /** @description Market category filter. Case-insensitive. Default: overall. */
8211
- category?: components["schemas"]["LeaderboardCategory"];
8212
9205
  };
8213
9206
  header?: never;
8214
- path?: never;
9207
+ path: {
9208
+ /** @description Trader wallet address */
9209
+ address: string;
9210
+ };
8215
9211
  cookie?: never;
8216
9212
  };
8217
9213
  requestBody?: never;
8218
9214
  responses: {
8219
- /** @description Leaderboard rows with full trader metrics. */
9215
+ /** @description Trader PnL summary */
8220
9216
  200: {
8221
9217
  headers: {
8222
9218
  [name: string]: unknown;
8223
9219
  };
8224
9220
  content: {
8225
- "application/json": components["schemas"]["LeaderboardEntry"][];
9221
+ "application/json": components["schemas"]["GlobalEntry"];
8226
9222
  };
8227
9223
  };
8228
- /** @description Bad request — invalid timeframe, sort_by, or category */
9224
+ /** @description Invalid params */
8229
9225
  400: {
8230
9226
  headers: {
8231
9227
  [name: string]: unknown;
8232
9228
  };
8233
9229
  content?: never;
8234
9230
  };
8235
- /** @description Leaderboard unavailable */
8236
- 500: {
9231
+ };
9232
+ };
9233
+ get_trader_pnl_calendar: {
9234
+ parameters: {
9235
+ query?: {
9236
+ /** @description Window size in days (default: 30, max: 30) */
9237
+ days?: number;
9238
+ /** @description Cursor from a previous response */
9239
+ pagination_key?: string;
9240
+ };
9241
+ header?: never;
9242
+ path: {
9243
+ /** @description Trader wallet address */
9244
+ address: string;
9245
+ };
9246
+ cookie?: never;
9247
+ };
9248
+ requestBody?: never;
9249
+ responses: {
9250
+ /** @description Daily PnL entries */
9251
+ 200: {
8237
9252
  headers: {
8238
9253
  [name: string]: unknown;
8239
9254
  };
8240
- content?: never;
9255
+ content: {
9256
+ "application/json": components["schemas"]["PnlCandleEntry"][];
9257
+ };
8241
9258
  };
8242
9259
  };
8243
9260
  };
8244
- get_trader_pnl: {
9261
+ get_trader_pnl_candles: {
8245
9262
  parameters: {
8246
9263
  query?: {
8247
- /** @description Timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
8248
- timeframe?: components["schemas"]["PnlTimeframe"];
9264
+ /** @description Candle bucket size. `auto` automatically decides resolution to try fit all candles within max `count_back` (2500) and overrides any caller-supplied `count_back`. Default: 1m for 1d, 1d otherwise. */
9265
+ resolution?: components["schemas"]["PnlCandleResolution"];
9266
+ /** @description Default: lifetime */
9267
+ timeframe?: components["schemas"]["PnlCandleTimeframe"];
9268
+ /** @description Start unix seconds. Overrides the timeframe lower bound. */
9269
+ from?: number;
9270
+ /** @description End unix seconds */
9271
+ to?: number;
9272
+ /** @description Number of candle buckets to return. Default 500, max 2500. Ignored when `resolution=auto` (forced to 2500). */
9273
+ count_back?: number;
9274
+ /** @description Cursor from a previous response */
9275
+ pagination_key?: string;
9276
+ /** @description Forward-fill missing buckets. Default: true. */
9277
+ fill_gaps?: boolean;
8249
9278
  };
8250
9279
  header?: never;
8251
9280
  path: {
@@ -8256,24 +9285,34 @@ export interface operations {
8256
9285
  };
8257
9286
  requestBody?: never;
8258
9287
  responses: {
8259
- /** @description Trader's global PnL summary */
9288
+ /** @description Trader PnL candles */
8260
9289
  200: {
8261
9290
  headers: {
8262
9291
  [name: string]: unknown;
8263
9292
  };
8264
9293
  content: {
8265
- "application/json": components["schemas"]["TraderPnlSummary"];
9294
+ "application/json": components["schemas"]["PnlCandlestickBar"][];
8266
9295
  };
8267
9296
  };
8268
9297
  };
8269
9298
  };
8270
- get_trader_pnl_calendar: {
9299
+ get_trader_category_pnl: {
8271
9300
  parameters: {
8272
9301
  query?: {
8273
- /** @description Window size in days (default: 30, max: 30) */
8274
- days?: number;
8275
- /** @description Pagination key obtained from a previous response to fetch an earlier window */
9302
+ /** @description Default: lifetime */
9303
+ timeframe?: components["schemas"]["PnlTimeframe"];
9304
+ /** @description Default: realized_pnl_usd */
9305
+ sort_by?: components["schemas"]["CategoryPnlSortBy"];
9306
+ /** @description Default: desc */
9307
+ sort_direction?: components["schemas"]["SortDirection"];
9308
+ /** @description Default 50, max 500 */
9309
+ limit?: number;
9310
+ /** @description Max 2500. Takes precedence over pagination_key. */
9311
+ offset?: number;
9312
+ /** @description Cursor from a previous response */
8276
9313
  pagination_key?: string;
9314
+ /** @description Filter to a single category */
9315
+ category?: components["schemas"]["PolymarketCategory"];
8277
9316
  };
8278
9317
  header?: never;
8279
9318
  path: {
@@ -8284,25 +9323,27 @@ export interface operations {
8284
9323
  };
8285
9324
  requestBody?: never;
8286
9325
  responses: {
8287
- /** @description Daily PnL entries (one per active trading day) */
9326
+ /** @description Per-category PnL rows */
8288
9327
  200: {
8289
9328
  headers: {
8290
9329
  [name: string]: unknown;
8291
9330
  };
8292
9331
  content: {
8293
- "application/json": components["schemas"]["PnlCandleEntry"][];
9332
+ "application/json": components["schemas"]["CategoryEntry"][];
9333
+ };
9334
+ };
9335
+ /** @description Invalid params */
9336
+ 400: {
9337
+ headers: {
9338
+ [name: string]: unknown;
8294
9339
  };
9340
+ content?: never;
8295
9341
  };
8296
9342
  };
8297
9343
  };
8298
- get_trader_pnl_candles: {
9344
+ get_trader_pnl_changes: {
8299
9345
  parameters: {
8300
- query?: {
8301
- /** @description Candle resolution (default: 1h) */
8302
- resolution?: components["schemas"]["PnlCandleResolution"];
8303
- /** @description Time range (default: lifetime) */
8304
- timeframe?: components["schemas"]["PnlCandleTimeframe"];
8305
- };
9346
+ query?: never;
8306
9347
  header?: never;
8307
9348
  path: {
8308
9349
  /** @description Trader wallet address */
@@ -8312,34 +9353,52 @@ export interface operations {
8312
9353
  };
8313
9354
  requestBody?: never;
8314
9355
  responses: {
8315
- /** @description Cumulative PnL candles */
9356
+ /** @description Trader PnL changes */
8316
9357
  200: {
8317
9358
  headers: {
8318
9359
  [name: string]: unknown;
8319
9360
  };
8320
9361
  content: {
8321
- "application/json": components["schemas"]["PnlCandleEntry"][];
9362
+ "application/json": components["schemas"]["PnlChangesResponse"];
8322
9363
  };
8323
9364
  };
8324
9365
  };
8325
9366
  };
8326
- get_trader_event_pnl: {
9367
+ get_trader_pnl_exits: {
8327
9368
  parameters: {
8328
9369
  query?: {
8329
- /** @description Timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
8330
- timeframe?: components["schemas"]["PnlTimeframe"];
8331
- /** @description Sort: realized_pnl_usd, total_volume_usd, markets_traded, total_fees, realized_pnl_pct (default: realized_pnl_usd) */
8332
- sort_by?: components["schemas"]["EventPnlSortBy"];
8333
- /** @description Sort direction: asc, desc (default: desc) */
8334
- sort_direction?: components["schemas"]["SortDirection"];
8335
- /** @description Results limit (default: 10, max: 200) */
9370
+ /** @description Default: lifetime */
9371
+ timeframe?: components["schemas"]["PnlCandleTimeframe"];
9372
+ /** @description Start unix seconds. Overrides the timeframe lower bound. */
9373
+ from?: number;
9374
+ /** @description End unix seconds */
9375
+ to?: number;
9376
+ /** @description Return only exits with this reason */
9377
+ reason?: components["schemas"]["PnlExitReason"];
9378
+ /** @description Return only exits in this market category */
9379
+ category?: components["schemas"]["PolymarketCategory"];
9380
+ /** @description Maximum exits to return. Default 500, max 2500. */
9381
+ count_back?: number;
9382
+ /** @description Alias for count_back. Default 500, max 2500. */
8336
9383
  limit?: number;
8337
- /** @description Row-skip offset (max: 3500). Takes precedence over pagination_key when both are set. */
9384
+ /** @description Sort field. Default exit_time. */
9385
+ sort_by?: components["schemas"]["PositionExitPnlSortBy"];
9386
+ /** @description Sort direction for sort_by. Default desc. */
9387
+ sort_direction?: components["schemas"]["SortDirection"];
9388
+ /** @description Shortcut: highest or lowest. Sorts by pnl_pct desc/asc. */
9389
+ profitability?: string;
9390
+ /** @description Minimum realized PnL USD to include. */
9391
+ min_pnl_usd?: number;
9392
+ /** @description Maximum realized PnL USD to include. */
9393
+ max_pnl_usd?: number;
9394
+ /** @description Minimum realized PnL percent to include. */
9395
+ min_pnl_pct?: number;
9396
+ /** @description Maximum realized PnL percent to include. */
9397
+ max_pnl_pct?: number;
9398
+ /** @description Offset for ranked sort pagination. Max 3500. */
8338
9399
  offset?: number;
8339
- /** @description Opaque cursor from a previous response. Pass verbatim for the next page. */
9400
+ /** @description Cursor from a previous response */
8340
9401
  pagination_key?: string;
8341
- /** @description Filter by event slug */
8342
- event_slug?: string;
8343
9402
  };
8344
9403
  header?: never;
8345
9404
  path: {
@@ -8350,13 +9409,13 @@ export interface operations {
8350
9409
  };
8351
9410
  requestBody?: never;
8352
9411
  responses: {
8353
- /** @description Event-level PnL entries for this trader */
9412
+ /** @description Trader position exits */
8354
9413
  200: {
8355
9414
  headers: {
8356
9415
  [name: string]: unknown;
8357
9416
  };
8358
9417
  content: {
8359
- "application/json": components["schemas"]["TraderEventPnlEntry"][];
9418
+ "application/json": components["schemas"]["PnlExitMarker"][];
8360
9419
  };
8361
9420
  };
8362
9421
  };
@@ -8364,23 +9423,21 @@ export interface operations {
8364
9423
  get_trader_market_pnl: {
8365
9424
  parameters: {
8366
9425
  query?: {
8367
- /** @description Timeframe: 1d, 7d, 30d, lifetime (default: lifetime) */
9426
+ /** @description Default: lifetime */
8368
9427
  timeframe?: components["schemas"]["PnlTimeframe"];
8369
- /** @description Sort: realized_pnl_usd, buy_usd, total_buys, total_fees, outcomes_traded, realized_pnl_pct (default: realized_pnl_usd) */
9428
+ /** @description Default: realized_pnl_usd */
8370
9429
  sort_by?: components["schemas"]["MarketPnlSortBy"];
8371
- /** @description Sort direction: asc, desc (default: desc) */
9430
+ /** @description Default: desc */
8372
9431
  sort_direction?: components["schemas"]["SortDirection"];
8373
- /** @description Results limit (default: 10, max: 200) */
9432
+ /** @description Default 50, max 500 */
8374
9433
  limit?: number;
8375
- /** @description Row-skip offset (max: 3500). Takes precedence over pagination_key when both are set. */
9434
+ /** @description Max 2500. Takes precedence over pagination_key. */
8376
9435
  offset?: number;
8377
- /** @description Opaque cursor from a previous response. Pass verbatim for the next page. */
9436
+ /** @description Cursor from a previous response */
8378
9437
  pagination_key?: string;
8379
- /** @description Filter by condition ID (or use market_slug) */
9438
+ /** @description Filter to a single market */
8380
9439
  condition_id?: string;
8381
- /** @description Filter by market slug (alternative to condition_id) */
8382
- market_slug?: string;
8383
- /** @description Filter by event slug */
9440
+ /** @description Filter to markets inside this event */
8384
9441
  event_slug?: string;
8385
9442
  };
8386
9443
  header?: never;
@@ -8392,13 +9449,46 @@ export interface operations {
8392
9449
  };
8393
9450
  requestBody?: never;
8394
9451
  responses: {
8395
- /** @description Market-level PnL entries for this trader */
9452
+ /** @description Per-market PnL rows */
9453
+ 200: {
9454
+ headers: {
9455
+ [name: string]: unknown;
9456
+ };
9457
+ content: {
9458
+ "application/json": components["schemas"]["MarketEntry"][];
9459
+ };
9460
+ };
9461
+ /** @description Invalid params */
9462
+ 400: {
9463
+ headers: {
9464
+ [name: string]: unknown;
9465
+ };
9466
+ content?: never;
9467
+ };
9468
+ };
9469
+ };
9470
+ get_trader_pnl_periods: {
9471
+ parameters: {
9472
+ query?: {
9473
+ /** @description Default: lifetime */
9474
+ timeframe?: components["schemas"]["PnlAnalyticsTimeframe"];
9475
+ };
9476
+ header?: never;
9477
+ path: {
9478
+ /** @description Trader wallet address */
9479
+ address: string;
9480
+ };
9481
+ cookie?: never;
9482
+ };
9483
+ requestBody?: never;
9484
+ responses: {
9485
+ /** @description Best and worst PnL periods */
8396
9486
  200: {
8397
9487
  headers: {
8398
9488
  [name: string]: unknown;
8399
9489
  };
8400
9490
  content: {
8401
- "application/json": components["schemas"]["TraderMarketPnlEntry"][];
9491
+ "application/json": components["schemas"]["PnlPeriodsResponse"];
8402
9492
  };
8403
9493
  };
8404
9494
  };
@@ -8406,30 +9496,65 @@ export interface operations {
8406
9496
  get_trader_position_pnl: {
8407
9497
  parameters: {
8408
9498
  query: {
8409
- /** @description Required. Filter by position status */
9499
+ /** @description Required. `open` for positions still holding shares, `closed` for positions that have been fully exited or resolved. */
8410
9500
  status: "open" | "closed";
8411
- /** @description Filter by outcome: true (won), false (lost), only for status=closed */
9501
+ /** @description Only valid with `status=closed`. `true` to include profitable closed positions, `false` for closed positions with zero or negative realized PnL. */
8412
9502
  won?: boolean;
8413
- /** @description Search by market title */
9503
+ /** @description Case-insensitive substring match on the market title. Scoped to the chosen `status` — results never cross the open/closed boundary. */
8414
9504
  search?: string;
8415
- /** @description Sort field (default: realized_pnl_usd) */
9505
+ /** @description Sort field. Default: realized_pnl_usd. status=open accepts: realized_pnl_usd, total_buy_usd, total_sell_usd, total_buys, total_sells, total_shares_bought, total_shares_sold, avg_entry_price, avg_exit_price, avg_price, total_fees, first_trade_at, last_trade_at, current_value, realized_pnl_pct, title, current_price, current_shares_balance, merge_count, split_count, end_date, is_neg_risk, redeemable, mergeable. status=closed accepts: realized_pnl_usd, total_buy_usd, total_sell_usd, redemption_usd, total_buys, total_sells, total_shares_bought, total_shares_sold, avg_entry_price, avg_exit_price, avg_price, total_fees, first_trade_at, last_trade_at, realized_pnl_pct, title, merge_count, split_count, end_date, is_neg_risk. */
8416
9506
  sort_by?: components["schemas"]["PositionPnlSortBy"];
8417
- /** @description Sort direction: asc, desc (default: desc) */
9507
+ /** @description Default: desc */
8418
9508
  sort_direction?: components["schemas"]["SortDirection"];
8419
- /** @description Results limit (default: 10, max: 200) */
9509
+ /** @description Default 10, max 200 */
8420
9510
  limit?: number;
8421
- /** @description Row-skip offset (max: 3500). Takes precedence over pagination_key when both are set. */
9511
+ /** @description Max 3500. Takes precedence over pagination_key. */
8422
9512
  offset?: number;
8423
- /** @description Opaque cursor from a previous response. Pass verbatim for the next page. */
9513
+ /** @description Cursor from a previous response */
8424
9514
  pagination_key?: string;
8425
- /** @description Filter by market condition ID (or use market_slug) */
9515
+ /** @description Filter to a single market */
8426
9516
  condition_id?: string;
8427
- /** @description Filter by market slug (alternative to condition_id) */
9517
+ /** @description Filter by market slug */
8428
9518
  market_slug?: string;
8429
- /** @description Filter by specific outcome token (position ID) */
9519
+ /** @description Filter to a single outcome token */
8430
9520
  position_id?: string;
8431
- /** @description Minimum shares balance to include. Status filtering already treats balances below 0.01 shares as dust. */
9521
+ /** @description Minimum shares balance to include */
8432
9522
  min_shares?: number;
9523
+ /** @description Filter positions to a single market category. Combinable with `sort_by`. */
9524
+ category?: components["schemas"]["PolymarketCategory"];
9525
+ };
9526
+ header?: never;
9527
+ path: {
9528
+ /** @description Trader wallet address */
9529
+ address: string;
9530
+ };
9531
+ cookie?: never;
9532
+ };
9533
+ requestBody?: never;
9534
+ responses: {
9535
+ /** @description Per-position PnL rows */
9536
+ 200: {
9537
+ headers: {
9538
+ [name: string]: unknown;
9539
+ };
9540
+ content: {
9541
+ "application/json": components["schemas"]["PositionEntry"][];
9542
+ };
9543
+ };
9544
+ /** @description Invalid params (missing `status`, unrecognised `sort_by`, or a `sort_by` value that's not allowed for the chosen status) */
9545
+ 400: {
9546
+ headers: {
9547
+ [name: string]: unknown;
9548
+ };
9549
+ content?: never;
9550
+ };
9551
+ };
9552
+ };
9553
+ get_trader_pnl_risk: {
9554
+ parameters: {
9555
+ query?: {
9556
+ /** @description Default: lifetime */
9557
+ timeframe?: components["schemas"]["PnlAnalyticsTimeframe"];
8433
9558
  };
8434
9559
  header?: never;
8435
9560
  path: {
@@ -8440,13 +9565,13 @@ export interface operations {
8440
9565
  };
8441
9566
  requestBody?: never;
8442
9567
  responses: {
8443
- /** @description Position-level PnL entries for this trader. Each entry is a specific outcome token with open/closed state, avg_entry_price, avg_exit_price, and redemption info. */
9568
+ /** @description Trader PnL risk */
8444
9569
  200: {
8445
9570
  headers: {
8446
9571
  [name: string]: unknown;
8447
9572
  };
8448
9573
  content: {
8449
- "application/json": components["schemas"]["TraderOutcomePnlEntry"][];
9574
+ "application/json": components["schemas"]["PnlRiskResponse"];
8450
9575
  };
8451
9576
  };
8452
9577
  };
@@ -8504,6 +9629,42 @@ export interface operations {
8504
9629
  };
8505
9630
  };
8506
9631
  };
9632
+ get_top_trades_markets: {
9633
+ parameters: {
9634
+ query?: {
9635
+ /** @description Default: lifetime */
9636
+ timeframe?: components["schemas"]["PnlTimeframe"];
9637
+ /** @description Default 50, max 200 */
9638
+ limit?: number;
9639
+ /** @description Max 2500. Takes precedence over pagination_key. */
9640
+ offset?: number;
9641
+ /** @description Cursor from a previous response */
9642
+ pagination_key?: string;
9643
+ };
9644
+ header?: never;
9645
+ path?: never;
9646
+ cookie?: never;
9647
+ };
9648
+ requestBody?: never;
9649
+ responses: {
9650
+ /** @description Top markets page */
9651
+ 200: {
9652
+ headers: {
9653
+ [name: string]: unknown;
9654
+ };
9655
+ content: {
9656
+ "application/json": components["schemas"]["MarketEntry"][];
9657
+ };
9658
+ };
9659
+ /** @description Invalid params */
9660
+ 400: {
9661
+ headers: {
9662
+ [name: string]: unknown;
9663
+ };
9664
+ content?: never;
9665
+ };
9666
+ };
9667
+ };
8507
9668
  get_trader_trades: {
8508
9669
  parameters: {
8509
9670
  query?: {
@@ -8573,8 +9734,8 @@ export interface operations {
8573
9734
  get_trader_volume_chart: {
8574
9735
  parameters: {
8575
9736
  query?: {
8576
- /** @description Time interval: 1, 5, 15, 30, 60, 240, D, 1D (default: 60) */
8577
- resolution?: components["schemas"]["CandlestickResolution"];
9737
+ /** @description Time interval: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
9738
+ resolution?: components["schemas"]["AnalyticsResolution"];
8578
9739
  /** @description Number of data points (max: 2500) */
8579
9740
  count_back?: number;
8580
9741
  /** @description Start timestamp (Unix seconds) */
@@ -8606,7 +9767,7 @@ export interface operations {
8606
9767
  parameters: {
8607
9768
  query?: {
8608
9769
  /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
8609
- timeframe?: components["schemas"]["ChangeTimeframe"];
9770
+ timeframe?: components["schemas"]["AnalyticsChangeTimeframe"];
8610
9771
  };
8611
9772
  header?: never;
8612
9773
  path: {
@@ -8623,7 +9784,7 @@ export interface operations {
8623
9784
  [name: string]: unknown;
8624
9785
  };
8625
9786
  content: {
8626
- "application/json": components["schemas"]["TraderMetricPctChange"];
9787
+ "application/json": components["schemas"]["TraderAnalyticsMetricPctChange"];
8627
9788
  };
8628
9789
  };
8629
9790
  };
@@ -8657,7 +9818,7 @@ export interface operations {
8657
9818
  [name: string]: unknown;
8658
9819
  };
8659
9820
  content: {
8660
- "application/json": components["schemas"]["TraderTimeBucketRow"][];
9821
+ "application/json": components["schemas"]["TraderAnalyticsDeltaTimeBucketRow"][];
8661
9822
  };
8662
9823
  };
8663
9824
  };
@@ -8691,7 +9852,7 @@ export interface operations {
8691
9852
  [name: string]: unknown;
8692
9853
  };
8693
9854
  content: {
8694
- "application/json": components["schemas"]["TraderTimeBucketRow"][];
9855
+ "application/json": components["schemas"]["TraderAnalyticsTimeBucketRow"][];
8695
9856
  };
8696
9857
  };
8697
9858
  };