@structbuild/sdk 0.5.7 → 0.5.9

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.
@@ -103,6 +103,26 @@ export interface paths {
103
103
  patch?: never;
104
104
  trace?: never;
105
105
  };
106
+ "/polymarket/asset-history/candlestick": {
107
+ parameters: {
108
+ query?: never;
109
+ header?: never;
110
+ path?: never;
111
+ cookie?: never;
112
+ };
113
+ /**
114
+ * Get OHLC candles for a crypto asset
115
+ * @description Retrieve OHLC candlestick data for a single crypto asset at the requested resolution.
116
+ */
117
+ get: operations["get_asset_candlestick"];
118
+ put?: never;
119
+ post?: never;
120
+ delete?: never;
121
+ options?: never;
122
+ head?: never;
123
+ patch?: never;
124
+ trace?: never;
125
+ };
106
126
  "/polymarket/builders": {
107
127
  parameters: {
108
128
  query?: never;
@@ -1363,7 +1383,7 @@ export interface paths {
1363
1383
  };
1364
1384
  /**
1365
1385
  * Get tag by slug
1366
- * @description Retrieve a single tag by its ID or slug. Pass `include_metrics=true` to attach analytics metrics (volume_usd, txn_count, unique_traders, fees_usd) — adds +1 credit. Use `timeframe` to select the window; defaults to `1d`.
1386
+ * @description Retrieve a single tag by its ID or slug. Pass `include_metrics=true` to attach analytics metrics (volume_usd, shares_volume, txn_count, unique_traders, unique_makers, unique_takers, fees_usd, and builder metrics) — adds +1 credit. Use `timeframe` to select the window; defaults to `1d`.
1367
1387
  */
1368
1388
  get: operations["get_tag_by_id"];
1369
1389
  put?: never;
@@ -1746,44 +1766,100 @@ export interface components {
1746
1766
  * @enum {string}
1747
1767
  */
1748
1768
  AnalyticsResolution: "60" | "240" | "D" | "1D" | "W" | "1W" | "M" | "1M";
1749
- /** @enum {string} */
1750
- SortDirection: "asc" | "desc";
1751
- /**
1752
- * @description Sort metric for the trader → builders list.
1753
- * @enum {string}
1754
- */
1755
- TraderBuilderSortBy: "volume" | "txns" | "fees";
1756
- /** @description Output payload for Split trades (deposit collateral → receive outcome tokens). */
1757
- SplitTrade: {
1758
- id: string;
1759
- hash: string;
1769
+ /** @description One builder's stats under a single tag. */
1770
+ TagBuilderRow: {
1771
+ builder_code: string;
1760
1772
  /** Format: int64 */
1761
- block?: number | null;
1773
+ block: number;
1774
+ /** Format: int32 */
1775
+ ts: number;
1776
+ /** Format: double */
1777
+ volume_usd: number;
1778
+ /** Format: double */
1779
+ buy_volume_usd: number;
1780
+ /** Format: double */
1781
+ sell_volume_usd: number;
1762
1782
  /** Format: int64 */
1763
- confirmed_at?: number | null;
1783
+ unique_traders: number;
1764
1784
  /** Format: int64 */
1765
- received_at?: number | null;
1785
+ unique_makers: number;
1766
1786
  /** Format: int64 */
1767
- log_index?: number | null;
1787
+ unique_takers: number;
1768
1788
  /** Format: int64 */
1769
- block_index?: number | null;
1770
- trader: components["schemas"]["TraderInfo"];
1771
- condition_id?: string | null;
1772
- question?: string | null;
1773
- image_url?: string | null;
1774
- slug?: string | null;
1775
- event_slug?: string | null;
1789
+ txn_count: number;
1790
+ /** Format: int64 */
1791
+ buy_count: number;
1792
+ /** Format: int64 */
1793
+ sell_count: number;
1776
1794
  /** Format: double */
1777
- usd_amount: number;
1778
- /** @description Per-position mint amounts */
1779
- position_details?: components["schemas"]["PositionDetail"][];
1780
- exchange: components["schemas"]["PolymarketExchange"];
1795
+ fees_usd: number;
1796
+ /** Format: double */
1797
+ builder_fees: number;
1798
+ /** Format: double */
1799
+ shares_volume: number;
1800
+ /** Format: double */
1801
+ yes_volume_usd: number;
1802
+ /** Format: double */
1803
+ no_volume_usd: number;
1804
+ /** Format: int64 */
1805
+ yes_count: number;
1806
+ /** Format: int64 */
1807
+ no_count: number;
1808
+ /** Format: int64 */
1809
+ buy_dist_under_10: number;
1810
+ /** Format: int64 */
1811
+ buy_dist_10_100: number;
1812
+ /** Format: int64 */
1813
+ buy_dist_100_1k: number;
1814
+ /** Format: int64 */
1815
+ buy_dist_1k_10k: number;
1816
+ /** Format: int64 */
1817
+ buy_dist_10k_50k: number;
1818
+ /** Format: int64 */
1819
+ 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;
1781
1826
  };
1782
1827
  /**
1783
- * @description Direction filter for spike webhooks.
1784
- * @enum {string}
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.
1785
1831
  */
1786
- SpikeDirection: "up" | "down" | "both";
1832
+ SpreadRow: {
1833
+ /** Format: int64 */
1834
+ ts: number;
1835
+ position_id: string;
1836
+ condition_id: string;
1837
+ /** Format: double */
1838
+ best_bid?: number | null;
1839
+ /** Format: double */
1840
+ best_ask?: number | null;
1841
+ /** Format: double */
1842
+ mid_price?: number | null;
1843
+ /** Format: double */
1844
+ spread?: number | null;
1845
+ /** Format: double */
1846
+ bid_liquidity_usd?: number | null;
1847
+ /** 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"];
1862
+ };
1787
1863
  /** @description V3 UMA OOv3: an assertion was disputed. */
1788
1864
  AssertionDisputedEvent: {
1789
1865
  id: string;
@@ -1868,6 +1944,20 @@ export interface components {
1868
1944
  slug?: string | null;
1869
1945
  event_slug?: string | null;
1870
1946
  };
1947
+ AssetCandlestickBar: {
1948
+ /** Format: double */
1949
+ l?: number | null;
1950
+ /** Format: double */
1951
+ h?: number | null;
1952
+ /** Format: double */
1953
+ o?: number | null;
1954
+ /** Format: double */
1955
+ c?: number | null;
1956
+ /** Format: int64 */
1957
+ t: number;
1958
+ };
1959
+ /** @enum {string} */
1960
+ AssetCandlestickResolution: "1S" | "1" | "5" | "15" | "30" | "60" | "240" | "D" | "1D";
1871
1961
  /** @description One bucket of an asset's price history at a fixed time-window resolution. */
1872
1962
  AssetPriceHistoryRow: {
1873
1963
  asset_symbol: string;
@@ -1903,32 +1993,13 @@ export interface components {
1903
1993
  /** @enum {string} */
1904
1994
  AssetVariant: "5m" | "15m" | "1h" | "4h" | "1d";
1905
1995
  /**
1906
- * @description One bucket of derived order-book metrics for a position at a point in time.
1907
- * Only summary metrics are returned — the underlying bid/ask ladders are
1908
- * available from the snapshot endpoint.
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.
2000
+ * @enum {string}
1909
2001
  */
1910
- SpreadRow: {
1911
- /** Format: int64 */
1912
- ts: number;
1913
- position_id: string;
1914
- condition_id: string;
1915
- /** Format: double */
1916
- best_bid?: number | null;
1917
- /** Format: double */
1918
- best_ask?: number | null;
1919
- /** Format: double */
1920
- mid_price?: number | null;
1921
- /** Format: double */
1922
- spread?: number | null;
1923
- /** Format: double */
1924
- bid_liquidity_usd?: number | null;
1925
- /** Format: double */
1926
- ask_liquidity_usd?: number | null;
1927
- /** Format: int32 */
1928
- bid_levels?: number | null;
1929
- /** Format: int32 */
1930
- ask_levels?: number | null;
1931
- };
2002
+ TagSortBy: "volume" | "shares_volume" | "txns" | "unique_traders" | "unique_makers" | "unique_takers" | "fees";
1932
2003
  BondMarket: {
1933
2004
  condition_id: string;
1934
2005
  title?: string | null;
@@ -1960,90 +2031,8 @@ export interface components {
1960
2031
  };
1961
2032
  /** @enum {string} */
1962
2033
  BondsSortBy: "end_date" | "apy" | "liquidity" | "volume";
1963
- /**
1964
- * @description Bucket row returned by both `/analytics/timeseries` (cumulative values
1965
- * at end of bucket) and `/analytics/deltas` (per-bucket deltas). All metrics
1966
- * the snapshot `/counts` returns are included.
1967
- *
1968
- * Short field names for compact JSON responses:
1969
- * t=bucket (unix seconds), v=volume_usd, bv=buy_volume_usd, sv=sell_volume_usd,
1970
- * ut=unique_traders, um=unique_makers, uk=unique_takers,
1971
- * tc=txn_count, bc=buy_count, sc=sell_count,
1972
- * rc=redemption_count, rv=redemption_volume_usd, mc=merge_count, mv=merge_volume_usd,
1973
- * sp=split_count, spv=split_volume_usd, f=fees_usd, sh=shares_volume,
1974
- * yv=yes_volume_usd, nv=no_volume_usd, yc=yes_count, nc=no_count,
1975
- * bd_*=buy distribution by USD bucket
1976
- */
1977
- TimeBucketRow: {
1978
- /** Format: int32 */
1979
- t: number;
1980
- /** Format: double */
1981
- v: number;
1982
- /** Format: double */
1983
- bv: number;
1984
- /** Format: double */
1985
- sv: number;
1986
- /** Format: int64 */
1987
- tc: number;
1988
- /** Format: int64 */
1989
- bc: number;
1990
- /** Format: int64 */
1991
- sc: number;
1992
- /** Format: int64 */
1993
- rc: number;
1994
- /** Format: double */
1995
- rv: number;
1996
- /** Format: int64 */
1997
- mc: number;
1998
- /** Format: double */
1999
- mv: number;
2000
- /** Format: int64 */
2001
- sp: number;
2002
- /** Format: double */
2003
- spv: number;
2004
- /** Format: double */
2005
- f: number;
2006
- /** Format: double */
2007
- sh: number;
2008
- /** Format: double */
2009
- yv: number;
2010
- /** Format: double */
2011
- nv: number;
2012
- /** Format: int64 */
2013
- yc: number;
2014
- /** Format: int64 */
2015
- nc: number;
2016
- /**
2017
- * Format: int64
2018
- * @description Buy distribution — count of buy trades falling in each USD bucket.
2019
- */
2020
- bd_u10: number;
2021
- /** Format: int64 */
2022
- bd_100: number;
2023
- /** Format: int64 */
2024
- bd_1k: number;
2025
- /** Format: int64 */
2026
- bd_10k: number;
2027
- /** Format: int64 */
2028
- bd_50k: number;
2029
- /** Format: int64 */
2030
- bd_50p: number;
2031
- /**
2032
- * Format: int64
2033
- * @description Distinct traders ACTIVE in this bucket (window-unique, not first-time).
2034
- */
2035
- ut: number;
2036
- /**
2037
- * Format: int64
2038
- * @description Distinct makers active in this bucket.
2039
- */
2040
- um: number;
2041
- /**
2042
- * Format: int64
2043
- * @description Distinct takers active in this bucket.
2044
- */
2045
- uk: number;
2046
- };
2034
+ /** @enum {string} */
2035
+ SortDirection: "asc" | "desc";
2047
2036
  BuilderFeeRate: {
2048
2037
  code: string;
2049
2038
  /** Format: int32 */
@@ -2307,9 +2296,20 @@ export interface components {
2307
2296
  avg_vol_per_user: number;
2308
2297
  };
2309
2298
  /**
2310
- * @description Trader profile info embedded in API responses
2311
- *
2312
- * Corresponds to SQL function: `pm_build_trader(address, name, pseudonym, profile_image, x_username, verified_badge)`
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
2313
  *
2314
2314
  * Used in:
2315
2315
  * - holders endpoints (market/event holders)
@@ -2324,8 +2324,6 @@ export interface components {
2324
2324
  x_username?: string | null;
2325
2325
  verified_badge?: boolean;
2326
2326
  };
2327
- /** @enum {string} */
2328
- TradeType: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "22" | "23" | "24";
2329
2327
  /**
2330
2328
  * @description Sort metric for the builders list endpoint.
2331
2329
  * @enum {string}
@@ -2479,85 +2477,49 @@ export interface components {
2479
2477
  * @enum {string}
2480
2478
  */
2481
2479
  BuilderTimeframe: "lifetime" | "1d" | "7d" | "30d";
2482
- /**
2483
- * @description Tagged enum for all trade types — serializes with `"trade_type": "..."` discriminator
2484
- * and only includes fields relevant to each type.
2485
- */
2486
- TradeEvent: (components["schemas"]["OrderFilledTrade"] & {
2487
- /** @enum {string} */
2488
- trade_type: "OrderFilled";
2489
- }) | (components["schemas"]["OrderFilledTrade"] & {
2490
- /** @enum {string} */
2491
- trade_type: "OrdersMatched";
2492
- }) | (components["schemas"]["OrderFilledTrade"] & {
2493
- /** @enum {string} */
2494
- trade_type: "MakerRebate";
2495
- }) | (components["schemas"]["OrderFilledTrade"] & {
2496
- /** @enum {string} */
2497
- trade_type: "Reward";
2498
- }) | (components["schemas"]["OrderFilledTrade"] & {
2499
- /** @enum {string} */
2500
- trade_type: "Yield";
2501
- }) | (components["schemas"]["RedemptionTrade"] & {
2502
- /** @enum {string} */
2503
- trade_type: "Redemption";
2504
- }) | (components["schemas"]["MergeTrade"] & {
2505
- /** @enum {string} */
2506
- trade_type: "Merge";
2507
- }) | (components["schemas"]["SplitTrade"] & {
2508
- /** @enum {string} */
2509
- trade_type: "Split";
2510
- }) | (components["schemas"]["PositionsConvertedTrade"] & {
2511
- /** @enum {string} */
2512
- trade_type: "PositionsConverted";
2513
- }) | (components["schemas"]["CancelledTrade"] & {
2514
- /** @enum {string} */
2515
- trade_type: "Cancelled";
2516
- }) | (components["schemas"]["QuestionInitializedEvent"] & {
2517
- /** @enum {string} */
2518
- trade_type: "Initialization";
2519
- }) | (components["schemas"]["AssertionMadeEvent"] & {
2520
- /** @enum {string} */
2521
- trade_type: "Proposal";
2522
- }) | (components["schemas"]["AssertionDisputedEvent"] & {
2523
- /** @enum {string} */
2524
- trade_type: "Dispute";
2525
- }) | (components["schemas"]["AssertionSettledEvent"] & {
2526
- /** @enum {string} */
2527
- trade_type: "Settled";
2528
- }) | (components["schemas"]["QuestionResolvedEvent"] & {
2529
- /** @enum {string} */
2530
- trade_type: "Resolution";
2531
- }) | (components["schemas"]["ConditionResolutionEvent"] & {
2532
- /** @enum {string} */
2533
- trade_type: "ConditionResolution";
2534
- }) | (components["schemas"]["QuestionResetEvent"] & {
2535
- /** @enum {string} */
2536
- trade_type: "Reset";
2537
- }) | (components["schemas"]["QuestionFlaggedEvent"] & {
2538
- /** @enum {string} */
2539
- trade_type: "Flag";
2540
- }) | (components["schemas"]["QuestionUnflaggedEvent"] & {
2541
- /** @enum {string} */
2542
- trade_type: "Unflag";
2543
- }) | (components["schemas"]["QuestionPausedEvent"] & {
2544
- /** @enum {string} */
2545
- trade_type: "Pause";
2546
- }) | (components["schemas"]["QuestionUnpausedEvent"] & {
2547
- /** @enum {string} */
2548
- trade_type: "Unpause";
2549
- }) | (components["schemas"]["QuestionEmergencyResolvedEvent"] & {
2550
- /** @enum {string} */
2551
- trade_type: "ManualResolution";
2552
- }) | (components["schemas"]["NegRiskOutcomeReportedEvent"] & {
2553
- /** @enum {string} */
2554
- trade_type: "NegRiskOutcomeReported";
2555
- }) | (components["schemas"]["RegisterTokenTrade"] & {
2556
- /** @enum {string} */
2557
- trade_type: "RegisterToken";
2558
- });
2559
- /** @enum {string} */
2560
- TradeSide: "0" | "1";
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;
2492
+ /** Format: int64 */
2493
+ outcomes_traded?: number | null;
2494
+ /** Format: int64 */
2495
+ total_buys?: number | null;
2496
+ /** Format: int64 */
2497
+ total_sells?: number | null;
2498
+ /** Format: int64 */
2499
+ total_redemptions?: number | null;
2500
+ /** Format: int64 */
2501
+ total_merges?: number | null;
2502
+ /** Format: double */
2503
+ buy_usd?: number | null;
2504
+ /** Format: double */
2505
+ sell_usd?: number | null;
2506
+ /** Format: double */
2507
+ redemption_usd?: number | null;
2508
+ /** Format: double */
2509
+ merge_usd?: number | null;
2510
+ /** Format: double */
2511
+ realized_pnl_usd?: number | null;
2512
+ /** Format: int64 */
2513
+ winning_outcomes?: number | null;
2514
+ /** Format: double */
2515
+ total_fees?: number | null;
2516
+ /** Format: int64 */
2517
+ first_trade_at?: number | null;
2518
+ /** Format: int64 */
2519
+ last_trade_at?: number | null;
2520
+ /** Format: double */
2521
+ realized_pnl_pct?: number | null;
2522
+ };
2561
2523
  /** @description Output payload for Cancelled orders. */
2562
2524
  CancelledTrade: {
2563
2525
  id: string;
@@ -2588,77 +2550,96 @@ export interface components {
2588
2550
  ChangeTimeframe: "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
2589
2551
  /** @enum {string} */
2590
2552
  ChartResolution: "1H" | "6H" | "1D" | "1W" | "1M" | "ALL";
2591
- TopTraderMarketEntry: {
2592
- trader: components["schemas"]["TraderInfo"];
2593
- /** Format: double */
2594
- realized_pnl_usd?: number | null;
2595
- /** Format: double */
2596
- realized_pnl_pct?: number | null;
2597
- /** Format: double */
2598
- buy_usd?: number | null;
2599
- /** Format: double */
2600
- sell_usd?: number | null;
2553
+ TopTraderRow: {
2554
+ trader: string;
2601
2555
  /** Format: double */
2602
- redemption_usd?: number | null;
2556
+ volume_usd: number;
2557
+ /** Format: int64 */
2558
+ txn_count: number;
2603
2559
  /** Format: double */
2604
- merge_usd?: number | null;
2560
+ fees_usd: number;
2605
2561
  /** Format: double */
2606
- total_fees?: number | null;
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;
2607
2586
  /** Format: int64 */
2608
2587
  total_buys?: number | null;
2609
2588
  /** Format: int64 */
2610
2589
  total_sells?: number | null;
2611
- /** Format: int64 */
2612
- total_redemptions?: number | null;
2613
- /** Format: int64 */
2614
- total_merges?: number | null;
2615
- /** Format: int64 */
2616
- outcomes_traded?: number | null;
2617
- /** Format: int64 */
2618
- winning_outcomes?: number | null;
2619
- /** Format: int64 */
2620
- first_trade_at?: number | null;
2621
- /** Format: int64 */
2622
- last_trade_at?: number | null;
2623
- };
2624
- TopTraderPositionEntry: {
2625
- trader: components["schemas"]["TraderInfo"];
2626
- /** Format: double */
2627
- realized_pnl_usd?: number | null;
2628
2590
  /** Format: double */
2629
- realized_pnl_pct?: number | null;
2630
- /** Format: double */
2631
- shares?: number | null;
2591
+ total_shares_bought?: number | null;
2632
2592
  /** Format: double */
2633
- buy_usd?: number | null;
2593
+ total_shares_sold?: number | null;
2634
2594
  /** Format: double */
2635
- sell_usd?: number | null;
2595
+ total_buy_usd?: number | null;
2636
2596
  /** Format: double */
2597
+ total_sell_usd?: number | null;
2598
+ /**
2599
+ * Format: double
2600
+ * @description Payout on redemption (non-zero only if won)
2601
+ */
2637
2602
  redemption_usd?: number | null;
2638
- /** Format: double */
2639
- total_fees?: number | null;
2640
- /** Format: double */
2603
+ /**
2604
+ * Format: double
2605
+ * @description VWAP price paid per share across all buys (0–1)
2606
+ */
2641
2607
  avg_entry_price?: number | null;
2642
- /** Format: double */
2608
+ /**
2609
+ * Format: double
2610
+ * @description VWAP price received per share across all sells (0–1)
2611
+ */
2643
2612
  avg_exit_price?: number | null;
2644
- /** Format: int64 */
2645
- total_buys?: number | null;
2646
- /** Format: int64 */
2647
- total_sells?: number | null;
2648
- won?: boolean | null;
2613
+ /** Format: double */
2614
+ realized_pnl_usd?: number | null;
2615
+ /** Format: double */
2616
+ total_fees?: number | null;
2649
2617
  /** Format: int64 */
2650
2618
  first_trade_at?: number | null;
2651
2619
  /** Format: int64 */
2652
2620
  last_trade_at?: number | null;
2653
- };
2654
- /** @description Trader profile info - backwards compatibility */
2655
- TraderInfo: {
2656
- address: string;
2657
- name?: string | null;
2658
- pseudonym?: string | null;
2659
- profile_image?: string | null;
2660
- x_username?: string | null;
2661
- verified_badge?: boolean;
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;
2662
2643
  };
2663
2644
  /** @description CLOB reward (public API format) */
2664
2645
  ClobReward: {
@@ -2882,6 +2863,10 @@ export interface components {
2882
2863
  /** Format: int32 */
2883
2864
  unique_traders: number;
2884
2865
  /** Format: int32 */
2866
+ unique_makers: number;
2867
+ /** Format: int32 */
2868
+ unique_takers: number;
2869
+ /** Format: int32 */
2885
2870
  unique_builder_traders: number;
2886
2871
  /** Format: double */
2887
2872
  avg_trade_usd: number;
@@ -3067,6 +3052,10 @@ export interface components {
3067
3052
  /** Format: int32 */
3068
3053
  unique_traders: number;
3069
3054
  /** Format: int32 */
3055
+ unique_makers: number;
3056
+ /** Format: int32 */
3057
+ unique_takers: number;
3058
+ /** Format: int32 */
3070
3059
  unique_builder_traders: number;
3071
3060
  /** Format: double */
3072
3061
  avg_trade_usd: number;
@@ -3078,13 +3067,82 @@ export interface components {
3078
3067
  /** @enum {string} */
3079
3068
  EventSortBy: "volume" | "txns" | "unique_traders" | "title" | "creation_date" | "start_date" | "end_date" | "relevance";
3080
3069
  /**
3081
- * @description Metric to order by when `sort=<value>` is provided.
3082
- *
3083
- * `unique_*` variants rank by the number of distinct wallet addresses
3084
- * active in the selected timeframe.
3085
- * @enum {string}
3070
+ * @description Tagged enum for all trade types — serializes with `"trade_type": "..."` discriminator
3071
+ * and only includes fields relevant to each type.
3086
3072
  */
3087
- TagSortBy: "volume" | "txns" | "unique_traders" | "unique_makers" | "unique_takers" | "fees";
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
+ });
3088
3146
  /**
3089
3147
  * @description One tag's stats aggregated across every builder routing activity into it.
3090
3148
  *
@@ -3735,44 +3793,31 @@ export interface components {
3735
3793
  slug?: string | null;
3736
3794
  event_slug?: string | null;
3737
3795
  };
3738
- TopTraderEventEntry: {
3739
- trader: components["schemas"]["TraderInfo"];
3740
- /** Format: double */
3741
- realized_pnl_usd?: number | null;
3742
- /** Format: double */
3743
- realized_pnl_pct?: number | null;
3744
- /** Format: double */
3745
- total_volume_usd?: number | null;
3746
- /** Format: double */
3747
- buy_usd?: number | null;
3748
- /** Format: double */
3749
- sell_usd?: number | null;
3750
- /** Format: double */
3751
- redemption_usd?: number | null;
3752
- /** Format: double */
3753
- merge_usd?: number | null;
3754
- /** Format: double */
3755
- total_fees?: number | null;
3756
- /** Format: int64 */
3757
- total_buys?: number | null;
3758
- /** Format: int64 */
3759
- total_sells?: number | null;
3760
- /** Format: int64 */
3761
- total_redemptions?: number | null;
3762
- /** Format: int64 */
3763
- total_merges?: number | null;
3764
- /** Format: int64 */
3765
- markets_traded?: number | null;
3796
+ /** @description Output payload for Split trades (deposit collateral → receive outcome tokens). */
3797
+ SplitTrade: {
3798
+ id: string;
3799
+ hash: string;
3766
3800
  /** Format: int64 */
3767
- outcomes_traded?: number | null;
3801
+ block?: number | null;
3768
3802
  /** Format: int64 */
3769
- winning_markets?: number | null;
3803
+ confirmed_at?: number | null;
3770
3804
  /** Format: int64 */
3771
- losing_markets?: number | null;
3805
+ received_at?: number | null;
3772
3806
  /** Format: int64 */
3773
- first_trade_at?: number | null;
3807
+ log_index?: number | null;
3774
3808
  /** Format: int64 */
3775
- last_trade_at?: number | null;
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"];
3776
3821
  };
3777
3822
  /**
3778
3823
  * @description Tagged enum for all oracle event types — serializes with `"event_type": "..."` discriminator
@@ -3883,25 +3928,12 @@ export interface components {
3883
3928
  */
3884
3929
  builder_fee?: number | null;
3885
3930
  };
3886
- /** @description Event-level PnL entry */
3887
- TraderEventPnlEntry: {
3888
- event_slug?: string | null;
3889
- question?: string | null;
3890
- image_url?: string | null;
3891
- /** Format: int64 */
3892
- markets_traded?: number | null;
3893
- /** Format: int64 */
3894
- outcomes_traded?: number | null;
3895
- /** Format: int64 */
3896
- total_buys?: number | null;
3897
- /** Format: int64 */
3898
- total_sells?: number | null;
3899
- /** Format: int64 */
3900
- total_redemptions?: number | null;
3901
- /** Format: int64 */
3902
- total_merges?: number | null;
3931
+ TopTraderMarketEntry: {
3932
+ trader: components["schemas"]["TraderInfo"];
3903
3933
  /** Format: double */
3904
- total_volume_usd?: number | null;
3934
+ realized_pnl_usd?: number | null;
3935
+ /** Format: double */
3936
+ realized_pnl_pct?: number | null;
3905
3937
  /** Format: double */
3906
3938
  buy_usd?: number | null;
3907
3939
  /** Format: double */
@@ -3911,19 +3943,23 @@ export interface components {
3911
3943
  /** Format: double */
3912
3944
  merge_usd?: number | null;
3913
3945
  /** Format: double */
3914
- realized_pnl_usd?: number | null;
3946
+ total_fees?: number | null;
3915
3947
  /** Format: int64 */
3916
- winning_markets?: number | null;
3948
+ total_buys?: number | null;
3917
3949
  /** Format: int64 */
3918
- losing_markets?: number | null;
3919
- /** Format: double */
3920
- total_fees?: number | null;
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;
3921
3959
  /** Format: int64 */
3922
3960
  first_trade_at?: number | null;
3923
3961
  /** Format: int64 */
3924
3962
  last_trade_at?: number | null;
3925
- /** Format: double */
3926
- realized_pnl_pct?: number | null;
3927
3963
  };
3928
3964
  OrderbookHistoryRow: {
3929
3965
  /** Format: int64 */
@@ -4118,233 +4154,93 @@ export interface components {
4118
4154
  * Format: int32
4119
4155
  * @default 0
4120
4156
  */
4121
- unique_builder_traders: number;
4122
- /**
4123
- * Format: double
4124
- * @default null
4125
- */
4126
- price_open: number | null;
4127
- /**
4128
- * Format: double
4129
- * @default null
4130
- */
4131
- price_close: number | null;
4132
- /**
4133
- * Format: double
4134
- * @default null
4135
- */
4136
- price_high: number | null;
4137
- /**
4138
- * Format: double
4139
- * @default null
4140
- */
4141
- price_low: number | null;
4142
- /**
4143
- * Format: double
4144
- * @default null
4145
- */
4146
- price_change_percent: number | null;
4147
- };
4148
- /** @description Pagination metadata to include in API responses */
4149
- PaginationMeta: {
4150
- /** @description Whether there are more results available */
4151
- has_more: boolean;
4152
- /** @description Pagination key for the next page (if has_more is true) */
4153
- pagination_key?: string | null;
4154
- };
4155
- /** @description A single PnL candle entry */
4156
- PnlCandleEntry: {
4157
- /**
4158
- * Format: int64
4159
- * @description Timestamp in epoch seconds (start of bucket window)
4160
- */
4161
- t: number;
4162
- /**
4163
- * Format: double
4164
- * @description Realized PnL in this bucket (USD)
4165
- */
4166
- pnl: number;
4167
- };
4168
- /** @enum {string} */
4169
- PnlCandleResolution: "1m" | "1h" | "1d";
4170
- /** @enum {string} */
4171
- PnlCandleTimeframe: "1d" | "7d" | "30d" | "lifetime";
4172
- /** @enum {string} */
4173
- PnlTimeframe: "1d" | "7d" | "30d" | "lifetime";
4174
- /**
4175
- * @description Crypto asset symbols accepted by `asset_price_tick` and `asset_price_window_update` filters.
4176
- * @enum {string}
4177
- */
4178
- WebhookAssetSymbol: "BTC" | "ETH" | "SOL" | "XRP" | "DOGE" | "BNB" | "HYPE";
4179
- /**
4180
- * @description Timeframe values accepted by webhook metric, milestone, spike, and asset-price filters.
4181
- * @enum {string}
4182
- */
4183
- WebhookTimeframe: "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "6h" | "1d" | "24h" | "7d" | "30d";
4184
- /** @description V2 UMA OOv2: a price request was settled (final resolution). */
4185
- SettleEvent: {
4186
- id: string;
4187
- hash: string;
4188
- /** Format: int64 */
4189
- block?: number | null;
4190
- /** Format: int64 */
4191
- confirmed_at?: number | null;
4192
- /** Format: int64 */
4193
- received_at?: number | null;
4194
- /** Format: int64 */
4195
- log_index?: number | null;
4196
- /** Format: int64 */
4197
- block_index?: number | null;
4198
- oracle_contract: string;
4199
- requester: string;
4200
- proposer: string;
4201
- disputer: string;
4202
- identifier: string;
4203
- timestamp: string;
4204
- ancillary_data: string;
4205
- /** Format: int64 */
4206
- proposed_price: number;
4207
- payout: string;
4208
- disputed: boolean;
4209
- condition_id?: string | null;
4210
- proposed_outcome?: string | null;
4211
- question?: string | null;
4212
- image_url?: string | null;
4213
- slug?: string | null;
4214
- event_slug?: string | null;
4215
- };
4216
- TraderWithPnl: components["schemas"]["Trader"] & {
4217
- pnl?: null | components["schemas"]["TraderPnlSummary"];
4218
- };
4219
- /** @description One builder's stats under a single tag. */
4220
- TagBuilderRow: {
4221
- builder_code: string;
4222
- /** Format: int64 */
4223
- block: number;
4224
- /** Format: int32 */
4225
- ts: number;
4226
- /** Format: double */
4227
- volume_usd: number;
4228
- /** Format: double */
4229
- buy_volume_usd: number;
4230
- /** Format: double */
4231
- sell_volume_usd: number;
4232
- /** Format: int64 */
4233
- unique_traders: number;
4234
- /** Format: int64 */
4235
4157
  unique_makers: number;
4236
- /** Format: int64 */
4237
- unique_takers: number;
4238
- /** Format: int64 */
4239
- txn_count: number;
4240
- /** Format: int64 */
4241
- buy_count: number;
4242
- /** Format: int64 */
4243
- sell_count: number;
4244
- /** Format: double */
4245
- fees_usd: number;
4246
- /** Format: double */
4247
- builder_fees: number;
4248
- /** Format: double */
4249
- shares_volume: number;
4250
- /** Format: double */
4251
- yes_volume_usd: number;
4252
- /** Format: double */
4253
- no_volume_usd: number;
4254
- /** Format: int64 */
4255
- yes_count: number;
4256
- /** Format: int64 */
4257
- no_count: number;
4258
- /** Format: int64 */
4259
- buy_dist_under_10: number;
4260
- /** Format: int64 */
4261
- buy_dist_10_100: number;
4262
- /** Format: int64 */
4263
- buy_dist_100_1k: number;
4264
- /** Format: int64 */
4265
- buy_dist_1k_10k: number;
4266
- /** Format: int64 */
4267
- buy_dist_10k_50k: number;
4268
- /** Format: int64 */
4269
- buy_dist_50k_plus: number;
4270
- /** Format: int64 */
4271
- new_users: number;
4272
- /** Format: double */
4273
- avg_rev_per_user: number;
4274
- /** Format: double */
4275
- avg_vol_per_user: number;
4276
- };
4277
- /** @description Outcome-level PnL entry (per outcome token / position_id) */
4278
- TraderOutcomePnlEntry: {
4279
- position_id?: string | null;
4280
- condition_id?: string | null;
4281
- market_slug?: string | null;
4282
- event_slug?: string | null;
4283
- title?: string | null;
4284
- image_url?: string | null;
4285
- outcome?: string | null;
4286
- /** Format: int32 */
4287
- outcome_index?: number | null;
4288
- /** @description TRUE = won, FALSE = lost, NULL = open or sold before resolution */
4289
- won?: boolean | null;
4290
- /** Format: int64 */
4291
- total_buys?: number | null;
4292
- /** Format: int64 */
4293
- total_sells?: number | null;
4294
- /** Format: double */
4295
- total_shares_bought?: number | null;
4296
- /** Format: double */
4297
- total_shares_sold?: number | null;
4298
- /** Format: double */
4299
- total_buy_usd?: number | null;
4300
- /** Format: double */
4301
- total_sell_usd?: number | null;
4302
4158
  /**
4303
- * Format: double
4304
- * @description Payout on redemption (non-zero only if won)
4159
+ * Format: int32
4160
+ * @default 0
4305
4161
  */
4306
- redemption_usd?: number | null;
4162
+ unique_takers: number;
4307
4163
  /**
4308
- * Format: double
4309
- * @description VWAP price paid per share across all buys (0–1)
4164
+ * Format: int32
4165
+ * @default 0
4310
4166
  */
4311
- avg_entry_price?: number | null;
4167
+ unique_builder_traders: number;
4312
4168
  /**
4313
4169
  * Format: double
4314
- * @description VWAP price received per share across all sells (0–1)
4315
- */
4316
- avg_exit_price?: number | null;
4317
- /** Format: double */
4318
- realized_pnl_usd?: number | null;
4319
- /** Format: double */
4320
- total_fees?: number | null;
4321
- /** Format: int64 */
4322
- first_trade_at?: number | null;
4323
- /** Format: int64 */
4324
- last_trade_at?: number | null;
4170
+ * @default null
4171
+ */
4172
+ price_open: number | null;
4325
4173
  /**
4326
4174
  * Format: double
4327
- * @description Last traded price for this outcome (0–1). NULL if market_outcomes has no price yet.
4175
+ * @default null
4328
4176
  */
4329
- current_price?: number | null;
4177
+ price_close: number | null;
4330
4178
  /**
4331
4179
  * Format: double
4332
- * @description Current shares held: balance / 1e6.
4180
+ * @default null
4333
4181
  */
4334
- current_shares_balance?: number | null;
4182
+ price_high: number | null;
4335
4183
  /**
4336
4184
  * Format: double
4337
- * @description Estimated current USD value of held shares: (balance / 1e6) * current_price.
4338
- * Only meaningful for open positions (balance above dust threshold).
4185
+ * @default null
4339
4186
  */
4340
- current_value?: number | null;
4187
+ price_low: number | null;
4341
4188
  /**
4342
4189
  * Format: double
4343
- * @description Realized PnL as a percentage of total spend: (realized_pnl_usd / total_buy_usd) * 100.
4344
- * NULL when total_buy_usd = 0.
4190
+ * @default null
4345
4191
  */
4346
- realized_pnl_pct?: number | null;
4192
+ price_change_percent: number | null;
4193
+ };
4194
+ /** @description Pagination metadata to include in API responses */
4195
+ PaginationMeta: {
4196
+ /** @description Whether there are more results available */
4197
+ has_more: boolean;
4198
+ /** @description Pagination key for the next page (if has_more is true) */
4199
+ pagination_key?: string | null;
4200
+ };
4201
+ /** @description A single PnL candle entry */
4202
+ PnlCandleEntry: {
4203
+ /**
4204
+ * Format: int64
4205
+ * @description Timestamp in epoch seconds (start of bucket window)
4206
+ */
4207
+ t: number;
4208
+ /**
4209
+ * Format: double
4210
+ * @description Realized PnL in this bucket (USD)
4211
+ */
4212
+ pnl: number;
4213
+ };
4214
+ /** @enum {string} */
4215
+ PnlCandleResolution: "1m" | "1h" | "4h" | "1d" | "auto";
4216
+ /** @enum {string} */
4217
+ 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";
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"];
4347
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";
4348
4244
  /** @description Trader's global PnL summary (single trader) */
4349
4245
  TraderPnlSummary: {
4350
4246
  trader?: string | null;
@@ -4394,33 +4290,6 @@ export interface components {
4394
4290
  /** Format: int64 */
4395
4291
  last_trade_at?: number | null;
4396
4292
  };
4397
- /**
4398
- * @description Per-metric percentage change over a lookback window for one trader
4399
- * address. A `null` field means the window predates the trader's first
4400
- * activity or the prior value was zero (percentage undefined).
4401
- */
4402
- TraderMetricPctChange: {
4403
- /** Format: double */
4404
- volume_usd?: number | null;
4405
- /** Format: double */
4406
- buy_volume_usd?: number | null;
4407
- /** Format: double */
4408
- sell_volume_usd?: number | null;
4409
- /** Format: double */
4410
- merge_volume_usd?: number | null;
4411
- /** Format: double */
4412
- split_volume_usd?: number | null;
4413
- /** Format: double */
4414
- txn_count?: number | null;
4415
- /** Format: double */
4416
- fees_usd?: number | null;
4417
- /** Format: double */
4418
- shares_volume?: number | null;
4419
- /** Format: double */
4420
- yes_volume_usd?: number | null;
4421
- /** Format: double */
4422
- no_volume_usd?: number | null;
4423
- };
4424
4293
  TraderVolumeDataPoint: {
4425
4294
  /** Format: int64 */
4426
4295
  t: number;
@@ -4500,6 +4369,11 @@ export interface components {
4500
4369
  /** Format: int64 */
4501
4370
  bd_50p: number;
4502
4371
  };
4372
+ /**
4373
+ * @description Polymarket UI category.
4374
+ * @enum {string}
4375
+ */
4376
+ PolymarketCategory: "Politics" | "Sports" | "Crypto" | "Finance" | "Culture" | "Mentions" | "Weather" | "Economics" | "Tech";
4503
4377
  /** @description A Polymarket event from the Gamma API */
4504
4378
  PolymarketEvent: {
4505
4379
  /** @default */
@@ -4640,25 +4514,31 @@ export interface components {
4640
4514
  slug: string | null;
4641
4515
  /** Format: double */
4642
4516
  volume_usd?: number;
4517
+ /** Format: double */
4518
+ shares_volume?: number;
4519
+ /** Format: double */
4520
+ builder_usd_volume?: number;
4521
+ /** Format: double */
4522
+ builder_shares_volume?: number;
4643
4523
  /** Format: int64 */
4644
4524
  txn_count?: number;
4525
+ /** Format: int64 */
4526
+ builder_txn_count?: number;
4645
4527
  /**
4646
4528
  * Format: int64
4647
4529
  * @description Distinct active traders in the window.
4648
4530
  */
4649
4531
  unique_traders?: number;
4650
- /**
4651
- * Format: int64
4652
- * @description Distinct active makers in the window.
4653
- */
4532
+ /** Format: int64 */
4654
4533
  unique_makers?: number;
4655
- /**
4656
- * Format: int64
4657
- * @description Distinct active takers in the window.
4658
- */
4534
+ /** Format: int64 */
4659
4535
  unique_takers?: number;
4536
+ /** Format: int64 */
4537
+ unique_builder_traders?: number;
4660
4538
  /** Format: double */
4661
4539
  fees_usd?: number;
4540
+ /** Format: double */
4541
+ builder_fees_usd?: number;
4662
4542
  };
4663
4543
  /** @description Polymarket user profile (public API format) */
4664
4544
  PolymarketUserProfile: {
@@ -4690,6 +4570,8 @@ export interface components {
4690
4570
  };
4691
4571
  /** @description Per-position detail for Split/Merge/Redemption trades. */
4692
4572
  PositionDetail: {
4573
+ /** @description Market condition ID for this ERC1155 position. */
4574
+ condition_id?: string | null;
4693
4575
  /** @description ERC1155 position ID */
4694
4576
  position_id: string;
4695
4577
  /**
@@ -4701,6 +4583,13 @@ export interface components {
4701
4583
  outcome?: string | null;
4702
4584
  /** @description Amount of shares created/burned/redeemed for this position */
4703
4585
  amount: string;
4586
+ /**
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.
4591
+ */
4592
+ collateral_amount?: string;
4704
4593
  };
4705
4594
  /** @description Response for position (position_id) holders endpoint */
4706
4595
  PositionHoldersResponse: {
@@ -4776,6 +4665,10 @@ export interface components {
4776
4665
  /** Format: int32 */
4777
4666
  unique_traders: number;
4778
4667
  /** Format: int32 */
4668
+ unique_makers: number;
4669
+ /** Format: int32 */
4670
+ unique_takers: number;
4671
+ /** Format: int32 */
4779
4672
  unique_builder_traders: number;
4780
4673
  /** Format: double */
4781
4674
  price_open: number;
@@ -4853,6 +4746,7 @@ export interface components {
4853
4746
  fee?: number | null;
4854
4747
  /** Format: double */
4855
4748
  fee_pct?: number | null;
4749
+ position_details?: components["schemas"]["PositionDetail"][];
4856
4750
  exchange: components["schemas"]["PolymarketExchange"];
4857
4751
  };
4858
4752
  /**
@@ -4860,16 +4754,32 @@ export interface components {
4860
4754
  * @enum {string}
4861
4755
  */
4862
4756
  TopTradersSortBy: "volume" | "txns" | "fees" | "builder_fees";
4863
- TopTraderRow: {
4864
- trader: string;
4757
+ /**
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).
4761
+ */
4762
+ TraderMetricPctChange: {
4865
4763
  /** Format: double */
4866
- volume_usd: number;
4867
- /** Format: int64 */
4868
- txn_count: number;
4764
+ volume_usd?: number | null;
4869
4765
  /** Format: double */
4870
- fees_usd: number;
4766
+ buy_volume_usd?: number | null;
4871
4767
  /** Format: double */
4872
- builder_fees: number;
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;
4873
4783
  };
4874
4784
  PredictionCandlestickBar: {
4875
4785
  /** Format: double */
@@ -5147,17 +5057,10 @@ export interface components {
5147
5057
  position_details?: components["schemas"]["PositionDetail"][];
5148
5058
  exchange: components["schemas"]["PolymarketExchange"];
5149
5059
  };
5150
- /**
5151
- * @description Timeframe for `?sort=...` — defines the window the metric is summed over
5152
- * (or `lifetime` for all-time cumulative).
5153
- * @enum {string}
5154
- */
5155
- TagSortTimeframe: "lifetime" | "1h" | "24h" | "7d" | "30d" | "1mo";
5156
- /** @description Token outcome (position) */
5157
- TokenOutcome: {
5158
- token_id: string;
5159
- outcome: string;
5160
- };
5060
+ /** @enum {string} */
5061
+ TradeSide: "0" | "1";
5062
+ /** @enum {string} */
5063
+ TradeType: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "22" | "23" | "24";
5161
5064
  /** @description Output payload for RegisterToken events (YES/NO token pair registered for a condition). */
5162
5065
  RegisterTokenTrade: {
5163
5066
  id: string;
@@ -5181,57 +5084,44 @@ export interface components {
5181
5084
  event_slug?: string | null;
5182
5085
  exchange: components["schemas"]["PolymarketExchange"];
5183
5086
  };
5184
- SimpleTimeframeMetrics: {
5185
- /**
5186
- * Format: double
5187
- * @default 0
5188
- */
5189
- volume: number;
5190
- /**
5191
- * Format: double
5192
- * @default 0
5193
- */
5194
- shares_volume: number;
5195
- /**
5196
- * Format: double
5197
- * @default 0
5198
- */
5199
- builder_usd_volume: number;
5200
- /**
5201
- * Format: double
5202
- * @default 0
5203
- */
5204
- builder_shares_volume: number;
5205
- /**
5206
- * Format: double
5207
- * @default 0
5208
- */
5209
- fees: number;
5210
- /**
5211
- * Format: double
5212
- * @default 0
5213
- */
5214
- builder_fees: number;
5215
- /**
5216
- * Format: int32
5217
- * @default 0
5218
- */
5219
- txns: number;
5220
- /**
5221
- * Format: int32
5222
- * @default 0
5223
- */
5224
- builder_txns: number;
5225
- /**
5226
- * Format: int32
5227
- * @default 0
5228
- */
5229
- unique_traders: number;
5230
- /**
5231
- * Format: int32
5232
- * @default 0
5233
- */
5234
- unique_builder_traders: number;
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;
5235
5125
  };
5236
5126
  /** @description V2 UMA OOv2: a price request was made (market initialization). */
5237
5127
  RequestPriceEvent: {
@@ -5286,14 +5176,14 @@ export interface components {
5286
5176
  /** Format: double */
5287
5177
  d30: number;
5288
5178
  };
5289
- /** @description Market-level PnL entry */
5290
- TraderMarketPnlEntry: {
5291
- condition_id?: string | null;
5292
- market_slug?: string | null;
5179
+ /** @description Event-level PnL entry */
5180
+ TraderEventPnlEntry: {
5293
5181
  event_slug?: string | null;
5294
5182
  question?: string | null;
5295
5183
  image_url?: string | null;
5296
5184
  /** Format: int64 */
5185
+ markets_traded?: number | null;
5186
+ /** Format: int64 */
5297
5187
  outcomes_traded?: number | null;
5298
5188
  /** Format: int64 */
5299
5189
  total_buys?: number | null;
@@ -5304,6 +5194,8 @@ export interface components {
5304
5194
  /** Format: int64 */
5305
5195
  total_merges?: number | null;
5306
5196
  /** Format: double */
5197
+ total_volume_usd?: number | null;
5198
+ /** Format: double */
5307
5199
  buy_usd?: number | null;
5308
5200
  /** Format: double */
5309
5201
  sell_usd?: number | null;
@@ -5314,7 +5206,9 @@ export interface components {
5314
5206
  /** Format: double */
5315
5207
  realized_pnl_usd?: number | null;
5316
5208
  /** Format: int64 */
5317
- winning_outcomes?: number | null;
5209
+ winning_markets?: number | null;
5210
+ /** Format: int64 */
5211
+ losing_markets?: number | null;
5318
5212
  /** Format: double */
5319
5213
  total_fees?: number | null;
5320
5214
  /** Format: int64 */
@@ -5324,8 +5218,90 @@ export interface components {
5324
5218
  /** Format: double */
5325
5219
  realized_pnl_pct?: number | null;
5326
5220
  };
5327
- /** @enum {string} */
5328
- TagChangeTimeframe: "1h" | "24h" | "7d" | "30d" | "1mo";
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
+ };
5329
5305
  SearchResponse: {
5330
5306
  events?: components["schemas"]["PolymarketEvent"][] | null;
5331
5307
  events_pagination?: null | components["schemas"]["PaginationMeta"];
@@ -5341,6 +5317,135 @@ export interface components {
5341
5317
  * @enum {string}
5342
5318
  */
5343
5319
  SearchSortBy: "volume" | "txns" | "unique_traders" | "relevance" | "title" | "creation_date" | "start_date" | "end_date" | "liquidity" | "holders" | "end_time" | "start_time" | "created_time";
5320
+ /** @description V2 UMA OOv2: a price request was settled (final resolution). */
5321
+ SettleEvent: {
5322
+ id: string;
5323
+ hash: string;
5324
+ /** Format: int64 */
5325
+ block?: number | null;
5326
+ /** Format: int64 */
5327
+ confirmed_at?: number | null;
5328
+ /** Format: int64 */
5329
+ received_at?: number | null;
5330
+ /** Format: int64 */
5331
+ log_index?: number | null;
5332
+ /** Format: int64 */
5333
+ block_index?: number | null;
5334
+ oracle_contract: string;
5335
+ requester: string;
5336
+ proposer: string;
5337
+ disputer: string;
5338
+ identifier: string;
5339
+ timestamp: string;
5340
+ ancillary_data: string;
5341
+ /** Format: int64 */
5342
+ proposed_price: number;
5343
+ payout: string;
5344
+ disputed: boolean;
5345
+ condition_id?: string | null;
5346
+ proposed_outcome?: string | null;
5347
+ question?: string | null;
5348
+ image_url?: string | null;
5349
+ slug?: string | null;
5350
+ event_slug?: string | null;
5351
+ };
5352
+ /**
5353
+ * @description Direction filter for spike webhooks.
5354
+ * @enum {string}
5355
+ */
5356
+ SpikeDirection: "up" | "down" | "both";
5357
+ SimpleTimeframeMetrics: {
5358
+ /**
5359
+ * Format: double
5360
+ * @default 0
5361
+ */
5362
+ volume: number;
5363
+ /**
5364
+ * Format: double
5365
+ * @default 0
5366
+ */
5367
+ shares_volume: number;
5368
+ /**
5369
+ * Format: double
5370
+ * @default 0
5371
+ */
5372
+ builder_usd_volume: number;
5373
+ /**
5374
+ * Format: double
5375
+ * @default 0
5376
+ */
5377
+ builder_shares_volume: number;
5378
+ /**
5379
+ * Format: double
5380
+ * @default 0
5381
+ */
5382
+ fees: number;
5383
+ /**
5384
+ * Format: double
5385
+ * @default 0
5386
+ */
5387
+ builder_fees: number;
5388
+ /**
5389
+ * Format: int32
5390
+ * @default 0
5391
+ */
5392
+ txns: number;
5393
+ /**
5394
+ * Format: int32
5395
+ * @default 0
5396
+ */
5397
+ builder_txns: number;
5398
+ /**
5399
+ * Format: int32
5400
+ * @default 0
5401
+ */
5402
+ unique_traders: number;
5403
+ /**
5404
+ * Format: int32
5405
+ * @default 0
5406
+ */
5407
+ unique_makers: number;
5408
+ /**
5409
+ * Format: int32
5410
+ * @default 0
5411
+ */
5412
+ unique_takers: number;
5413
+ /**
5414
+ * Format: int32
5415
+ * @default 0
5416
+ */
5417
+ unique_builder_traders: number;
5418
+ };
5419
+ TopTraderPositionEntry: {
5420
+ trader: components["schemas"]["TraderInfo"];
5421
+ /** Format: double */
5422
+ realized_pnl_usd?: number | null;
5423
+ /** Format: double */
5424
+ realized_pnl_pct?: number | null;
5425
+ /** Format: double */
5426
+ shares?: number | null;
5427
+ /** Format: double */
5428
+ buy_usd?: number | null;
5429
+ /** Format: double */
5430
+ sell_usd?: number | null;
5431
+ /** Format: double */
5432
+ redemption_usd?: number | null;
5433
+ /** Format: double */
5434
+ total_fees?: number | null;
5435
+ /** Format: double */
5436
+ avg_entry_price?: number | null;
5437
+ /** Format: double */
5438
+ avg_exit_price?: number | null;
5439
+ /** Format: int64 */
5440
+ total_buys?: number | null;
5441
+ /** Format: int64 */
5442
+ total_sells?: number | null;
5443
+ won?: boolean | null;
5444
+ /** Format: int64 */
5445
+ first_trade_at?: number | null;
5446
+ /** Format: int64 */
5447
+ last_trade_at?: number | null;
5448
+ };
5344
5449
  };
5345
5450
  responses: never;
5346
5451
  parameters: never;
@@ -5511,6 +5616,39 @@ export interface operations {
5511
5616
  };
5512
5617
  };
5513
5618
  };
5619
+ get_asset_candlestick: {
5620
+ parameters: {
5621
+ query: {
5622
+ /** @description Asset ticker: BTC, ETH, XRP, SOL, DOGE, BNB, HYPE */
5623
+ asset_symbol: components["schemas"]["AssetSymbol"];
5624
+ /** @description Candle interval (TradingView naming): 1S (1 second), 1, 5, 15, 30, 60, 240, D, 1D */
5625
+ resolution: components["schemas"]["AssetCandlestickResolution"];
5626
+ /** @description Number of candles (max: 2500) */
5627
+ count_back?: number;
5628
+ /** @description Start timestamp (Unix seconds) */
5629
+ from?: number;
5630
+ /** @description End timestamp (Unix seconds) */
5631
+ to?: number;
5632
+ /** @description Cursor-based pagination key from previous response */
5633
+ pagination_key?: string;
5634
+ };
5635
+ header?: never;
5636
+ path?: never;
5637
+ cookie?: never;
5638
+ };
5639
+ requestBody?: never;
5640
+ responses: {
5641
+ /** @description OHLC candlestick data */
5642
+ 200: {
5643
+ headers: {
5644
+ [name: string]: unknown;
5645
+ };
5646
+ content: {
5647
+ "application/json": components["schemas"]["AssetCandlestickBar"][];
5648
+ };
5649
+ };
5650
+ };
5651
+ };
5514
5652
  list_builders: {
5515
5653
  parameters: {
5516
5654
  query?: {
@@ -5808,13 +5946,13 @@ export interface operations {
5808
5946
  };
5809
5947
  requestBody?: never;
5810
5948
  responses: {
5811
- /** @description Per-builder breakdown */
5949
+ /** @description Per-builder breakdown, each with embedded display metadata. */
5812
5950
  200: {
5813
5951
  headers: {
5814
5952
  [name: string]: unknown;
5815
5953
  };
5816
5954
  content: {
5817
- "application/json": components["schemas"]["TagBuilderRow"][];
5955
+ "application/json": components["schemas"]["TagBuilderRowWithMetadata"][];
5818
5956
  };
5819
5957
  };
5820
5958
  };