@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.
@@ -157,6 +157,77 @@ export interface components {
157
157
  * @enum {string}
158
158
  */
159
159
  AssetWindowFilterTimeframe: "5m" | "15m" | "1h" | "4h" | "1d" | "24h";
160
+ /** @description Category PnL webhook payload. */
161
+ CategoryPnlPayload: {
162
+ trader?: string | null;
163
+ category?: string | null;
164
+ /** @description Aggregation timeframe: "1d", "7d", "30d", or "lifetime" */
165
+ timeframe: string;
166
+ /** Format: double */
167
+ realized_pnl_usd?: number | null;
168
+ /** Format: int64 */
169
+ markets_in_category?: number | null;
170
+ /** Format: int64 */
171
+ markets_traded?: number | null;
172
+ /** Format: int64 */
173
+ outcomes_traded?: number | null;
174
+ /** Format: int64 */
175
+ total_buys?: number | null;
176
+ /** Format: int64 */
177
+ total_sells?: number | null;
178
+ /** Format: int64 */
179
+ total_redemptions?: number | null;
180
+ /** Format: int64 */
181
+ total_merges?: number | null;
182
+ /** Format: int64 */
183
+ total_splits?: number | null;
184
+ /** Format: double */
185
+ total_volume_usd?: number | null;
186
+ /** Format: double */
187
+ buy_usd?: number | null;
188
+ /** Format: double */
189
+ sell_usd?: number | null;
190
+ /** Format: double */
191
+ redemption_usd?: number | null;
192
+ /** Format: double */
193
+ merge_usd?: number | null;
194
+ /** Format: double */
195
+ convert_collateral_usd?: number | null;
196
+ /** Format: double */
197
+ split_volume_usd?: number | null;
198
+ /** Format: double */
199
+ total_fees?: number | null;
200
+ /** Format: double */
201
+ total_shares_bought?: number | null;
202
+ /** Format: int64 */
203
+ markets_won?: number | null;
204
+ /** Format: int64 */
205
+ markets_lost?: number | null;
206
+ /** Format: double */
207
+ market_win_rate_pct?: number | null;
208
+ /** Format: double */
209
+ avg_hold_time_seconds?: number | null;
210
+ /** Format: double */
211
+ best_trade_pnl_usd?: number | null;
212
+ best_trade_condition_id?: string | null;
213
+ /** Format: double */
214
+ worst_trade_pnl_usd?: number | null;
215
+ worst_trade_condition_id?: string | null;
216
+ /** Format: double */
217
+ total_wins_usd?: number | null;
218
+ /** Format: double */
219
+ total_losses_usd?: number | null;
220
+ /** Format: double */
221
+ avg_win_usd?: number | null;
222
+ /** Format: double */
223
+ avg_loss_usd?: number | null;
224
+ /** Format: double */
225
+ profit_factor?: number | null;
226
+ /** Format: int64 */
227
+ first_trade_at?: number | null;
228
+ /** Format: int64 */
229
+ last_trade_at?: number | null;
230
+ };
160
231
  /**
161
232
  * @description Subscription filters for the `close_to_bond` event. At least one of
162
233
  * `min_probability` or `max_probability` is required (enforced at runtime).
@@ -257,6 +328,18 @@ export interface components {
257
328
  */
258
329
  threshold: number;
259
330
  };
331
+ ConditionHolderMetricsFilters: {
332
+ condition_ids?: string[];
333
+ };
334
+ ConditionHolderMetricsPayload: {
335
+ /** Format: int32 */
336
+ ts: number;
337
+ /** Format: int64 */
338
+ block: number;
339
+ condition_id: string;
340
+ /** Format: int32 */
341
+ holder_count: number;
342
+ };
260
343
  /** @description Payload delivered when a market's volume or transaction metrics cross a configured threshold */
261
344
  ConditionMetricsPayload: {
262
345
  /** @description Market condition ID */
@@ -363,6 +446,25 @@ export interface components {
363
446
  DeleteWebhookResponse: {
364
447
  deleted: boolean;
365
448
  };
449
+ /**
450
+ * @description What triggered a position update. Each value is serialised as a
451
+ * lowercase string in the `dirty_kinds` array on every payload, and
452
+ * the same values are accepted as a subscribe-time filter on rooms
453
+ * that expose one.
454
+ *
455
+ * * `trade` — a buy, sell, merge, split, redemption, or NegRisk
456
+ * convert landed for the position
457
+ * * `price` — the outcome price moved (mark-to-market refresh)
458
+ * * `window` — a 1d / 7d / 30d rolling window boundary was crossed
459
+ * * `position_resolved` — the market that owns this position resolved
460
+ * on this update
461
+ * * `market_resolved` — the market itself resolved (stamped on
462
+ * `MarketRollup` rows for lifetime holders who never redeemed).
463
+ * Carried on the resolution tick stream and on any full-row update
464
+ * that bundles a resolution with a trade.
465
+ * @enum {string}
466
+ */
467
+ DirtyKind: "trade" | "price" | "window" | "position_resolved" | "market_resolved";
366
468
  /** @description V2 UMA OOv2: a proposed price was disputed. */
367
469
  DisputePriceEvent: {
368
470
  id: string;
@@ -393,6 +495,18 @@ export interface components {
393
495
  slug?: string | null;
394
496
  event_slug?: string | null;
395
497
  };
498
+ EventHolderMetricsFilters: {
499
+ event_slugs?: string[];
500
+ };
501
+ EventHolderMetricsPayload: {
502
+ /** Format: int32 */
503
+ ts: number;
504
+ /** Format: int64 */
505
+ block: number;
506
+ event_slug: string;
507
+ /** Format: int32 */
508
+ holder_count: number;
509
+ };
396
510
  /** @description Subscription filters for the `event_metrics` event. All fields are optional. */
397
511
  EventMetricsFilters: {
398
512
  /** @description Restrict to these events. Empty = all events. */
@@ -482,47 +596,6 @@ export interface components {
482
596
  */
483
597
  unique_builder_traders?: number | null;
484
598
  };
485
- /** @description Event PnL webhook payload. */
486
- EventPnlPayload: {
487
- trader?: string | null;
488
- event_slug?: string | null;
489
- /** @description Aggregation timeframe: "1d", "7d", "30d", or "lifetime" */
490
- timeframe: string;
491
- /** Format: int64 */
492
- markets_traded?: number | null;
493
- /** Format: int64 */
494
- outcomes_traded?: number | null;
495
- /** Format: int64 */
496
- total_buys?: number | null;
497
- /** Format: int64 */
498
- total_sells?: number | null;
499
- /** Format: int64 */
500
- total_redemptions?: number | null;
501
- /** Format: int64 */
502
- total_merges?: number | null;
503
- /** Format: double */
504
- total_volume_usd?: number | null;
505
- /** Format: double */
506
- buy_usd?: number | null;
507
- /** Format: double */
508
- sell_usd?: number | null;
509
- /** Format: double */
510
- redemption_usd?: number | null;
511
- /** Format: double */
512
- merge_usd?: number | null;
513
- /** Format: double */
514
- realized_pnl_usd?: number | null;
515
- /** Format: int64 */
516
- winning_markets?: number | null;
517
- /** Format: int64 */
518
- losing_markets?: number | null;
519
- /** Format: double */
520
- total_fees?: number | null;
521
- /** Format: int64 */
522
- first_trade_at?: number | null;
523
- /** Format: int64 */
524
- last_trade_at?: number | null;
525
- };
526
599
  /** @description Subscription filters for the `event_volume_milestone` event. */
527
600
  EventVolumeMilestoneFilters: {
528
601
  /** @description **Required.** Aggregation windows to monitor. */
@@ -615,6 +688,35 @@ export interface components {
615
688
  */
616
689
  fees: number;
617
690
  };
691
+ /** @description Exit Markers webhook payload — one position open->closed transition. */
692
+ ExitMarkersPayload: {
693
+ trader: string;
694
+ position_id: string;
695
+ condition_id: string;
696
+ event_slug: string;
697
+ market_slug: string;
698
+ title: string;
699
+ question: string;
700
+ image_url: string;
701
+ outcome: string;
702
+ /** Format: int32 */
703
+ outcome_index?: number | null;
704
+ /** Format: double */
705
+ pnl_usd: number;
706
+ /** Format: double */
707
+ pnl_pct: number;
708
+ /** Format: double */
709
+ cost_basis_usd: number;
710
+ /** @description resolved_win | resolved_loss | sold_win | sold_loss */
711
+ reason: string;
712
+ /** Format: int64 */
713
+ block: number;
714
+ /**
715
+ * Format: int32
716
+ * @description Exit time, unix seconds.
717
+ */
718
+ ts: number;
719
+ };
618
720
  /** @description Payload delivered when a tracked trader executes their first-ever trade on Polymarket */
619
721
  FirstTradePayload: {
620
722
  /** @description Limit-order maker wallet address (lowercase) */
@@ -686,7 +788,10 @@ export interface components {
686
788
  trader?: string | null;
687
789
  /** @description Aggregation timeframe: "1d", "7d", "30d", or "lifetime" */
688
790
  timeframe: string;
689
- /** Format: double */
791
+ /**
792
+ * Format: double
793
+ * @description Realized PnL for the timeframe (matches REST `/pnl/global`).
794
+ */
690
795
  realized_pnl_usd?: number | null;
691
796
  /** Format: int64 */
692
797
  events_traded?: number | null;
@@ -700,6 +805,8 @@ export interface components {
700
805
  total_redemptions?: number | null;
701
806
  /** Format: int64 */
702
807
  total_merges?: number | null;
808
+ /** Format: int64 */
809
+ total_splits?: number | null;
703
810
  /** Format: double */
704
811
  total_volume_usd?: number | null;
705
812
  /** Format: double */
@@ -710,6 +817,26 @@ export interface components {
710
817
  redemption_volume_usd?: number | null;
711
818
  /** Format: double */
712
819
  merge_volume_usd?: number | null;
820
+ /** Format: double */
821
+ convert_collateral_usd?: number | null;
822
+ /** Format: double */
823
+ split_volume_usd?: number | null;
824
+ /** Format: int64 */
825
+ maker_rebate_count?: number | null;
826
+ /** Format: double */
827
+ maker_rebate_usd?: number | null;
828
+ /** Format: int64 */
829
+ reward_count?: number | null;
830
+ /** Format: double */
831
+ reward_usd?: number | null;
832
+ /** Format: int64 */
833
+ yield_count?: number | null;
834
+ /** Format: double */
835
+ yield_usd?: number | null;
836
+ /** Format: int64 */
837
+ total_credit_count?: number | null;
838
+ /** Format: double */
839
+ total_credit_usd?: number | null;
713
840
  /** Format: int64 */
714
841
  markets_won?: number | null;
715
842
  /** Format: int64 */
@@ -717,9 +844,15 @@ export interface components {
717
844
  /** Format: double */
718
845
  market_win_rate_pct?: number | null;
719
846
  /** Format: double */
720
- avg_pnl_per_market?: number | null;
847
+ total_wins_usd?: number | null;
848
+ /** Format: double */
849
+ total_losses_usd?: number | null;
850
+ /** Format: double */
851
+ avg_win_usd?: number | null;
721
852
  /** Format: double */
722
- avg_pnl_per_trade?: number | null;
853
+ avg_loss_usd?: number | null;
854
+ /** Format: double */
855
+ profit_factor?: number | null;
723
856
  /** Format: double */
724
857
  avg_hold_time_seconds?: number | null;
725
858
  /** Format: double */
@@ -727,6 +860,9 @@ export interface components {
727
860
  /** Format: double */
728
861
  best_trade_pnl_usd?: number | null;
729
862
  best_trade_condition_id?: string | null;
863
+ /** Format: double */
864
+ worst_trade_pnl_usd?: number | null;
865
+ worst_trade_condition_id?: string | null;
730
866
  /** Format: int64 */
731
867
  first_trade_at?: number | null;
732
868
  /** Format: int64 */
@@ -825,8 +961,13 @@ export interface components {
825
961
  trader?: string | null;
826
962
  condition_id?: string | null;
827
963
  event_slug?: string | null;
964
+ category?: string | null;
828
965
  /** @description Aggregation timeframe: "1d", "7d", "30d", or "lifetime" */
829
966
  timeframe: string;
967
+ /** Format: double */
968
+ realized_pnl_usd?: number | null;
969
+ /** Format: double */
970
+ current_shares_balance?: number | null;
830
971
  /** Format: int64 */
831
972
  outcomes_traded?: number | null;
832
973
  /** Format: int64 */
@@ -837,6 +978,8 @@ export interface components {
837
978
  total_redemptions?: number | null;
838
979
  /** Format: int64 */
839
980
  total_merges?: number | null;
981
+ /** Format: int64 */
982
+ total_splits?: number | null;
840
983
  /** Format: double */
841
984
  buy_usd?: number | null;
842
985
  /** Format: double */
@@ -846,11 +989,13 @@ export interface components {
846
989
  /** Format: double */
847
990
  merge_usd?: number | null;
848
991
  /** Format: double */
849
- realized_pnl_usd?: number | null;
850
- /** Format: int64 */
851
- winning_outcomes?: number | null;
992
+ convert_collateral_usd?: number | null;
993
+ /** Format: double */
994
+ split_volume_usd?: number | null;
852
995
  /** Format: double */
853
996
  total_fees?: number | null;
997
+ /** Format: double */
998
+ total_shares_bought?: number | null;
854
999
  /** Format: int64 */
855
1000
  first_trade_at?: number | null;
856
1001
  /** Format: int64 */
@@ -1187,7 +1332,7 @@ export interface components {
1187
1332
  */
1188
1333
  PnlFilterTimeframe: "1d" | "7d" | "30d" | "lifetime";
1189
1334
  /**
1190
- * @description PnL timeframe enum for webhook filtering
1335
+ * @description PnL timeframe enum for webhook filtering.
1191
1336
  * @enum {string}
1192
1337
  */
1193
1338
  PnlTimeframeFilter: "1d" | "7d" | "30d" | "lifetime";
@@ -1195,7 +1340,7 @@ export interface components {
1195
1340
  * @description Polymarket webhook event types
1196
1341
  * @enum {string}
1197
1342
  */
1198
- PolymarketWebhookEvent: "trader_first_trade" | "trader_new_market" | "trader_whale_trade" | "trader_new_trade" | "trader_trade_event" | "trader_global_pnl" | "trader_market_pnl" | "trader_event_pnl" | "trader_global_pnl_v3" | "trader_market_pnl_v3" | "trader_event_pnl_v3" | "trader_category_pnl_v3" | "trader_position_resolved_v3" | "trader_exit_markers_v3" | "position_holder_metrics_v3" | "condition_holder_metrics_v3" | "event_holder_metrics_v3" | "condition_metrics" | "event_metrics" | "tag_metrics" | "position_metrics" | "market_volume_milestone" | "event_volume_milestone" | "position_volume_milestone" | "probability_spike" | "market_volume_spike" | "event_volume_spike" | "position_volume_spike" | "close_to_bond" | "market_created" | "asset_price_tick" | "asset_price_window_update" | "price_spike" | "oracle_events";
1343
+ PolymarketWebhookEvent: "trader_first_trade" | "trader_new_market" | "trader_whale_trade" | "trader_new_trade" | "trader_trade_event" | "trader_global_pnl" | "trader_market_pnl" | "trader_category_pnl" | "trader_position_resolved" | "trader_exit_markers" | "position_holder_metrics" | "condition_holder_metrics" | "event_holder_metrics" | "condition_metrics" | "event_metrics" | "tag_metrics" | "position_metrics" | "market_volume_milestone" | "event_volume_milestone" | "position_volume_milestone" | "probability_spike" | "market_volume_spike" | "event_volume_spike" | "position_volume_spike" | "close_to_bond" | "market_created" | "asset_price_tick" | "asset_price_window_update" | "price_spike" | "oracle_events";
1199
1344
  /**
1200
1345
  * @description Polymarket-specific webhook filters
1201
1346
  *
@@ -1384,6 +1529,26 @@ export interface components {
1384
1529
  */
1385
1530
  oracle_event_types?: string[];
1386
1531
  };
1532
+ PositionHolderMetricsFilters: {
1533
+ position_ids?: string[];
1534
+ };
1535
+ PositionHolderMetricsPayload: {
1536
+ /** Format: int32 */
1537
+ ts: number;
1538
+ /** Format: int64 */
1539
+ block: number;
1540
+ position_id: string;
1541
+ /** Format: int32 */
1542
+ holder_count: number;
1543
+ /** Format: double */
1544
+ total_balance: number;
1545
+ /** Format: double */
1546
+ total_cost_basis: number;
1547
+ /** Format: int32 */
1548
+ condition_holder_count?: number | null;
1549
+ /** Format: int32 */
1550
+ event_holder_count?: number | null;
1551
+ };
1387
1552
  /** @description Subscription filters for the `position_metrics` event. All fields are optional. */
1388
1553
  PositionMetricsFilters: {
1389
1554
  /** @description Restrict to these outcome token IDs. */
@@ -1548,6 +1713,141 @@ export interface components {
1548
1713
  /** Format: double */
1549
1714
  avg_sell_shares?: number | null;
1550
1715
  };
1716
+ PositionResolvedPayload: {
1717
+ trader?: string;
1718
+ position_id?: string;
1719
+ condition_id?: string | null;
1720
+ event_slug?: string | null;
1721
+ /**
1722
+ * @description Market category slug (e.g. "politics", "sports") — mirror of
1723
+ * `PositionRollup.category_id` resolved against the rollup
1724
+ * interner. Surfaces on the `/trader/{addr}/positions` API and
1725
+ * enables direct category-filtered + sorted position lookups
1726
+ * without a cross-grain join.
1727
+ */
1728
+ category?: string | null;
1729
+ outcome?: string | null;
1730
+ /** Format: int32 */
1731
+ outcome_index?: number | null;
1732
+ /** Format: int64 */
1733
+ total_buys?: number;
1734
+ /** Format: int64 */
1735
+ total_sells?: number;
1736
+ /** Format: int64 */
1737
+ total_merges?: number;
1738
+ /** Format: int64 */
1739
+ total_splits?: number;
1740
+ /** Format: int32 */
1741
+ winning_outcome_index?: number | null;
1742
+ /** Format: double */
1743
+ total_shares_bought?: number;
1744
+ /** Format: double */
1745
+ total_shares_sold?: number;
1746
+ /** Format: double */
1747
+ buy_usd?: number;
1748
+ /** Format: double */
1749
+ sell_usd?: number;
1750
+ /** Format: double */
1751
+ avg_entry_price?: number;
1752
+ /** Format: double */
1753
+ total_fees?: number;
1754
+ /** Format: double */
1755
+ realized_pnl_usd?: number;
1756
+ /** Format: double */
1757
+ total_pnl_usd?: number;
1758
+ /** Format: double */
1759
+ redemption_usd?: number;
1760
+ open?: boolean;
1761
+ won?: boolean | null;
1762
+ /** Format: int64 */
1763
+ first_trade_at?: number | null;
1764
+ /** Format: int64 */
1765
+ last_trade_at?: number | null;
1766
+ /**
1767
+ * @description What kind of activity triggered this update. One or more of
1768
+ * `"trade"`, `"price"`, `"window"`, `"position_resolved"`.
1769
+ * Subscribers that only care about one kind filter on
1770
+ * `data.dirty_kinds` containing the value.
1771
+ */
1772
+ dirty_kinds?: components["schemas"]["DirtyKind"][];
1773
+ /**
1774
+ * Format: double
1775
+ * @description `realized_pnl_usd / (buy_usd + total_fees) * 100` for the
1776
+ * window. `0.0` when the trader has no cost basis on this row yet.
1777
+ */
1778
+ realized_pnl_pct?: number;
1779
+ /** @description Market slug for the parent market of this outcome. */
1780
+ market_slug?: string | null;
1781
+ /** @description Market title. */
1782
+ title?: string | null;
1783
+ /** @description Market question. */
1784
+ question?: string | null;
1785
+ /** @description Market image URL. */
1786
+ image_url?: string | null;
1787
+ /**
1788
+ * Format: int32
1789
+ * @description NegRisk conversion count + share deltas for this position.
1790
+ */
1791
+ converted_count?: number;
1792
+ /** Format: double */
1793
+ converted_shares_gained?: number;
1794
+ /** Format: double */
1795
+ converted_shares_lost?: number;
1796
+ /**
1797
+ * Format: double
1798
+ * @description Aggregate buy/sell USD totals for this position across its
1799
+ * lifetime.
1800
+ */
1801
+ total_buy_usd?: number;
1802
+ /** Format: double */
1803
+ total_sell_usd?: number;
1804
+ /**
1805
+ * Format: double
1806
+ * @description Merge proceeds (Y+N → collateral).
1807
+ */
1808
+ merge_usd?: number;
1809
+ /**
1810
+ * Format: double
1811
+ * @description Sell-side average price.
1812
+ */
1813
+ avg_exit_price?: number | null;
1814
+ /**
1815
+ * Format: double
1816
+ * @description Volume-weighted average trade price across buys + sells.
1817
+ */
1818
+ avg_price?: number | null;
1819
+ /**
1820
+ * Format: double
1821
+ * @description Mark-to-market values from the latest price tick.
1822
+ */
1823
+ current_price?: number | null;
1824
+ /** Format: double */
1825
+ current_shares_balance?: number | null;
1826
+ /** Format: double */
1827
+ current_value?: number | null;
1828
+ /**
1829
+ * Format: double
1830
+ * @description Last on-chain trade price for the outcome token.
1831
+ */
1832
+ last_traded_price?: number | null;
1833
+ /**
1834
+ * Format: int64
1835
+ * @description Market resolution deadline as Unix seconds.
1836
+ */
1837
+ end_date?: number | null;
1838
+ /** @description NegRisk multi-outcome flag. */
1839
+ is_neg_risk?: boolean | null;
1840
+ /**
1841
+ * @description `true` when the market is resolved AND the trader still holds
1842
+ * shares (redeem available).
1843
+ */
1844
+ redeemable?: boolean | null;
1845
+ /**
1846
+ * @description `true` when the market is NegRisk, unresolved, and the trader
1847
+ * holds shares (NegRisk-adapter merge available).
1848
+ */
1849
+ mergeable?: boolean | null;
1850
+ };
1551
1851
  /** @description Subscription filters for the `position_volume_milestone` event. */
1552
1852
  PositionVolumeMilestoneFilters: {
1553
1853
  /** @description **Required.** Aggregation windows to monitor. */
@@ -2202,51 +2502,63 @@ export interface components {
2202
2502
  * @enum {string}
2203
2503
  */
2204
2504
  TradeEventFilterType: "OrderFilled" | "OrdersMatched" | "MakerRebate" | "Reward" | "Yield" | "Redemption" | "Merge" | "Split" | "Cancelled" | "PositionsConverted" | "Initialization" | "Proposal" | "Dispute" | "Settled" | "Resolution" | "ConditionResolution" | "Reset" | "Flag" | "Unflag" | "Pause" | "Unpause" | "ManualResolution" | "NegRiskOutcomeReported" | "RegisterToken";
2205
- /** @description Subscription filters for the `trader_event_pnl` event. All fields are optional. */
2206
- TraderEventPnlFilters: {
2207
- /** @description Track only these trader wallet addresses. */
2505
+ /** @description Subscription filters for the `trader_category_pnl` event. All fields are optional. */
2506
+ TraderCategoryPnlFilters: {
2507
+ /** @description Track only these trader wallet addresses. Empty = all traders. */
2208
2508
  traders?: string[] | null;
2209
- /** @description Restrict to these events. */
2210
- event_slugs?: string[] | null;
2509
+ /** @description Restrict to these market categories (e.g. `politics`, `sports`). */
2510
+ categories?: string[] | null;
2211
2511
  /**
2212
2512
  * Format: double
2213
- * @description Only fire when per-event realized PnL ≥ this value (USD).
2513
+ * @description Only fire when per-category realized PnL ≥ this value (USD). Use negative values for loss thresholds.
2214
2514
  */
2215
2515
  min_realized_pnl_usd?: number | null;
2216
2516
  /**
2217
2517
  * Format: double
2218
- * @description Only fire when per-event realized PnL ≤ this value (USD).
2518
+ * @description Only fire when per-category realized PnL ≤ this value (USD).
2219
2519
  */
2220
2520
  max_realized_pnl_usd?: number | null;
2221
2521
  /**
2222
2522
  * Format: double
2223
- * @description Only fire when total event volume ≥ this value (USD).
2523
+ * @description Only fire when total category volume ≥ this value (USD).
2224
2524
  */
2225
2525
  min_volume_usd?: number | null;
2226
2526
  /**
2227
2527
  * Format: double
2228
- * @description Only fire when total event volume ≤ this value (USD).
2528
+ * @description Only fire when total category volume ≤ this value (USD).
2229
2529
  */
2230
2530
  max_volume_usd?: number | null;
2231
2531
  /**
2232
2532
  * Format: double
2233
- * @description Only fire when buy volume within the event ≥ this value (USD).
2533
+ * @description Only fire when buy volume within the category ≥ this value (USD).
2234
2534
  */
2235
2535
  min_buy_usd?: number | null;
2236
2536
  /**
2237
2537
  * Format: double
2238
- * @description Only fire when sell volume within the event ≥ this value (USD).
2538
+ * @description Only fire when sell volume within the category ≥ this value (USD).
2239
2539
  */
2240
2540
  min_sell_volume_usd?: number | null;
2541
+ /**
2542
+ * Format: double
2543
+ * @description Only fire when market win rate ≥ this percentage (0.0–100.0).
2544
+ */
2545
+ min_win_rate?: number | null;
2241
2546
  /**
2242
2547
  * Format: int64
2243
- * @description Only fire when the trader has traded in ≥ this many markets within the event.
2548
+ * @description Only fire when the trader has traded in ≥ this many markets within the category.
2244
2549
  */
2245
2550
  min_markets_traded?: number | null;
2246
- /** @description Restrict to these PnL windows. */
2551
+ /** @description Restrict to these PnL windows. Empty = all windows. */
2247
2552
  timeframes?: components["schemas"]["PnlFilterTimeframe"][] | null;
2248
- /** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
2249
- exclude_shortterm_markets?: boolean | null;
2553
+ };
2554
+ /** @description Subscription filters for the `trader_pnl_exits` event. All fields are optional. */
2555
+ TraderExitMarkersFilters: {
2556
+ /** @description Track only these trader wallet addresses. Empty = all traders. */
2557
+ traders?: string[] | null;
2558
+ /** @description Restrict to these markets. */
2559
+ condition_ids?: string[] | null;
2560
+ /** @description Restrict to positions in these events. */
2561
+ event_slugs?: string[] | null;
2250
2562
  };
2251
2563
  /** @description Subscription filters for the `trader_first_trade` event. All fields are optional. */
2252
2564
  TraderFirstTradeFilters: {
@@ -2418,6 +2730,19 @@ export interface components {
2418
2730
  /** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
2419
2731
  exclude_shortterm_markets?: boolean | null;
2420
2732
  };
2733
+ /** @description Subscription filters for the `trader_position_resolved` event. All fields are optional. */
2734
+ TraderPositionResolvedFilters: {
2735
+ /** @description Track only these trader wallet addresses. Empty = all traders. */
2736
+ traders?: string[] | null;
2737
+ /** @description Restrict to these markets. */
2738
+ condition_ids?: string[] | null;
2739
+ /** @description Restrict to positions in these events. */
2740
+ event_slugs?: string[] | null;
2741
+ /** @description Restrict to these outcome indexes within the resolved market. */
2742
+ outcome_indexes?: number[] | null;
2743
+ /** @description Only fire for won (`true`) or lost (`false`) positions. Omit to receive both. */
2744
+ won_only?: boolean | null;
2745
+ };
2421
2746
  /**
2422
2747
  * @description Subscription filters for the `trader_trade_event` event. All fields are optional.
2423
2748
  * `event_slugs` and `exclude_shortterm_markets` require explicit `trade_types` that
@@ -3408,7 +3733,7 @@ export interface components {
3408
3733
  * @description All alert event types supported by both HTTP webhooks and the alerts WebSocket.
3409
3734
  * @enum {string}
3410
3735
  */
3411
- WsAlertEventType: "trader_first_trade" | "trader_new_market" | "trader_whale_trade" | "trader_new_trade" | "trader_trade_event" | "trader_global_pnl" | "trader_market_pnl" | "trader_event_pnl" | "condition_metrics" | "event_metrics" | "tag_metrics" | "position_metrics" | "market_volume_milestone" | "event_volume_milestone" | "position_volume_milestone" | "probability_spike" | "price_spike" | "market_volume_spike" | "event_volume_spike" | "position_volume_spike" | "close_to_bond" | "market_created" | "oracle_events" | "asset_price_tick" | "asset_price_window_update";
3736
+ WsAlertEventType: "trader_first_trade" | "trader_new_market" | "trader_whale_trade" | "trader_new_trade" | "trader_trade_event" | "trader_global_pnl" | "trader_market_pnl" | "trader_category_pnl" | "trader_position_resolved" | "trader_pnl_exits" | "position_holder_metrics" | "condition_holder_metrics" | "event_holder_metrics" | "condition_metrics" | "event_metrics" | "tag_metrics" | "position_metrics" | "market_volume_milestone" | "event_volume_milestone" | "position_volume_milestone" | "probability_spike" | "price_spike" | "market_volume_spike" | "event_volume_spike" | "position_volume_spike" | "close_to_bond" | "market_created" | "oracle_events" | "asset_price_tick" | "asset_price_window_update";
3412
3737
  /** @description Server acknowledgement for a successful alert subscription. */
3413
3738
  WsAlertSubscribedResponse: {
3414
3739
  /** @enum {string} */
@@ -3815,20 +4140,36 @@ export interface components {
3815
4140
  * "total_sells": 8,
3816
4141
  * "total_redemptions": 1,
3817
4142
  * "total_merges": 0,
4143
+ * "total_splits": 0,
3818
4144
  * "total_volume_usd": 1500,
3819
4145
  * "buy_volume_usd": 900,
3820
4146
  * "sell_volume_usd": 600,
3821
4147
  * "redemption_volume_usd": 50,
3822
4148
  * "merge_volume_usd": 0,
4149
+ * "convert_collateral_usd": 0,
4150
+ * "split_volume_usd": 0,
4151
+ * "maker_rebate_count": 0,
4152
+ * "maker_rebate_usd": 0,
4153
+ * "reward_count": 0,
4154
+ * "reward_usd": 0,
4155
+ * "yield_count": 0,
4156
+ * "yield_usd": 0,
4157
+ * "total_credit_count": 0,
4158
+ * "total_credit_usd": 0,
3823
4159
  * "markets_won": 3,
3824
4160
  * "markets_lost": 2,
3825
4161
  * "market_win_rate_pct": 60,
3826
- * "avg_pnl_per_market": 50,
3827
- * "avg_pnl_per_trade": 12.5,
4162
+ * "total_wins_usd": 400,
4163
+ * "total_losses_usd": 150,
4164
+ * "avg_win_usd": 133.3,
4165
+ * "avg_loss_usd": 75,
4166
+ * "profit_factor": 2.67,
3828
4167
  * "avg_hold_time_seconds": 86400,
3829
4168
  * "total_fees": 7.5,
3830
4169
  * "best_trade_pnl_usd": 180,
3831
4170
  * "best_trade_condition_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4171
+ * "worst_trade_pnl_usd": -50,
4172
+ * "worst_trade_condition_id": "0x0000000000000000000000000000000000000000000000000000000000000001",
3832
4173
  * "first_trade_at": 1700000000,
3833
4174
  * "last_trade_at": 1700000000
3834
4175
  * }
@@ -3880,19 +4221,24 @@ export interface components {
3880
4221
  * "trader": "0x0000000000000000000000000000000000000000",
3881
4222
  * "condition_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
3882
4223
  * "event_slug": "test-event-0000000000",
4224
+ * "category": "crypto",
3883
4225
  * "timeframe": "7d",
4226
+ * "realized_pnl_usd": 100,
4227
+ * "current_shares_balance": 150,
3884
4228
  * "outcomes_traded": 2,
3885
4229
  * "total_buys": 4,
3886
4230
  * "total_sells": 3,
3887
4231
  * "total_redemptions": 1,
3888
4232
  * "total_merges": 0,
4233
+ * "total_splits": 0,
3889
4234
  * "buy_usd": 300,
3890
4235
  * "sell_usd": 200,
3891
4236
  * "redemption_usd": 50,
3892
4237
  * "merge_usd": 0,
3893
- * "realized_pnl_usd": 100,
3894
- * "winning_outcomes": 1,
4238
+ * "convert_collateral_usd": 0,
4239
+ * "split_volume_usd": 0,
3895
4240
  * "total_fees": 2.5,
4241
+ * "total_shares_bought": 500,
3896
4242
  * "first_trade_at": 1700000000,
3897
4243
  * "last_trade_at": 1700000000
3898
4244
  * }
@@ -3911,71 +4257,384 @@ export interface components {
3911
4257
  timestamp: number;
3912
4258
  data: components["schemas"]["MarketPnlPayload"];
3913
4259
  };
3914
- WsAlertTraderEventPnlSubscribeMessage: {
4260
+ WsAlertTraderCategoryPnlSubscribeMessage: {
3915
4261
  /** @enum {string} */
3916
4262
  op: "subscribe";
3917
4263
  /** @enum {string} */
3918
- event: "trader_event_pnl";
3919
- } & components["schemas"]["TraderEventPnlFilters"] & {
4264
+ event: "trader_category_pnl";
4265
+ } & components["schemas"]["TraderCategoryPnlFilters"] & {
3920
4266
  /**
3921
4267
  * @description discriminator enum property added by openapi-typescript
3922
4268
  * @enum {string}
3923
4269
  */
3924
- event: "trader_event_pnl";
4270
+ event: "trader_category_pnl";
3925
4271
  };
3926
- WsAlertTraderEventPnlUnsubscribeMessage: {
4272
+ WsAlertTraderCategoryPnlUnsubscribeMessage: {
3927
4273
  /** @enum {string} */
3928
4274
  op: "unsubscribe";
3929
4275
  /** @enum {string} */
3930
- event: "trader_event_pnl";
3931
- } & components["schemas"]["TraderEventPnlFilters"] & {
4276
+ event: "trader_category_pnl";
4277
+ } & components["schemas"]["TraderCategoryPnlFilters"] & {
3932
4278
  /**
3933
4279
  * @description discriminator enum property added by openapi-typescript
3934
4280
  * @enum {string}
3935
4281
  */
3936
- event: "trader_event_pnl";
4282
+ event: "trader_category_pnl";
3937
4283
  };
3938
4284
  /**
3939
- * @description Pushed `trader_event_pnl` alert. The `data` payload matches the corresponding HTTP webhook payload schema.
4285
+ * @description Pushed `trader_category_pnl` alert. The `data` payload matches the corresponding HTTP webhook payload schema.
3940
4286
  * @example {
3941
- * "event": "trader_event_pnl",
4287
+ * "event": "trader_category_pnl",
3942
4288
  * "timestamp": 1743500000000,
3943
4289
  * "data": {
3944
4290
  * "trader": "0x0000000000000000000000000000000000000000",
3945
- * "event_slug": "test-event-0000000000",
4291
+ * "category": "crypto",
3946
4292
  * "timeframe": "7d",
3947
- * "markets_traded": 2,
3948
- * "outcomes_traded": 3,
3949
- * "total_buys": 6,
3950
- * "total_sells": 4,
4293
+ * "realized_pnl_usd": 250,
4294
+ * "markets_in_category": 15,
4295
+ * "markets_traded": 5,
4296
+ * "outcomes_traded": 8,
4297
+ * "total_buys": 12,
4298
+ * "total_sells": 8,
3951
4299
  * "total_redemptions": 1,
3952
4300
  * "total_merges": 0,
3953
- * "total_volume_usd": 800,
3954
- * "buy_usd": 480,
3955
- * "sell_usd": 320,
4301
+ * "total_splits": 0,
4302
+ * "total_volume_usd": 1500,
4303
+ * "buy_usd": 900,
4304
+ * "sell_usd": 600,
3956
4305
  * "redemption_usd": 50,
3957
4306
  * "merge_usd": 0,
3958
- * "realized_pnl_usd": 150,
3959
- * "winning_markets": 1,
3960
- * "losing_markets": 1,
3961
- * "total_fees": 4,
4307
+ * "convert_collateral_usd": 0,
4308
+ * "split_volume_usd": 0,
4309
+ * "total_fees": 7.5,
4310
+ * "total_shares_bought": 500,
4311
+ * "markets_won": 3,
4312
+ * "markets_lost": 2,
4313
+ * "market_win_rate_pct": 60,
4314
+ * "avg_hold_time_seconds": 86400,
4315
+ * "best_trade_pnl_usd": 180,
4316
+ * "best_trade_condition_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4317
+ * "worst_trade_pnl_usd": -50,
4318
+ * "worst_trade_condition_id": "0x0000000000000000000000000000000000000000000000000000000000000001",
4319
+ * "total_wins_usd": 400,
4320
+ * "total_losses_usd": 150,
4321
+ * "avg_win_usd": 133.3,
4322
+ * "avg_loss_usd": 75,
4323
+ * "profit_factor": 2.67,
3962
4324
  * "first_trade_at": 1700000000,
3963
4325
  * "last_trade_at": 1700000000
3964
4326
  * }
3965
4327
  * }
3966
4328
  */
3967
- WsAlertTraderEventPnlEvent: {
4329
+ WsAlertTraderCategoryPnlEvent: {
4330
+ /**
4331
+ * @description discriminator enum property added by openapi-typescript
4332
+ * @enum {string}
4333
+ */
4334
+ event: "trader_category_pnl";
4335
+ /**
4336
+ * Format: int64
4337
+ * @description Unix timestamp in milliseconds
4338
+ */
4339
+ timestamp: number;
4340
+ data: components["schemas"]["CategoryPnlPayload"];
4341
+ };
4342
+ WsAlertTraderPositionResolvedSubscribeMessage: {
4343
+ /** @enum {string} */
4344
+ op: "subscribe";
4345
+ /** @enum {string} */
4346
+ event: "trader_position_resolved";
4347
+ } & components["schemas"]["TraderPositionResolvedFilters"] & {
4348
+ /**
4349
+ * @description discriminator enum property added by openapi-typescript
4350
+ * @enum {string}
4351
+ */
4352
+ event: "trader_position_resolved";
4353
+ };
4354
+ WsAlertTraderPositionResolvedUnsubscribeMessage: {
4355
+ /** @enum {string} */
4356
+ op: "unsubscribe";
4357
+ /** @enum {string} */
4358
+ event: "trader_position_resolved";
4359
+ } & components["schemas"]["TraderPositionResolvedFilters"] & {
4360
+ /**
4361
+ * @description discriminator enum property added by openapi-typescript
4362
+ * @enum {string}
4363
+ */
4364
+ event: "trader_position_resolved";
4365
+ };
4366
+ /**
4367
+ * @description Pushed `trader_position_resolved` alert. The `data` payload matches the corresponding HTTP webhook payload schema.
4368
+ * @example {
4369
+ * "event": "trader_position_resolved",
4370
+ * "timestamp": 1743500000000,
4371
+ * "data": {
4372
+ * "trader": "0x0000000000000000000000000000000000000000",
4373
+ * "position_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4374
+ * "condition_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4375
+ * "event_slug": "test-event-0000000000",
4376
+ * "category": "politics",
4377
+ * "outcome": "Yes",
4378
+ * "outcome_index": 0,
4379
+ * "total_buys": 4,
4380
+ * "total_sells": 2,
4381
+ * "total_merges": 0,
4382
+ * "total_splits": 0,
4383
+ * "winning_outcome_index": 0,
4384
+ * "total_shares_bought": 500,
4385
+ * "total_shares_sold": 200,
4386
+ * "buy_usd": 300,
4387
+ * "sell_usd": 150,
4388
+ * "avg_entry_price": 0.6,
4389
+ * "total_fees": 2.5,
4390
+ * "realized_pnl_usd": 100,
4391
+ * "total_pnl_usd": 100,
4392
+ * "redemption_usd": 50,
4393
+ * "open": false,
4394
+ * "won": true,
4395
+ * "first_trade_at": 1700000000,
4396
+ * "last_trade_at": 1700000000,
4397
+ * "dirty_kinds": [
4398
+ * "position_resolved"
4399
+ * ],
4400
+ * "realized_pnl_pct": 0,
4401
+ * "converted_count": 0,
4402
+ * "converted_shares_gained": 0,
4403
+ * "converted_shares_lost": 0,
4404
+ * "total_buy_usd": 0,
4405
+ * "total_sell_usd": 0,
4406
+ * "merge_usd": 0
4407
+ * }
4408
+ * }
4409
+ */
4410
+ WsAlertTraderPositionResolvedEvent: {
4411
+ /**
4412
+ * @description discriminator enum property added by openapi-typescript
4413
+ * @enum {string}
4414
+ */
4415
+ event: "trader_position_resolved";
4416
+ /**
4417
+ * Format: int64
4418
+ * @description Unix timestamp in milliseconds
4419
+ */
4420
+ timestamp: number;
4421
+ data: components["schemas"]["PositionResolvedPayload"];
4422
+ };
4423
+ WsAlertTraderPnlExitsSubscribeMessage: {
4424
+ /** @enum {string} */
4425
+ op: "subscribe";
4426
+ /** @enum {string} */
4427
+ event: "trader_pnl_exits";
4428
+ } & components["schemas"]["TraderExitMarkersFilters"] & {
4429
+ /**
4430
+ * @description discriminator enum property added by openapi-typescript
4431
+ * @enum {string}
4432
+ */
4433
+ event: "trader_pnl_exits";
4434
+ };
4435
+ WsAlertTraderPnlExitsUnsubscribeMessage: {
4436
+ /** @enum {string} */
4437
+ op: "unsubscribe";
4438
+ /** @enum {string} */
4439
+ event: "trader_pnl_exits";
4440
+ } & components["schemas"]["TraderExitMarkersFilters"] & {
4441
+ /**
4442
+ * @description discriminator enum property added by openapi-typescript
4443
+ * @enum {string}
4444
+ */
4445
+ event: "trader_pnl_exits";
4446
+ };
4447
+ /**
4448
+ * @description Pushed `trader_pnl_exits` alert. The `data` payload matches the corresponding HTTP webhook payload schema.
4449
+ * @example {
4450
+ * "event": "trader_pnl_exits",
4451
+ * "timestamp": 1743500000000,
4452
+ * "data": {
4453
+ * "trader": "0x0000000000000000000000000000000000000000",
4454
+ * "position_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4455
+ * "condition_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4456
+ * "event_slug": "test-event-0000000000",
4457
+ * "market_slug": "test-market",
4458
+ * "title": "Test Market",
4459
+ * "question": "Will this test market resolve YES?",
4460
+ * "image_url": "",
4461
+ * "outcome": "Yes",
4462
+ * "outcome_index": 0,
4463
+ * "pnl_usd": 100,
4464
+ * "pnl_pct": 33.3,
4465
+ * "cost_basis_usd": 300,
4466
+ * "reason": "resolved_win",
4467
+ * "block": 1,
4468
+ * "ts": 1700000000
4469
+ * }
4470
+ * }
4471
+ */
4472
+ WsAlertTraderPnlExitsEvent: {
4473
+ /**
4474
+ * @description discriminator enum property added by openapi-typescript
4475
+ * @enum {string}
4476
+ */
4477
+ event: "trader_pnl_exits";
4478
+ /**
4479
+ * Format: int64
4480
+ * @description Unix timestamp in milliseconds
4481
+ */
4482
+ timestamp: number;
4483
+ data: components["schemas"]["ExitMarkersPayload"];
4484
+ };
4485
+ WsAlertPositionHolderMetricsSubscribeMessage: ({
4486
+ /** @enum {string} */
4487
+ op: "subscribe";
4488
+ /** @enum {string} */
4489
+ event: "position_holder_metrics";
4490
+ } & components["schemas"]["PositionHolderMetricsFilters"] & {
4491
+ /**
4492
+ * @description discriminator enum property added by openapi-typescript
4493
+ * @enum {string}
4494
+ */
4495
+ event: "position_holder_metrics";
4496
+ }) | unknown;
4497
+ WsAlertPositionHolderMetricsUnsubscribeMessage: ({
4498
+ /** @enum {string} */
4499
+ op: "unsubscribe";
4500
+ /** @enum {string} */
4501
+ event: "position_holder_metrics";
4502
+ } & components["schemas"]["PositionHolderMetricsFilters"] & {
4503
+ /**
4504
+ * @description discriminator enum property added by openapi-typescript
4505
+ * @enum {string}
4506
+ */
4507
+ event: "position_holder_metrics";
4508
+ }) | unknown;
4509
+ /**
4510
+ * @description Pushed `position_holder_metrics` alert. The `data` payload matches the corresponding HTTP webhook payload schema.
4511
+ * @example {
4512
+ * "event": "position_holder_metrics",
4513
+ * "timestamp": 1743500000000,
4514
+ * "data": {
4515
+ * "ts": 1700000000,
4516
+ * "block": 1,
4517
+ * "position_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4518
+ * "holder_count": 10,
4519
+ * "total_balance": 1000,
4520
+ * "total_cost_basis": 500,
4521
+ * "condition_holder_count": 15,
4522
+ * "event_holder_count": 25
4523
+ * }
4524
+ * }
4525
+ */
4526
+ WsAlertPositionHolderMetricsEvent: {
4527
+ /**
4528
+ * @description discriminator enum property added by openapi-typescript
4529
+ * @enum {string}
4530
+ */
4531
+ event: "position_holder_metrics";
4532
+ /**
4533
+ * Format: int64
4534
+ * @description Unix timestamp in milliseconds
4535
+ */
4536
+ timestamp: number;
4537
+ data: components["schemas"]["PositionHolderMetricsPayload"];
4538
+ };
4539
+ WsAlertConditionHolderMetricsSubscribeMessage: ({
4540
+ /** @enum {string} */
4541
+ op: "subscribe";
4542
+ /** @enum {string} */
4543
+ event: "condition_holder_metrics";
4544
+ } & components["schemas"]["ConditionHolderMetricsFilters"] & {
4545
+ /**
4546
+ * @description discriminator enum property added by openapi-typescript
4547
+ * @enum {string}
4548
+ */
4549
+ event: "condition_holder_metrics";
4550
+ }) | unknown;
4551
+ WsAlertConditionHolderMetricsUnsubscribeMessage: ({
4552
+ /** @enum {string} */
4553
+ op: "unsubscribe";
4554
+ /** @enum {string} */
4555
+ event: "condition_holder_metrics";
4556
+ } & components["schemas"]["ConditionHolderMetricsFilters"] & {
4557
+ /**
4558
+ * @description discriminator enum property added by openapi-typescript
4559
+ * @enum {string}
4560
+ */
4561
+ event: "condition_holder_metrics";
4562
+ }) | unknown;
4563
+ /**
4564
+ * @description Pushed `condition_holder_metrics` alert. The `data` payload matches the corresponding HTTP webhook payload schema.
4565
+ * @example {
4566
+ * "event": "condition_holder_metrics",
4567
+ * "timestamp": 1743500000000,
4568
+ * "data": {
4569
+ * "ts": 1700000000,
4570
+ * "block": 1,
4571
+ * "condition_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
4572
+ * "holder_count": 15
4573
+ * }
4574
+ * }
4575
+ */
4576
+ WsAlertConditionHolderMetricsEvent: {
4577
+ /**
4578
+ * @description discriminator enum property added by openapi-typescript
4579
+ * @enum {string}
4580
+ */
4581
+ event: "condition_holder_metrics";
4582
+ /**
4583
+ * Format: int64
4584
+ * @description Unix timestamp in milliseconds
4585
+ */
4586
+ timestamp: number;
4587
+ data: components["schemas"]["ConditionHolderMetricsPayload"];
4588
+ };
4589
+ WsAlertEventHolderMetricsSubscribeMessage: ({
4590
+ /** @enum {string} */
4591
+ op: "subscribe";
4592
+ /** @enum {string} */
4593
+ event: "event_holder_metrics";
4594
+ } & components["schemas"]["EventHolderMetricsFilters"] & {
4595
+ /**
4596
+ * @description discriminator enum property added by openapi-typescript
4597
+ * @enum {string}
4598
+ */
4599
+ event: "event_holder_metrics";
4600
+ }) | unknown;
4601
+ WsAlertEventHolderMetricsUnsubscribeMessage: ({
4602
+ /** @enum {string} */
4603
+ op: "unsubscribe";
4604
+ /** @enum {string} */
4605
+ event: "event_holder_metrics";
4606
+ } & components["schemas"]["EventHolderMetricsFilters"] & {
4607
+ /**
4608
+ * @description discriminator enum property added by openapi-typescript
4609
+ * @enum {string}
4610
+ */
4611
+ event: "event_holder_metrics";
4612
+ }) | unknown;
4613
+ /**
4614
+ * @description Pushed `event_holder_metrics` alert. The `data` payload matches the corresponding HTTP webhook payload schema.
4615
+ * @example {
4616
+ * "event": "event_holder_metrics",
4617
+ * "timestamp": 1743500000000,
4618
+ * "data": {
4619
+ * "ts": 1700000000,
4620
+ * "block": 1,
4621
+ * "event_slug": "test-event-0000000000",
4622
+ * "holder_count": 25
4623
+ * }
4624
+ * }
4625
+ */
4626
+ WsAlertEventHolderMetricsEvent: {
3968
4627
  /**
3969
4628
  * @description discriminator enum property added by openapi-typescript
3970
4629
  * @enum {string}
3971
4630
  */
3972
- event: "trader_event_pnl";
4631
+ event: "event_holder_metrics";
3973
4632
  /**
3974
4633
  * Format: int64
3975
4634
  * @description Unix timestamp in milliseconds
3976
4635
  */
3977
4636
  timestamp: number;
3978
- data: components["schemas"]["EventPnlPayload"];
4637
+ data: components["schemas"]["EventHolderMetricsPayload"];
3979
4638
  };
3980
4639
  WsAlertConditionMetricsSubscribeMessage: {
3981
4640
  /** @enum {string} */
@@ -4997,11 +5656,11 @@ export interface components {
4997
5656
  data: components["schemas"]["AssetPriceWindowUpdatePayload"];
4998
5657
  };
4999
5658
  /** @description Typed subscribe request for the alerts WebSocket. The request shape depends on `event`; filters follow the schema associated with that event type. */
5000
- WsAlertSubscribeMessage: components["schemas"]["WsAlertTraderFirstTradeSubscribeMessage"] | components["schemas"]["WsAlertTraderNewMarketSubscribeMessage"] | components["schemas"]["WsAlertTraderWhaleTradeSubscribeMessage"] | components["schemas"]["WsAlertTraderNewTradeSubscribeMessage"] | components["schemas"]["WsAlertTraderTradeEventSubscribeMessage"] | components["schemas"]["WsAlertTraderGlobalPnlSubscribeMessage"] | components["schemas"]["WsAlertTraderMarketPnlSubscribeMessage"] | components["schemas"]["WsAlertTraderEventPnlSubscribeMessage"] | components["schemas"]["WsAlertConditionMetricsSubscribeMessage"] | components["schemas"]["WsAlertEventMetricsSubscribeMessage"] | components["schemas"]["WsAlertTagMetricsSubscribeMessage"] | components["schemas"]["WsAlertPositionMetricsSubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeMilestoneSubscribeMessage"] | components["schemas"]["WsAlertEventVolumeMilestoneSubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeMilestoneSubscribeMessage"] | components["schemas"]["WsAlertProbabilitySpikeSubscribeMessage"] | components["schemas"]["WsAlertPriceSpikeSubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeSpikeSubscribeMessage"] | components["schemas"]["WsAlertEventVolumeSpikeSubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeSpikeSubscribeMessage"] | components["schemas"]["WsAlertCloseToBondSubscribeMessage"] | components["schemas"]["WsAlertMarketCreatedSubscribeMessage"] | components["schemas"]["WsAlertOracleEventsSubscribeMessage"] | components["schemas"]["WsAlertAssetPriceTickSubscribeMessage"] | components["schemas"]["WsAlertAssetPriceWindowUpdateSubscribeMessage"];
5659
+ WsAlertSubscribeMessage: components["schemas"]["WsAlertTraderFirstTradeSubscribeMessage"] | components["schemas"]["WsAlertTraderNewMarketSubscribeMessage"] | components["schemas"]["WsAlertTraderWhaleTradeSubscribeMessage"] | components["schemas"]["WsAlertTraderNewTradeSubscribeMessage"] | components["schemas"]["WsAlertTraderTradeEventSubscribeMessage"] | components["schemas"]["WsAlertTraderGlobalPnlSubscribeMessage"] | components["schemas"]["WsAlertTraderMarketPnlSubscribeMessage"] | components["schemas"]["WsAlertTraderCategoryPnlSubscribeMessage"] | components["schemas"]["WsAlertTraderPositionResolvedSubscribeMessage"] | components["schemas"]["WsAlertTraderPnlExitsSubscribeMessage"] | components["schemas"]["WsAlertPositionHolderMetricsSubscribeMessage"] | components["schemas"]["WsAlertConditionHolderMetricsSubscribeMessage"] | components["schemas"]["WsAlertEventHolderMetricsSubscribeMessage"] | components["schemas"]["WsAlertConditionMetricsSubscribeMessage"] | components["schemas"]["WsAlertEventMetricsSubscribeMessage"] | components["schemas"]["WsAlertTagMetricsSubscribeMessage"] | components["schemas"]["WsAlertPositionMetricsSubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeMilestoneSubscribeMessage"] | components["schemas"]["WsAlertEventVolumeMilestoneSubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeMilestoneSubscribeMessage"] | components["schemas"]["WsAlertProbabilitySpikeSubscribeMessage"] | components["schemas"]["WsAlertPriceSpikeSubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeSpikeSubscribeMessage"] | components["schemas"]["WsAlertEventVolumeSpikeSubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeSpikeSubscribeMessage"] | components["schemas"]["WsAlertCloseToBondSubscribeMessage"] | components["schemas"]["WsAlertMarketCreatedSubscribeMessage"] | components["schemas"]["WsAlertOracleEventsSubscribeMessage"] | components["schemas"]["WsAlertAssetPriceTickSubscribeMessage"] | components["schemas"]["WsAlertAssetPriceWindowUpdateSubscribeMessage"];
5001
5660
  /** @description Typed unsubscribe request for the alerts WebSocket. The request shape depends on `event` and must match the original subscription filters. */
5002
- WsAlertUnsubscribeMessage: components["schemas"]["WsAlertTraderFirstTradeUnsubscribeMessage"] | components["schemas"]["WsAlertTraderNewMarketUnsubscribeMessage"] | components["schemas"]["WsAlertTraderWhaleTradeUnsubscribeMessage"] | components["schemas"]["WsAlertTraderNewTradeUnsubscribeMessage"] | components["schemas"]["WsAlertTraderTradeEventUnsubscribeMessage"] | components["schemas"]["WsAlertTraderGlobalPnlUnsubscribeMessage"] | components["schemas"]["WsAlertTraderMarketPnlUnsubscribeMessage"] | components["schemas"]["WsAlertTraderEventPnlUnsubscribeMessage"] | components["schemas"]["WsAlertConditionMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertEventMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertTagMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertPositionMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeMilestoneUnsubscribeMessage"] | components["schemas"]["WsAlertEventVolumeMilestoneUnsubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeMilestoneUnsubscribeMessage"] | components["schemas"]["WsAlertProbabilitySpikeUnsubscribeMessage"] | components["schemas"]["WsAlertPriceSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertEventVolumeSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertCloseToBondUnsubscribeMessage"] | components["schemas"]["WsAlertMarketCreatedUnsubscribeMessage"] | components["schemas"]["WsAlertOracleEventsUnsubscribeMessage"] | components["schemas"]["WsAlertAssetPriceTickUnsubscribeMessage"] | components["schemas"]["WsAlertAssetPriceWindowUpdateUnsubscribeMessage"];
5661
+ WsAlertUnsubscribeMessage: components["schemas"]["WsAlertTraderFirstTradeUnsubscribeMessage"] | components["schemas"]["WsAlertTraderNewMarketUnsubscribeMessage"] | components["schemas"]["WsAlertTraderWhaleTradeUnsubscribeMessage"] | components["schemas"]["WsAlertTraderNewTradeUnsubscribeMessage"] | components["schemas"]["WsAlertTraderTradeEventUnsubscribeMessage"] | components["schemas"]["WsAlertTraderGlobalPnlUnsubscribeMessage"] | components["schemas"]["WsAlertTraderMarketPnlUnsubscribeMessage"] | components["schemas"]["WsAlertTraderCategoryPnlUnsubscribeMessage"] | components["schemas"]["WsAlertTraderPositionResolvedUnsubscribeMessage"] | components["schemas"]["WsAlertTraderPnlExitsUnsubscribeMessage"] | components["schemas"]["WsAlertPositionHolderMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertConditionHolderMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertEventHolderMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertConditionMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertEventMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertTagMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertPositionMetricsUnsubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeMilestoneUnsubscribeMessage"] | components["schemas"]["WsAlertEventVolumeMilestoneUnsubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeMilestoneUnsubscribeMessage"] | components["schemas"]["WsAlertProbabilitySpikeUnsubscribeMessage"] | components["schemas"]["WsAlertPriceSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertMarketVolumeSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertEventVolumeSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertPositionVolumeSpikeUnsubscribeMessage"] | components["schemas"]["WsAlertCloseToBondUnsubscribeMessage"] | components["schemas"]["WsAlertMarketCreatedUnsubscribeMessage"] | components["schemas"]["WsAlertOracleEventsUnsubscribeMessage"] | components["schemas"]["WsAlertAssetPriceTickUnsubscribeMessage"] | components["schemas"]["WsAlertAssetPriceWindowUpdateUnsubscribeMessage"];
5003
5662
  /** @description Typed pushed-event envelope for the alerts WebSocket. The `data` payload depends on `event` and matches the corresponding HTTP webhook payload schema. */
5004
- WsAlertEventPayload: components["schemas"]["WsAlertTraderFirstTradeEvent"] | components["schemas"]["WsAlertTraderNewMarketEvent"] | components["schemas"]["WsAlertTraderWhaleTradeEvent"] | components["schemas"]["WsAlertTraderNewTradeEvent"] | components["schemas"]["WsAlertTraderTradeEventEvent"] | components["schemas"]["WsAlertTraderGlobalPnlEvent"] | components["schemas"]["WsAlertTraderMarketPnlEvent"] | components["schemas"]["WsAlertTraderEventPnlEvent"] | components["schemas"]["WsAlertConditionMetricsEvent"] | components["schemas"]["WsAlertEventMetricsEvent"] | components["schemas"]["WsAlertTagMetricsEvent"] | components["schemas"]["WsAlertPositionMetricsEvent"] | components["schemas"]["WsAlertMarketVolumeMilestoneEvent"] | components["schemas"]["WsAlertEventVolumeMilestoneEvent"] | components["schemas"]["WsAlertPositionVolumeMilestoneEvent"] | components["schemas"]["WsAlertProbabilitySpikeEvent"] | components["schemas"]["WsAlertPriceSpikeEvent"] | components["schemas"]["WsAlertMarketVolumeSpikeEvent"] | components["schemas"]["WsAlertEventVolumeSpikeEvent"] | components["schemas"]["WsAlertPositionVolumeSpikeEvent"] | components["schemas"]["WsAlertCloseToBondEvent"] | components["schemas"]["WsAlertMarketCreatedEvent"] | components["schemas"]["WsAlertOracleEventsEvent"] | components["schemas"]["WsAlertAssetPriceTickEvent"] | components["schemas"]["WsAlertAssetPriceWindowUpdateEvent"];
5663
+ WsAlertEventPayload: components["schemas"]["WsAlertTraderFirstTradeEvent"] | components["schemas"]["WsAlertTraderNewMarketEvent"] | components["schemas"]["WsAlertTraderWhaleTradeEvent"] | components["schemas"]["WsAlertTraderNewTradeEvent"] | components["schemas"]["WsAlertTraderTradeEventEvent"] | components["schemas"]["WsAlertTraderGlobalPnlEvent"] | components["schemas"]["WsAlertTraderMarketPnlEvent"] | components["schemas"]["WsAlertTraderCategoryPnlEvent"] | components["schemas"]["WsAlertTraderPositionResolvedEvent"] | components["schemas"]["WsAlertTraderPnlExitsEvent"] | components["schemas"]["WsAlertPositionHolderMetricsEvent"] | components["schemas"]["WsAlertConditionHolderMetricsEvent"] | components["schemas"]["WsAlertEventHolderMetricsEvent"] | components["schemas"]["WsAlertConditionMetricsEvent"] | components["schemas"]["WsAlertEventMetricsEvent"] | components["schemas"]["WsAlertTagMetricsEvent"] | components["schemas"]["WsAlertPositionMetricsEvent"] | components["schemas"]["WsAlertMarketVolumeMilestoneEvent"] | components["schemas"]["WsAlertEventVolumeMilestoneEvent"] | components["schemas"]["WsAlertPositionVolumeMilestoneEvent"] | components["schemas"]["WsAlertProbabilitySpikeEvent"] | components["schemas"]["WsAlertPriceSpikeEvent"] | components["schemas"]["WsAlertMarketVolumeSpikeEvent"] | components["schemas"]["WsAlertEventVolumeSpikeEvent"] | components["schemas"]["WsAlertPositionVolumeSpikeEvent"] | components["schemas"]["WsAlertCloseToBondEvent"] | components["schemas"]["WsAlertMarketCreatedEvent"] | components["schemas"]["WsAlertOracleEventsEvent"] | components["schemas"]["WsAlertAssetPriceTickEvent"] | components["schemas"]["WsAlertAssetPriceWindowUpdateEvent"];
5005
5664
  };
5006
5665
  responses: never;
5007
5666
  parameters: never;
@@ -5019,7 +5678,12 @@ export interface WsAlertSubscribeMap {
5019
5678
  trader_trade_event: components["schemas"]["WsAlertTraderTradeEventSubscribeMessage"];
5020
5679
  trader_global_pnl: components["schemas"]["WsAlertTraderGlobalPnlSubscribeMessage"];
5021
5680
  trader_market_pnl: components["schemas"]["WsAlertTraderMarketPnlSubscribeMessage"];
5022
- trader_event_pnl: components["schemas"]["WsAlertTraderEventPnlSubscribeMessage"];
5681
+ trader_category_pnl: components["schemas"]["WsAlertTraderCategoryPnlSubscribeMessage"];
5682
+ trader_position_resolved: components["schemas"]["WsAlertTraderPositionResolvedSubscribeMessage"];
5683
+ trader_pnl_exits: components["schemas"]["WsAlertTraderPnlExitsSubscribeMessage"];
5684
+ position_holder_metrics: components["schemas"]["WsAlertPositionHolderMetricsSubscribeMessage"];
5685
+ condition_holder_metrics: components["schemas"]["WsAlertConditionHolderMetricsSubscribeMessage"];
5686
+ event_holder_metrics: components["schemas"]["WsAlertEventHolderMetricsSubscribeMessage"];
5023
5687
  condition_metrics: components["schemas"]["WsAlertConditionMetricsSubscribeMessage"];
5024
5688
  event_metrics: components["schemas"]["WsAlertEventMetricsSubscribeMessage"];
5025
5689
  tag_metrics: components["schemas"]["WsAlertTagMetricsSubscribeMessage"];
@@ -5046,7 +5710,12 @@ export interface WsAlertEventDataMap {
5046
5710
  trader_trade_event: components["schemas"]["WebhookTraderTradeEventPayload"];
5047
5711
  trader_global_pnl: components["schemas"]["GlobalPnlPayload"];
5048
5712
  trader_market_pnl: components["schemas"]["MarketPnlPayload"];
5049
- trader_event_pnl: components["schemas"]["EventPnlPayload"];
5713
+ trader_category_pnl: components["schemas"]["CategoryPnlPayload"];
5714
+ trader_position_resolved: components["schemas"]["PositionResolvedPayload"];
5715
+ trader_pnl_exits: components["schemas"]["ExitMarkersPayload"];
5716
+ position_holder_metrics: components["schemas"]["PositionHolderMetricsPayload"];
5717
+ condition_holder_metrics: components["schemas"]["ConditionHolderMetricsPayload"];
5718
+ event_holder_metrics: components["schemas"]["EventHolderMetricsPayload"];
5050
5719
  condition_metrics: components["schemas"]["ConditionMetricsPayload"];
5051
5720
  event_metrics: components["schemas"]["EventMetricsPayload"];
5052
5721
  tag_metrics: components["schemas"]["TagMetricsPayload"];