@structbuild/sdk 0.5.2 → 0.5.3
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.
- package/dist/generated/polymarket.d.ts +81 -7
- package/dist/generated/webhooks.d.ts +1043 -742
- package/dist/generated/ws-alerts.d.ts +1047 -740
- package/dist/generated/ws.d.ts +775 -110
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +4 -1
- package/dist/index.js.map +3 -3
- package/dist/namespaces/builders.d.ts +2 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +1 -1
package/dist/generated/ws.d.ts
CHANGED
|
@@ -86,10 +86,15 @@ export interface components {
|
|
|
86
86
|
slug?: string | null;
|
|
87
87
|
event_slug?: string | null;
|
|
88
88
|
};
|
|
89
|
+
/** @description Subscription filters for the `asset_price_tick` event. All fields are optional. */
|
|
90
|
+
AssetPriceTickFilters: {
|
|
91
|
+
/** @description Restrict to these crypto assets. Empty = all assets. */
|
|
92
|
+
asset_symbols?: components["schemas"]["WebhookAssetSymbol"][] | null;
|
|
93
|
+
};
|
|
89
94
|
/** @description Webhook payload for an asset price tick. */
|
|
90
95
|
AssetPriceTickPayload: {
|
|
91
|
-
/** @description Asset symbol
|
|
92
|
-
symbol:
|
|
96
|
+
/** @description Asset symbol */
|
|
97
|
+
symbol: components["schemas"]["WebhookAssetSymbol"];
|
|
93
98
|
/**
|
|
94
99
|
* Format: double
|
|
95
100
|
* @description Current price from the Chainlink feed
|
|
@@ -101,12 +106,19 @@ export interface components {
|
|
|
101
106
|
*/
|
|
102
107
|
timestamp_ms: number;
|
|
103
108
|
};
|
|
109
|
+
/** @description Subscription filters for the `asset_price_window_update` event. All fields are optional. */
|
|
110
|
+
AssetPriceWindowUpdateFilters: {
|
|
111
|
+
/** @description Restrict to these crypto assets. Empty = all assets. */
|
|
112
|
+
asset_symbols?: components["schemas"]["WebhookAssetSymbol"][] | null;
|
|
113
|
+
/** @description Restrict to these candle sizes. Empty = all sizes. */
|
|
114
|
+
timeframes?: components["schemas"]["AssetWindowFilterTimeframe"][] | null;
|
|
115
|
+
};
|
|
104
116
|
/** @description Webhook payload for an asset price window open or close. */
|
|
105
117
|
AssetPriceWindowUpdatePayload: {
|
|
106
|
-
/** @description Asset symbol
|
|
107
|
-
symbol:
|
|
108
|
-
/** @description Time-window variant
|
|
109
|
-
variant:
|
|
118
|
+
/** @description Asset symbol */
|
|
119
|
+
symbol: components["schemas"]["WebhookAssetSymbol"];
|
|
120
|
+
/** @description Time-window variant */
|
|
121
|
+
variant: components["schemas"]["AssetPriceWindowVariant"];
|
|
110
122
|
/**
|
|
111
123
|
* Format: int64
|
|
112
124
|
* @description Window start timestamp (milliseconds since epoch)
|
|
@@ -128,7 +140,50 @@ export interface components {
|
|
|
128
140
|
*/
|
|
129
141
|
close_price: number;
|
|
130
142
|
/** @description "open" when the window starts, "close" when the window is complete */
|
|
131
|
-
update_type:
|
|
143
|
+
update_type: components["schemas"]["AssetPriceWindowUpdateType"];
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* @description Whether this update is the open or the close of a candle.
|
|
147
|
+
* @enum {string}
|
|
148
|
+
*/
|
|
149
|
+
AssetPriceWindowUpdateType: "open" | "close";
|
|
150
|
+
/**
|
|
151
|
+
* @description Time-window variant emitted by the asset price window stream.
|
|
152
|
+
* @enum {string}
|
|
153
|
+
*/
|
|
154
|
+
AssetPriceWindowVariant: "5m" | "15m" | "1h" | "4h" | "1d" | "24h";
|
|
155
|
+
/**
|
|
156
|
+
* @description Candle sizes accepted by `asset_price_window_update.timeframes`.
|
|
157
|
+
* @enum {string}
|
|
158
|
+
*/
|
|
159
|
+
AssetWindowFilterTimeframe: "5m" | "15m" | "1h" | "4h" | "1d" | "24h";
|
|
160
|
+
/**
|
|
161
|
+
* @description Subscription filters for the `close_to_bond` event. At least one of
|
|
162
|
+
* `min_probability` or `max_probability` is required (enforced at runtime).
|
|
163
|
+
*/
|
|
164
|
+
CloseToBondFilters: {
|
|
165
|
+
/**
|
|
166
|
+
* Format: double
|
|
167
|
+
* @description Trigger when the YES outcome price is ≥ this value (e.g. 0.95 for 95% certainty). At least one of `min_probability` or `max_probability` must be set.
|
|
168
|
+
*/
|
|
169
|
+
min_probability?: number | null;
|
|
170
|
+
/**
|
|
171
|
+
* Format: double
|
|
172
|
+
* @description Trigger when the YES outcome price is ≤ this value (e.g. 0.05 for near-certain NO).
|
|
173
|
+
*/
|
|
174
|
+
max_probability?: number | null;
|
|
175
|
+
/** @description Restrict to these markets. */
|
|
176
|
+
condition_ids?: string[] | null;
|
|
177
|
+
/** @description Restrict to these outcome token IDs. */
|
|
178
|
+
position_ids?: string[] | null;
|
|
179
|
+
/** @description Restrict to markets in these events. */
|
|
180
|
+
event_slugs?: string[] | null;
|
|
181
|
+
/** @description Restrict to these outcome names (e.g. \["Yes", "No"\]). */
|
|
182
|
+
outcomes?: string[] | null;
|
|
183
|
+
/** @description Restrict by outcome index. 0 = Yes/Up, 1 = No. Position 0 usually represents the Up/Yes side in binary markets. */
|
|
184
|
+
position_outcome_indices?: number[] | null;
|
|
185
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
186
|
+
exclude_shortterm_markets?: boolean | null;
|
|
132
187
|
};
|
|
133
188
|
/** @description Close-to-bond webhook payload */
|
|
134
189
|
CloseToBondPayload: {
|
|
@@ -202,17 +257,31 @@ export interface components {
|
|
|
202
257
|
*/
|
|
203
258
|
threshold: number;
|
|
204
259
|
};
|
|
205
|
-
/** @description
|
|
260
|
+
/** @description Payload delivered when a market's volume or transaction metrics cross a configured threshold */
|
|
206
261
|
ConditionMetricsPayload: {
|
|
262
|
+
/** @description Market condition ID */
|
|
207
263
|
condition_id?: string | null;
|
|
208
|
-
|
|
209
|
-
|
|
264
|
+
/** @description Aggregation window */
|
|
265
|
+
timeframe?: null | ("1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "6h" | "1d" | "24h" | "7d" | "30d");
|
|
266
|
+
/**
|
|
267
|
+
* Format: double
|
|
268
|
+
* @description Total trading volume in USD for this timeframe
|
|
269
|
+
*/
|
|
210
270
|
volume_usd?: number | null;
|
|
211
|
-
/**
|
|
271
|
+
/**
|
|
272
|
+
* Format: double
|
|
273
|
+
* @description Total fees collected in USD
|
|
274
|
+
*/
|
|
212
275
|
fees?: number | null;
|
|
213
|
-
/**
|
|
276
|
+
/**
|
|
277
|
+
* Format: int64
|
|
278
|
+
* @description Total number of transactions
|
|
279
|
+
*/
|
|
214
280
|
txns?: number | null;
|
|
215
|
-
/**
|
|
281
|
+
/**
|
|
282
|
+
* Format: int64
|
|
283
|
+
* @description Number of unique traders
|
|
284
|
+
*/
|
|
216
285
|
unique_traders?: number | null;
|
|
217
286
|
};
|
|
218
287
|
/** @description CTF ConditionResolution: positions become redeemable on the Conditional Tokens contract. */
|
|
@@ -284,17 +353,53 @@ export interface components {
|
|
|
284
353
|
slug?: string | null;
|
|
285
354
|
event_slug?: string | null;
|
|
286
355
|
};
|
|
287
|
-
/** @description
|
|
356
|
+
/** @description Subscription filters for the `event_metrics` event. All fields are optional. */
|
|
357
|
+
EventMetricsFilters: {
|
|
358
|
+
/** @description Restrict to these events. Empty = all events. */
|
|
359
|
+
event_slugs?: string[] | null;
|
|
360
|
+
/** @description Restrict to these aggregation windows. */
|
|
361
|
+
timeframes?: components["schemas"]["MetricFilterTimeframe"][] | null;
|
|
362
|
+
/**
|
|
363
|
+
* Format: double
|
|
364
|
+
* @description Only fire when aggregated event volume ≥ this value (USD).
|
|
365
|
+
*/
|
|
366
|
+
min_volume_usd?: number | null;
|
|
367
|
+
/** Format: double */
|
|
368
|
+
max_volume_usd?: number | null;
|
|
369
|
+
/** Format: int64 */
|
|
370
|
+
min_txns?: number | null;
|
|
371
|
+
/** Format: int64 */
|
|
372
|
+
min_unique_traders?: number | null;
|
|
373
|
+
/** Format: double */
|
|
374
|
+
min_fees?: number | null;
|
|
375
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
376
|
+
exclude_shortterm_markets?: boolean | null;
|
|
377
|
+
};
|
|
378
|
+
/** @description Payload delivered when an event's aggregated volume or transaction metrics cross a configured threshold */
|
|
288
379
|
EventMetricsPayload: {
|
|
380
|
+
/** @description Event slug */
|
|
289
381
|
event_slug?: string | null;
|
|
290
|
-
|
|
291
|
-
|
|
382
|
+
/** @description Aggregation window */
|
|
383
|
+
timeframe?: null | ("1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "6h" | "1d" | "24h" | "7d" | "30d");
|
|
384
|
+
/**
|
|
385
|
+
* Format: double
|
|
386
|
+
* @description Total aggregated volume across all markets in the event (USD)
|
|
387
|
+
*/
|
|
292
388
|
volume_usd?: number | null;
|
|
293
|
-
/**
|
|
389
|
+
/**
|
|
390
|
+
* Format: double
|
|
391
|
+
* @description Total fees collected in USD
|
|
392
|
+
*/
|
|
294
393
|
fees?: number | null;
|
|
295
|
-
/**
|
|
394
|
+
/**
|
|
395
|
+
* Format: int64
|
|
396
|
+
* @description Total number of transactions
|
|
397
|
+
*/
|
|
296
398
|
txns?: number | null;
|
|
297
|
-
/**
|
|
399
|
+
/**
|
|
400
|
+
* Format: int64
|
|
401
|
+
* @description Number of unique traders
|
|
402
|
+
*/
|
|
298
403
|
unique_traders?: number | null;
|
|
299
404
|
};
|
|
300
405
|
/** @description Event PnL webhook payload (Arc-optimized) */
|
|
@@ -338,6 +443,17 @@ export interface components {
|
|
|
338
443
|
/** Format: int64 */
|
|
339
444
|
last_trade_at?: number | null;
|
|
340
445
|
};
|
|
446
|
+
/** @description Subscription filters for the `event_volume_milestone` event. */
|
|
447
|
+
EventVolumeMilestoneFilters: {
|
|
448
|
+
/** @description **Required.** Aggregation windows to monitor. */
|
|
449
|
+
timeframes: components["schemas"]["MetricFilterTimeframe"][];
|
|
450
|
+
/** @description Restrict to these events. */
|
|
451
|
+
event_slugs?: string[] | null;
|
|
452
|
+
/** @description Specific USD milestones to trigger on. */
|
|
453
|
+
milestone_amounts?: number[] | null;
|
|
454
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
455
|
+
exclude_shortterm_markets?: boolean | null;
|
|
456
|
+
};
|
|
341
457
|
/** @description Event volume milestone webhook payload */
|
|
342
458
|
EventVolumeMilestonePayload: {
|
|
343
459
|
event_slug: string;
|
|
@@ -363,6 +479,25 @@ export interface components {
|
|
|
363
479
|
*/
|
|
364
480
|
txns: number;
|
|
365
481
|
};
|
|
482
|
+
/** @description Subscription filters for the `event_volume_spike` event. `spike_ratio` is required. */
|
|
483
|
+
EventVolumeSpikeFilters: {
|
|
484
|
+
/**
|
|
485
|
+
* Format: double
|
|
486
|
+
* @description **Required.** Multiplier threshold (must be > 1.0). Fires when current volume >= snapshot × ratio.
|
|
487
|
+
*/
|
|
488
|
+
spike_ratio: number;
|
|
489
|
+
/**
|
|
490
|
+
* Format: int64
|
|
491
|
+
* @description Force snapshot reset after this many seconds (max 600 / 10 minutes).
|
|
492
|
+
*/
|
|
493
|
+
window_secs?: number | null;
|
|
494
|
+
/** @description Restrict to these events. */
|
|
495
|
+
event_slugs?: string[] | null;
|
|
496
|
+
/** @description Restrict to these aggregation windows. */
|
|
497
|
+
timeframes?: components["schemas"]["VolumeSpikeFilterTimeframe"][] | null;
|
|
498
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
499
|
+
exclude_shortterm_markets?: boolean | null;
|
|
500
|
+
};
|
|
366
501
|
/** @description Event volume spike webhook payload */
|
|
367
502
|
EventVolumeSpikePayload: {
|
|
368
503
|
event_slug: string;
|
|
@@ -400,32 +535,32 @@ export interface components {
|
|
|
400
535
|
*/
|
|
401
536
|
fees: number;
|
|
402
537
|
};
|
|
403
|
-
/** @description
|
|
538
|
+
/** @description Payload delivered when a tracked trader executes their first-ever trade on Polymarket */
|
|
404
539
|
FirstTradePayload: {
|
|
405
|
-
/** @description
|
|
540
|
+
/** @description Limit-order maker wallet address (lowercase) */
|
|
406
541
|
trader: string;
|
|
407
|
-
/** @description
|
|
542
|
+
/** @description Order filler wallet address (lowercase) */
|
|
408
543
|
taker: string;
|
|
409
|
-
/** @description
|
|
544
|
+
/** @description ERC-1155 outcome token ID */
|
|
410
545
|
position_id: string;
|
|
411
|
-
/** @description
|
|
546
|
+
/** @description Parent market condition ID (0x-prefixed hex) */
|
|
412
547
|
condition_id?: string | null;
|
|
413
|
-
/** @description
|
|
548
|
+
/** @description Outcome name (e.g. "Yes", "No") */
|
|
414
549
|
outcome?: string | null;
|
|
415
550
|
/**
|
|
416
551
|
* Format: int32
|
|
417
|
-
* @description Outcome index
|
|
552
|
+
* @description Outcome index: 0 = Yes/Up, 1 = No
|
|
418
553
|
*/
|
|
419
554
|
outcome_index?: number | null;
|
|
420
|
-
/** @description Market question
|
|
555
|
+
/** @description Market question text */
|
|
421
556
|
question?: string | null;
|
|
422
|
-
/** @description Market slug
|
|
557
|
+
/** @description Market slug */
|
|
423
558
|
market_slug?: string | null;
|
|
424
|
-
/** @description
|
|
559
|
+
/** @description Parent event slug */
|
|
425
560
|
event_slug?: string | null;
|
|
426
|
-
/** @description
|
|
561
|
+
/** @description Unique trade identifier */
|
|
427
562
|
trade_id: string;
|
|
428
|
-
/** @description Transaction hash
|
|
563
|
+
/** @description Transaction hash */
|
|
429
564
|
hash: string;
|
|
430
565
|
/**
|
|
431
566
|
* Format: int64
|
|
@@ -434,24 +569,35 @@ export interface components {
|
|
|
434
569
|
block: number;
|
|
435
570
|
/**
|
|
436
571
|
* Format: int64
|
|
437
|
-
* @description
|
|
572
|
+
* @description Block confirmation timestamp (Unix seconds)
|
|
438
573
|
*/
|
|
439
574
|
confirmed_at: number;
|
|
440
|
-
/**
|
|
575
|
+
/**
|
|
576
|
+
* Format: double
|
|
577
|
+
* @description USD size of the trade (6 decimal places)
|
|
578
|
+
*/
|
|
441
579
|
amount_usd: number;
|
|
442
|
-
/**
|
|
580
|
+
/**
|
|
581
|
+
* Format: double
|
|
582
|
+
* @description Outcome shares traded (6 decimal places)
|
|
583
|
+
*/
|
|
443
584
|
shares_amount: number;
|
|
444
|
-
/**
|
|
585
|
+
/**
|
|
586
|
+
* Format: double
|
|
587
|
+
* @description Fee paid in USD (6 decimal places)
|
|
588
|
+
*/
|
|
445
589
|
fee: number;
|
|
446
|
-
/** @description Trade
|
|
447
|
-
side:
|
|
590
|
+
/** @description Trade direction */
|
|
591
|
+
side: "Buy" | "Sell";
|
|
448
592
|
/**
|
|
449
593
|
* Format: double
|
|
450
|
-
* @description
|
|
594
|
+
* @description Outcome token price (0.0–1.0)
|
|
451
595
|
*/
|
|
452
596
|
price: number;
|
|
453
|
-
|
|
454
|
-
|
|
597
|
+
/** @description Exchange contract that processed the trade */
|
|
598
|
+
exchange: "CTFExchange" | "NegRiskExchange" | "ConditionalTokens" | "NegRiskAdapter" | "CTFExchangeV2" | "NegRiskExchangeV2" | "Unknown";
|
|
599
|
+
/** @description Trade type (webhook events only fire on order fills) */
|
|
600
|
+
trade_type: "OrderFilled" | "OrdersMatched";
|
|
455
601
|
};
|
|
456
602
|
/** @description Global PnL webhook payload (Arc-optimized) */
|
|
457
603
|
GlobalPnlPayload: {
|
|
@@ -508,6 +654,15 @@ export interface components {
|
|
|
508
654
|
ListEventsResponse: {
|
|
509
655
|
events: components["schemas"]["WebhookEventInfo"][];
|
|
510
656
|
};
|
|
657
|
+
/** @description Subscription filters for the `market_created` event. All fields are optional. */
|
|
658
|
+
MarketCreatedFilters: {
|
|
659
|
+
/** @description Restrict to markets with these tags or category names (case-insensitive match). */
|
|
660
|
+
tags?: string[] | null;
|
|
661
|
+
/** @description Restrict to markets belonging to these events. */
|
|
662
|
+
event_slugs?: string[] | null;
|
|
663
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets (event slugs containing `updown`). Default: `false`. */
|
|
664
|
+
exclude_shortterm_markets?: boolean | null;
|
|
665
|
+
};
|
|
511
666
|
/** @description Outcome entry in the market created payload — mirrors `NewMarketOutcome` */
|
|
512
667
|
MarketCreatedOutcome: {
|
|
513
668
|
/**
|
|
@@ -551,6 +706,38 @@ export interface components {
|
|
|
551
706
|
/** @description Whether this is a neg-risk market */
|
|
552
707
|
neg_risk: boolean;
|
|
553
708
|
};
|
|
709
|
+
/** @description Subscription filters for the `condition_metrics` event. All fields are optional. */
|
|
710
|
+
MarketMetricsFilters: {
|
|
711
|
+
/** @description Restrict to these markets. Empty = all markets. */
|
|
712
|
+
condition_ids?: string[] | null;
|
|
713
|
+
/** @description Restrict to these aggregation windows. Empty = all windows. */
|
|
714
|
+
timeframes?: components["schemas"]["MetricFilterTimeframe"][] | null;
|
|
715
|
+
/**
|
|
716
|
+
* Format: double
|
|
717
|
+
* @description Only fire when volume ≥ this value (USD).
|
|
718
|
+
*/
|
|
719
|
+
min_volume_usd?: number | null;
|
|
720
|
+
/**
|
|
721
|
+
* Format: double
|
|
722
|
+
* @description Only fire when volume ≤ this value (USD).
|
|
723
|
+
*/
|
|
724
|
+
max_volume_usd?: number | null;
|
|
725
|
+
/**
|
|
726
|
+
* Format: int64
|
|
727
|
+
* @description Only fire when transaction count ≥ this value.
|
|
728
|
+
*/
|
|
729
|
+
min_txns?: number | null;
|
|
730
|
+
/**
|
|
731
|
+
* Format: int64
|
|
732
|
+
* @description Only fire when unique trader count ≥ this value.
|
|
733
|
+
*/
|
|
734
|
+
min_unique_traders?: number | null;
|
|
735
|
+
/**
|
|
736
|
+
* Format: double
|
|
737
|
+
* @description Only fire when total fees ≥ this value (USD).
|
|
738
|
+
*/
|
|
739
|
+
min_fees?: number | null;
|
|
740
|
+
};
|
|
554
741
|
/** @description Market PnL webhook payload (Arc-optimized) */
|
|
555
742
|
MarketPnlPayload: {
|
|
556
743
|
trader?: string | null;
|
|
@@ -587,6 +774,32 @@ export interface components {
|
|
|
587
774
|
/** Format: int64 */
|
|
588
775
|
last_trade_at?: number | null;
|
|
589
776
|
};
|
|
777
|
+
/** @description Subscription filters for the `market_volume_milestone` event. */
|
|
778
|
+
MarketVolumeMilestoneFilters: {
|
|
779
|
+
/** @description **Required.** Aggregation windows to monitor (e.g. \["1h", "24h"\]). */
|
|
780
|
+
timeframes: components["schemas"]["MetricFilterTimeframe"][];
|
|
781
|
+
/** @description Restrict to these markets. Empty = all markets. */
|
|
782
|
+
condition_ids?: string[] | null;
|
|
783
|
+
/** @description Specific USD milestones to trigger on (e.g. \[10000, 100000, 1000000\]). Empty = all milestones. */
|
|
784
|
+
milestone_amounts?: number[] | null;
|
|
785
|
+
};
|
|
786
|
+
/** @description Subscription filters for the `market_volume_spike` event. `spike_ratio` is required. */
|
|
787
|
+
MarketVolumeSpikeFilters: {
|
|
788
|
+
/**
|
|
789
|
+
* Format: double
|
|
790
|
+
* @description **Required.** Multiplier threshold (must be > 1.0). Fires when current volume >= snapshot × ratio. The snapshot is set automatically on first data and resets after each fire.
|
|
791
|
+
*/
|
|
792
|
+
spike_ratio: number;
|
|
793
|
+
/**
|
|
794
|
+
* Format: int64
|
|
795
|
+
* @description Force snapshot reset after this many seconds (max 600 / 10 minutes).
|
|
796
|
+
*/
|
|
797
|
+
window_secs?: number | null;
|
|
798
|
+
/** @description Restrict to these markets. Empty = all markets. */
|
|
799
|
+
condition_ids?: string[] | null;
|
|
800
|
+
/** @description Restrict to these aggregation windows. Empty = all windows. */
|
|
801
|
+
timeframes?: components["schemas"]["VolumeSpikeFilterTimeframe"][] | null;
|
|
802
|
+
};
|
|
590
803
|
/** @description Market volume spike webhook payload */
|
|
591
804
|
MarketVolumeSpikePayload: {
|
|
592
805
|
condition_id: string;
|
|
@@ -626,6 +839,11 @@ export interface components {
|
|
|
626
839
|
*/
|
|
627
840
|
fees: number;
|
|
628
841
|
};
|
|
842
|
+
/**
|
|
843
|
+
* @description Aggregation windows emitted by the metrics / milestone streams.
|
|
844
|
+
* @enum {string}
|
|
845
|
+
*/
|
|
846
|
+
MetricFilterTimeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d";
|
|
629
847
|
/** @description NegRisk Adapter: outcome reported for a neg-risk market question. */
|
|
630
848
|
NegRiskOutcomeReportedEvent: {
|
|
631
849
|
id: string;
|
|
@@ -648,35 +866,30 @@ export interface components {
|
|
|
648
866
|
slug?: string | null;
|
|
649
867
|
event_slug?: string | null;
|
|
650
868
|
};
|
|
651
|
-
/**
|
|
652
|
-
* @description New market entry webhook payload
|
|
653
|
-
*
|
|
654
|
-
* Fired when a trader places their first trade in a specific condition/market.
|
|
655
|
-
* The payload contains the full details of the triggering trade.
|
|
656
|
-
*/
|
|
869
|
+
/** @description Payload delivered when a trader places their first trade in a specific market (fires once per trader+market pair) */
|
|
657
870
|
NewMarketPayload: {
|
|
658
|
-
/** @description
|
|
871
|
+
/** @description Limit-order maker wallet address (lowercase) */
|
|
659
872
|
trader: string;
|
|
660
|
-
/** @description
|
|
873
|
+
/** @description Order filler wallet address (lowercase) */
|
|
661
874
|
taker: string;
|
|
662
|
-
/** @description
|
|
875
|
+
/** @description ERC-1155 outcome token ID */
|
|
663
876
|
position_id: string;
|
|
664
|
-
/** @description
|
|
877
|
+
/** @description Parent market condition ID */
|
|
665
878
|
condition_id?: string | null;
|
|
666
879
|
/** @description Outcome name (e.g. "Yes", "No") */
|
|
667
880
|
outcome?: string | null;
|
|
668
881
|
/**
|
|
669
882
|
* Format: int32
|
|
670
|
-
* @description Outcome index
|
|
883
|
+
* @description Outcome index: 0 = Yes/Up, 1 = No
|
|
671
884
|
*/
|
|
672
885
|
outcome_index?: number | null;
|
|
673
|
-
/** @description Market question */
|
|
886
|
+
/** @description Market question text */
|
|
674
887
|
question?: string | null;
|
|
675
888
|
/** @description Market slug */
|
|
676
889
|
market_slug?: string | null;
|
|
677
|
-
/** @description
|
|
890
|
+
/** @description Parent event slug */
|
|
678
891
|
event_slug?: string | null;
|
|
679
|
-
/** @description
|
|
892
|
+
/** @description Unique trade identifier */
|
|
680
893
|
trade_id: string;
|
|
681
894
|
/** @description Transaction hash */
|
|
682
895
|
hash: string;
|
|
@@ -687,63 +900,71 @@ export interface components {
|
|
|
687
900
|
block: number;
|
|
688
901
|
/**
|
|
689
902
|
* Format: int64
|
|
690
|
-
* @description
|
|
903
|
+
* @description Block confirmation timestamp (Unix seconds)
|
|
691
904
|
*/
|
|
692
905
|
confirmed_at: number;
|
|
693
906
|
/**
|
|
694
907
|
* Format: double
|
|
695
|
-
* @description USD size of the trade
|
|
908
|
+
* @description USD size of the trade (6 decimal places)
|
|
696
909
|
*/
|
|
697
910
|
amount_usd: number;
|
|
698
911
|
/**
|
|
699
912
|
* Format: double
|
|
700
|
-
* @description Outcome shares traded
|
|
913
|
+
* @description Outcome shares traded (6 decimal places)
|
|
701
914
|
*/
|
|
702
915
|
shares_amount: number;
|
|
703
916
|
/**
|
|
704
917
|
* Format: double
|
|
705
|
-
* @description Fee paid (
|
|
918
|
+
* @description Fee paid in USD (6 decimal places)
|
|
706
919
|
*/
|
|
707
920
|
fee: number;
|
|
708
|
-
/** @description Trade
|
|
709
|
-
side:
|
|
921
|
+
/** @description Trade direction */
|
|
922
|
+
side: "Buy" | "Sell";
|
|
710
923
|
/**
|
|
711
924
|
* Format: double
|
|
712
|
-
* @description
|
|
925
|
+
* @description Outcome token price (0.0–1.0)
|
|
713
926
|
*/
|
|
714
927
|
price: number;
|
|
715
928
|
/**
|
|
716
929
|
* Format: double
|
|
717
|
-
* @description Implied probability (0.0–1.0);
|
|
930
|
+
* @description Implied probability (0.0–1.0); null when outcome is unknown
|
|
718
931
|
*/
|
|
719
932
|
probability?: number | null;
|
|
720
|
-
|
|
721
|
-
|
|
933
|
+
/** @description Exchange contract that processed the trade */
|
|
934
|
+
exchange: "CTFExchange" | "NegRiskExchange" | "ConditionalTokens" | "NegRiskAdapter" | "CTFExchangeV2" | "NegRiskExchangeV2" | "Unknown";
|
|
935
|
+
/** @description Trade type (webhook events only fire on order fills) */
|
|
936
|
+
trade_type: "OrderFilled" | "OrdersMatched";
|
|
722
937
|
};
|
|
723
|
-
/**
|
|
938
|
+
/**
|
|
939
|
+
* @description Trade types accepted by `trader_new_trade.trade_types`. Webhook fires on
|
|
940
|
+
* fill-style trades only.
|
|
941
|
+
* @enum {string}
|
|
942
|
+
*/
|
|
943
|
+
NewTradeFilterType: "OrderFilled" | "OrdersMatched";
|
|
944
|
+
/** @description Payload delivered on every order-filled trade */
|
|
724
945
|
NewTradePayload: {
|
|
725
|
-
/** @description
|
|
946
|
+
/** @description Limit-order maker wallet address (lowercase) */
|
|
726
947
|
trader: string;
|
|
727
|
-
/** @description
|
|
948
|
+
/** @description Order filler wallet address (lowercase) */
|
|
728
949
|
taker: string;
|
|
729
|
-
/** @description
|
|
950
|
+
/** @description ERC-1155 outcome token ID */
|
|
730
951
|
position_id: string;
|
|
731
|
-
/** @description
|
|
952
|
+
/** @description Parent market condition ID */
|
|
732
953
|
condition_id?: string | null;
|
|
733
954
|
/** @description Outcome name (e.g. "Yes", "No") */
|
|
734
955
|
outcome?: string | null;
|
|
735
956
|
/**
|
|
736
957
|
* Format: int32
|
|
737
|
-
* @description Outcome index
|
|
958
|
+
* @description Outcome index: 0 = Yes/Up, 1 = No
|
|
738
959
|
*/
|
|
739
960
|
outcome_index?: number | null;
|
|
740
|
-
/** @description Market question */
|
|
961
|
+
/** @description Market question text */
|
|
741
962
|
question?: string | null;
|
|
742
963
|
/** @description Market slug */
|
|
743
964
|
market_slug?: string | null;
|
|
744
|
-
/** @description
|
|
965
|
+
/** @description Parent event slug */
|
|
745
966
|
event_slug?: string | null;
|
|
746
|
-
/** @description
|
|
967
|
+
/** @description Unique trade identifier */
|
|
747
968
|
trade_id: string;
|
|
748
969
|
/** @description Transaction hash */
|
|
749
970
|
hash: string;
|
|
@@ -754,39 +975,46 @@ export interface components {
|
|
|
754
975
|
block: number;
|
|
755
976
|
/**
|
|
756
977
|
* Format: int64
|
|
757
|
-
* @description
|
|
978
|
+
* @description Block confirmation timestamp (Unix seconds)
|
|
758
979
|
*/
|
|
759
980
|
confirmed_at: number;
|
|
760
981
|
/**
|
|
761
982
|
* Format: double
|
|
762
|
-
* @description USD size of the trade
|
|
983
|
+
* @description USD size of the trade (6 decimal places)
|
|
763
984
|
*/
|
|
764
985
|
amount_usd: number;
|
|
765
986
|
/**
|
|
766
987
|
* Format: double
|
|
767
|
-
* @description Outcome shares traded
|
|
988
|
+
* @description Outcome shares traded (6 decimal places)
|
|
768
989
|
*/
|
|
769
990
|
shares_amount: number;
|
|
770
991
|
/**
|
|
771
992
|
* Format: double
|
|
772
|
-
* @description Fee paid (
|
|
993
|
+
* @description Fee paid in USD (6 decimal places)
|
|
773
994
|
*/
|
|
774
995
|
fee: number;
|
|
775
|
-
/** @description Trade
|
|
776
|
-
side:
|
|
996
|
+
/** @description Trade direction */
|
|
997
|
+
side: "Buy" | "Sell";
|
|
777
998
|
/**
|
|
778
999
|
* Format: double
|
|
779
|
-
* @description
|
|
1000
|
+
* @description Outcome token price (0.0–1.0)
|
|
780
1001
|
*/
|
|
781
1002
|
price: number;
|
|
782
1003
|
/**
|
|
783
1004
|
* Format: double
|
|
784
|
-
* @description Implied probability
|
|
1005
|
+
* @description Implied probability (0.0–1.0); null when outcome is unknown
|
|
785
1006
|
*/
|
|
786
1007
|
probability?: number | null;
|
|
787
|
-
|
|
788
|
-
|
|
1008
|
+
/** @description Exchange contract that processed the trade */
|
|
1009
|
+
exchange: "CTFExchange" | "NegRiskExchange" | "ConditionalTokens" | "NegRiskAdapter" | "CTFExchangeV2" | "NegRiskExchangeV2" | "Unknown";
|
|
1010
|
+
/** @description Trade type (webhook events only fire on order fills) */
|
|
1011
|
+
trade_type: "OrderFilled" | "OrdersMatched";
|
|
789
1012
|
};
|
|
1013
|
+
/**
|
|
1014
|
+
* @description Oracle event variants accepted by `oracle_events.oracle_event_types`.
|
|
1015
|
+
* @enum {string}
|
|
1016
|
+
*/
|
|
1017
|
+
OracleEventFilterType: "AssertionMade" | "AssertionDisputed" | "AssertionSettled" | "RequestPrice" | "ProposePrice" | "DisputePrice" | "Settle" | "QuestionResolved" | "QuestionEmergencyResolved" | "QuestionReset" | "QuestionInitialized" | "QuestionPaused" | "QuestionUnpaused" | "QuestionFlagged" | "QuestionUnflagged" | "ConditionResolution" | "NegRiskOutcomeReported";
|
|
790
1018
|
/**
|
|
791
1019
|
* @description Tagged enum for all oracle event types — serializes with `"event_type": "..."` discriminator
|
|
792
1020
|
* and only includes fields relevant to each type.
|
|
@@ -843,6 +1071,18 @@ export interface components {
|
|
|
843
1071
|
/** @enum {string} */
|
|
844
1072
|
event_type: "NegRiskOutcomeReported";
|
|
845
1073
|
});
|
|
1074
|
+
/** @description Subscription filters for the `oracle_events` event. All fields are optional. */
|
|
1075
|
+
OracleEventsFilters: {
|
|
1076
|
+
/** @description Restrict to these event types (case-insensitive). Empty = all. */
|
|
1077
|
+
oracle_event_types?: components["schemas"]["OracleEventFilterType"][] | null;
|
|
1078
|
+
/** @description Restrict to events for these condition IDs. */
|
|
1079
|
+
condition_ids?: string[] | null;
|
|
1080
|
+
};
|
|
1081
|
+
/**
|
|
1082
|
+
* @description PnL aggregation windows accepted by `*_pnl.timeframes`.
|
|
1083
|
+
* @enum {string}
|
|
1084
|
+
*/
|
|
1085
|
+
PnlFilterTimeframe: "1d" | "7d" | "30d" | "lifetime";
|
|
846
1086
|
/**
|
|
847
1087
|
* @description PnL timeframe enum for webhook filtering
|
|
848
1088
|
* @enum {string}
|
|
@@ -869,7 +1109,7 @@ export interface components {
|
|
|
869
1109
|
* - volume_milestone: condition_ids, timeframes, milestone_amounts
|
|
870
1110
|
* - close_to_bond: min_probability (high zone threshold), max_probability (low zone threshold), condition_ids, position_ids, outcomes, position_outcome_indices, event_slugs, exclude_shortterm_markets
|
|
871
1111
|
* - market_created: event_slugs, tags, exclude_shortterm_markets
|
|
872
|
-
* - probability_spike: condition_ids, event_slugs, outcomes, min_probability_change_pct, spike_direction, window_secs, exclude_shortterm_markets
|
|
1112
|
+
* - probability_spike: condition_ids, event_slugs, outcomes, min_probability, max_probability, min_probability_change_pct, spike_direction, window_secs, exclude_shortterm_markets
|
|
873
1113
|
* - price_spike: condition_ids, event_slugs, outcomes, min_price_change_pct, spike_direction, window_secs, exclude_shortterm_markets
|
|
874
1114
|
* - trader_new_trade: wallet_addresses, min_usd_value, min_probability, max_probability, condition_ids, event_slugs, trade_types, exclude_shortterm_markets
|
|
875
1115
|
* - trader_trade_event: wallet_addresses, min_usd_value, min_probability, max_probability, condition_ids, event_slugs, trade_types, exclude_shortterm_markets
|
|
@@ -1040,20 +1280,76 @@ export interface components {
|
|
|
1040
1280
|
*/
|
|
1041
1281
|
oracle_event_types?: string[];
|
|
1042
1282
|
};
|
|
1043
|
-
/** @description
|
|
1283
|
+
/** @description Subscription filters for the `position_metrics` event. All fields are optional. */
|
|
1284
|
+
PositionMetricsFilters: {
|
|
1285
|
+
/** @description Restrict to these outcome token IDs. */
|
|
1286
|
+
position_ids?: string[] | null;
|
|
1287
|
+
/** @description Restrict to positions within these markets. */
|
|
1288
|
+
condition_ids?: string[] | null;
|
|
1289
|
+
/** @description Restrict to positions with these outcome names (e.g. \["Yes", "No"\]). */
|
|
1290
|
+
outcomes?: string[] | null;
|
|
1291
|
+
/** @description Restrict to these aggregation windows. */
|
|
1292
|
+
timeframes?: components["schemas"]["MetricFilterTimeframe"][] | null;
|
|
1293
|
+
/**
|
|
1294
|
+
* Format: double
|
|
1295
|
+
* @description Only fire when position volume ≥ this value (USD).
|
|
1296
|
+
*/
|
|
1297
|
+
min_volume_usd?: number | null;
|
|
1298
|
+
/** Format: double */
|
|
1299
|
+
max_volume_usd?: number | null;
|
|
1300
|
+
/** Format: double */
|
|
1301
|
+
min_buy_usd?: number | null;
|
|
1302
|
+
/** Format: double */
|
|
1303
|
+
min_sell_volume_usd?: number | null;
|
|
1304
|
+
/** Format: int64 */
|
|
1305
|
+
min_txns?: number | null;
|
|
1306
|
+
/** Format: int64 */
|
|
1307
|
+
min_unique_traders?: number | null;
|
|
1308
|
+
/**
|
|
1309
|
+
* Format: double
|
|
1310
|
+
* @description Only fire when price change % ≥ this value.
|
|
1311
|
+
*/
|
|
1312
|
+
min_price_change_pct?: number | null;
|
|
1313
|
+
/**
|
|
1314
|
+
* Format: double
|
|
1315
|
+
* @description Only fire when probability change % ≥ this value.
|
|
1316
|
+
*/
|
|
1317
|
+
min_probability_change_pct?: number | null;
|
|
1318
|
+
/** Format: double */
|
|
1319
|
+
min_fees?: number | null;
|
|
1320
|
+
};
|
|
1321
|
+
/** @description Payload delivered when a position's volume or transaction metrics cross a configured threshold */
|
|
1044
1322
|
PositionMetricsPayload: {
|
|
1323
|
+
/** @description ERC-1155 outcome token ID */
|
|
1045
1324
|
position_id?: string | null;
|
|
1325
|
+
/** @description Outcome name (e.g. "Yes", "No") */
|
|
1046
1326
|
outcome?: string | null;
|
|
1047
|
-
/**
|
|
1327
|
+
/**
|
|
1328
|
+
* Format: int32
|
|
1329
|
+
* @description Outcome index
|
|
1330
|
+
*/
|
|
1048
1331
|
outcome_index?: number | null;
|
|
1049
|
-
|
|
1050
|
-
|
|
1332
|
+
/** @description Aggregation window */
|
|
1333
|
+
timeframe?: null | ("1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "6h" | "1d" | "24h" | "7d" | "30d");
|
|
1334
|
+
/**
|
|
1335
|
+
* Format: double
|
|
1336
|
+
* @description Total trading volume in USD
|
|
1337
|
+
*/
|
|
1051
1338
|
volume_usd?: number | null;
|
|
1052
|
-
/**
|
|
1339
|
+
/**
|
|
1340
|
+
* Format: double
|
|
1341
|
+
* @description Buy volume in USD
|
|
1342
|
+
*/
|
|
1053
1343
|
buy_volume_usd?: number | null;
|
|
1054
|
-
/**
|
|
1344
|
+
/**
|
|
1345
|
+
* Format: double
|
|
1346
|
+
* @description Sell volume in USD
|
|
1347
|
+
*/
|
|
1055
1348
|
sell_volume_usd?: number | null;
|
|
1056
|
-
/**
|
|
1349
|
+
/**
|
|
1350
|
+
* Format: double
|
|
1351
|
+
* @description Total fees in USD
|
|
1352
|
+
*/
|
|
1057
1353
|
fees?: number | null;
|
|
1058
1354
|
/** Format: int64 */
|
|
1059
1355
|
txns?: number | null;
|
|
@@ -1080,6 +1376,17 @@ export interface components {
|
|
|
1080
1376
|
/** Format: double */
|
|
1081
1377
|
probability_low?: number | null;
|
|
1082
1378
|
};
|
|
1379
|
+
/** @description Subscription filters for the `position_volume_milestone` event. */
|
|
1380
|
+
PositionVolumeMilestoneFilters: {
|
|
1381
|
+
/** @description **Required.** Aggregation windows to monitor. */
|
|
1382
|
+
timeframes: components["schemas"]["MetricFilterTimeframe"][];
|
|
1383
|
+
/** @description Restrict to these outcome token IDs. */
|
|
1384
|
+
position_ids?: string[] | null;
|
|
1385
|
+
/** @description Restrict to positions within these markets. */
|
|
1386
|
+
condition_ids?: string[] | null;
|
|
1387
|
+
/** @description Specific USD milestones to trigger on. */
|
|
1388
|
+
milestone_amounts?: number[] | null;
|
|
1389
|
+
};
|
|
1083
1390
|
/** @description Position volume milestone webhook payload */
|
|
1084
1391
|
PositionVolumeMilestonePayload: {
|
|
1085
1392
|
condition_id?: string | null;
|
|
@@ -1129,6 +1436,27 @@ export interface components {
|
|
|
1129
1436
|
*/
|
|
1130
1437
|
sells: number;
|
|
1131
1438
|
};
|
|
1439
|
+
/** @description Subscription filters for the `position_volume_spike` event. `spike_ratio` is required. */
|
|
1440
|
+
PositionVolumeSpikeFilters: {
|
|
1441
|
+
/**
|
|
1442
|
+
* Format: double
|
|
1443
|
+
* @description **Required.** Multiplier threshold (must be > 1.0). Fires when current volume >= snapshot × ratio.
|
|
1444
|
+
*/
|
|
1445
|
+
spike_ratio: number;
|
|
1446
|
+
/**
|
|
1447
|
+
* Format: int64
|
|
1448
|
+
* @description Force snapshot reset after this many seconds (max 600 / 10 minutes).
|
|
1449
|
+
*/
|
|
1450
|
+
window_secs?: number | null;
|
|
1451
|
+
/** @description Restrict to these outcome token IDs. */
|
|
1452
|
+
position_ids?: string[] | null;
|
|
1453
|
+
/** @description Restrict to positions within these markets. */
|
|
1454
|
+
condition_ids?: string[] | null;
|
|
1455
|
+
/** @description Restrict to these outcome names. */
|
|
1456
|
+
outcomes?: string[] | null;
|
|
1457
|
+
/** @description Restrict to these aggregation windows. */
|
|
1458
|
+
timeframes?: components["schemas"]["VolumeSpikeFilterTimeframe"][] | null;
|
|
1459
|
+
};
|
|
1132
1460
|
/** @description Position volume spike webhook payload */
|
|
1133
1461
|
PositionVolumeSpikePayload: {
|
|
1134
1462
|
position_id: string;
|
|
@@ -1172,6 +1500,30 @@ export interface components {
|
|
|
1172
1500
|
*/
|
|
1173
1501
|
fees: number;
|
|
1174
1502
|
};
|
|
1503
|
+
/** @description Subscription filters for the `price_spike` event. */
|
|
1504
|
+
PriceSpikeFilters: {
|
|
1505
|
+
/** @description Restrict to specific outcome token IDs. Empty = all positions. */
|
|
1506
|
+
position_ids?: string[] | null;
|
|
1507
|
+
/** @description Restrict to specific market condition IDs. Empty = all markets. */
|
|
1508
|
+
condition_ids?: string[] | null;
|
|
1509
|
+
/** @description Restrict to specific events. Empty = all events. */
|
|
1510
|
+
event_slugs?: string[] | null;
|
|
1511
|
+
/** @description Restrict to these outcome names (e.g. \["Yes", "No"\]). */
|
|
1512
|
+
outcomes?: string[] | null;
|
|
1513
|
+
/**
|
|
1514
|
+
* Format: double
|
|
1515
|
+
* @description Minimum price percentage move to trigger (e.g. `10` for a 10% move).
|
|
1516
|
+
*/
|
|
1517
|
+
min_price_change_pct?: number | null;
|
|
1518
|
+
spike_direction?: null | components["schemas"]["SpikeDirection"];
|
|
1519
|
+
/**
|
|
1520
|
+
* Format: int64
|
|
1521
|
+
* @description Observation window in seconds. The first trade in each window sets the reference price; subsequent trades are compared to it. E.g. `60` detects moves that occur within 60 seconds.
|
|
1522
|
+
*/
|
|
1523
|
+
window_secs?: number | null;
|
|
1524
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
1525
|
+
exclude_shortterm_markets?: boolean | null;
|
|
1526
|
+
};
|
|
1175
1527
|
/** @description Position price spike webhook payload */
|
|
1176
1528
|
PriceSpikePayload: {
|
|
1177
1529
|
position_id: string;
|
|
@@ -1201,6 +1553,30 @@ export interface components {
|
|
|
1201
1553
|
*/
|
|
1202
1554
|
spike_pct: number;
|
|
1203
1555
|
};
|
|
1556
|
+
/** @description Subscription filters for the `probability_spike` event. */
|
|
1557
|
+
ProbabilitySpikeFilters: {
|
|
1558
|
+
/** @description Restrict to specific outcome token IDs. Empty = all positions. */
|
|
1559
|
+
position_ids?: string[] | null;
|
|
1560
|
+
/** @description Restrict to specific market condition IDs. Empty = all markets. */
|
|
1561
|
+
condition_ids?: string[] | null;
|
|
1562
|
+
/** @description Restrict to specific events. Empty = all events. */
|
|
1563
|
+
event_slugs?: string[] | null;
|
|
1564
|
+
/** @description Restrict to these outcome names (e.g. \["Yes", "No"\]). */
|
|
1565
|
+
outcomes?: string[] | null;
|
|
1566
|
+
/**
|
|
1567
|
+
* Format: double
|
|
1568
|
+
* @description Minimum probability percentage move to trigger (e.g. `10` for a 10% move).
|
|
1569
|
+
*/
|
|
1570
|
+
min_probability_change_pct?: number | null;
|
|
1571
|
+
spike_direction?: null | components["schemas"]["SpikeDirection"];
|
|
1572
|
+
/**
|
|
1573
|
+
* Format: int64
|
|
1574
|
+
* @description Observation window in seconds. The first trade in each window sets the reference price; subsequent trades are compared to it. E.g. `60` detects moves that occur within 60 seconds.
|
|
1575
|
+
*/
|
|
1576
|
+
window_secs?: number | null;
|
|
1577
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
1578
|
+
exclude_shortterm_markets?: boolean | null;
|
|
1579
|
+
};
|
|
1204
1580
|
/** @description Position probability spike webhook payload */
|
|
1205
1581
|
ProbabilitySpikePayload: {
|
|
1206
1582
|
position_id: string;
|
|
@@ -1519,6 +1895,287 @@ export interface components {
|
|
|
1519
1895
|
* @enum {string}
|
|
1520
1896
|
*/
|
|
1521
1897
|
SpikeDirection: "up" | "down" | "both";
|
|
1898
|
+
/**
|
|
1899
|
+
* @description Trade-event types accepted by `trader_trade_event.trade_types`. Covers the
|
|
1900
|
+
* full set of typed prediction-trade variants.
|
|
1901
|
+
* @enum {string}
|
|
1902
|
+
*/
|
|
1903
|
+
TradeEventFilterType: "OrderFilled" | "Redemption" | "Merge" | "Split" | "Cancelled" | "PositionsConverted" | "OrdersMatched" | "Initialization" | "Proposal" | "Dispute" | "Settled" | "Resolution" | "ConditionResolution" | "Reset" | "Flag" | "Unflag" | "Pause" | "Unpause" | "ManualResolution" | "NegRiskOutcomeReported" | "RegisterToken" | "Approval";
|
|
1904
|
+
/** @description Subscription filters for the `trader_event_pnl` event. All fields are optional. */
|
|
1905
|
+
TraderEventPnlFilters: {
|
|
1906
|
+
/** @description Track only these trader wallet addresses. */
|
|
1907
|
+
traders?: string[] | null;
|
|
1908
|
+
/** @description Restrict to these events. */
|
|
1909
|
+
event_slugs?: string[] | null;
|
|
1910
|
+
/**
|
|
1911
|
+
* Format: double
|
|
1912
|
+
* @description Only fire when per-event realized PnL ≥ this value (USD).
|
|
1913
|
+
*/
|
|
1914
|
+
min_realized_pnl_usd?: number | null;
|
|
1915
|
+
/**
|
|
1916
|
+
* Format: double
|
|
1917
|
+
* @description Only fire when per-event realized PnL ≤ this value (USD).
|
|
1918
|
+
*/
|
|
1919
|
+
max_realized_pnl_usd?: number | null;
|
|
1920
|
+
/**
|
|
1921
|
+
* Format: double
|
|
1922
|
+
* @description Only fire when total event volume ≥ this value (USD).
|
|
1923
|
+
*/
|
|
1924
|
+
min_volume_usd?: number | null;
|
|
1925
|
+
/**
|
|
1926
|
+
* Format: double
|
|
1927
|
+
* @description Only fire when total event volume ≤ this value (USD).
|
|
1928
|
+
*/
|
|
1929
|
+
max_volume_usd?: number | null;
|
|
1930
|
+
/**
|
|
1931
|
+
* Format: double
|
|
1932
|
+
* @description Only fire when buy volume within the event ≥ this value (USD).
|
|
1933
|
+
*/
|
|
1934
|
+
min_buy_usd?: number | null;
|
|
1935
|
+
/**
|
|
1936
|
+
* Format: double
|
|
1937
|
+
* @description Only fire when sell volume within the event ≥ this value (USD).
|
|
1938
|
+
*/
|
|
1939
|
+
min_sell_volume_usd?: number | null;
|
|
1940
|
+
/**
|
|
1941
|
+
* Format: int64
|
|
1942
|
+
* @description Only fire when the trader has traded in ≥ this many markets within the event.
|
|
1943
|
+
*/
|
|
1944
|
+
min_markets_traded?: number | null;
|
|
1945
|
+
/** @description Restrict to these PnL windows. */
|
|
1946
|
+
timeframes?: components["schemas"]["PnlFilterTimeframe"][] | null;
|
|
1947
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
1948
|
+
exclude_shortterm_markets?: boolean | null;
|
|
1949
|
+
};
|
|
1950
|
+
/** @description Subscription filters for the `trader_first_trade` event. All fields are optional. */
|
|
1951
|
+
TraderFirstTradeFilters: {
|
|
1952
|
+
/** @description Only fire for trades by these wallet addresses (lowercase). Empty = all traders. */
|
|
1953
|
+
wallet_addresses?: string[] | null;
|
|
1954
|
+
/** @description Restrict to trades in these markets. Empty = all markets. */
|
|
1955
|
+
condition_ids?: string[] | null;
|
|
1956
|
+
/** @description Restrict to trades in markets belonging to these events. */
|
|
1957
|
+
event_slugs?: string[] | null;
|
|
1958
|
+
/**
|
|
1959
|
+
* Format: double
|
|
1960
|
+
* @description Minimum trade size in USD. Omit to match all sizes.
|
|
1961
|
+
*/
|
|
1962
|
+
min_usd_value?: number | null;
|
|
1963
|
+
/**
|
|
1964
|
+
* Format: double
|
|
1965
|
+
* @description Only fire when the outcome probability is ≥ this value.
|
|
1966
|
+
*/
|
|
1967
|
+
min_probability?: number | null;
|
|
1968
|
+
/**
|
|
1969
|
+
* Format: double
|
|
1970
|
+
* @description Only fire when the outcome probability is ≤ this value.
|
|
1971
|
+
*/
|
|
1972
|
+
max_probability?: number | null;
|
|
1973
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets (event slugs containing `updown`). Default: `false`. */
|
|
1974
|
+
exclude_shortterm_markets?: boolean | null;
|
|
1975
|
+
};
|
|
1976
|
+
/** @description Subscription filters for the `trader_global_pnl` event. All fields are optional. */
|
|
1977
|
+
TraderGlobalPnlFilters: {
|
|
1978
|
+
/** @description Track only these trader wallet addresses. Empty = all traders. */
|
|
1979
|
+
traders?: string[] | null;
|
|
1980
|
+
/**
|
|
1981
|
+
* Format: double
|
|
1982
|
+
* @description Only fire when realized PnL ≥ this value (USD). Use negative values for loss thresholds.
|
|
1983
|
+
*/
|
|
1984
|
+
min_realized_pnl_usd?: number | null;
|
|
1985
|
+
/**
|
|
1986
|
+
* Format: double
|
|
1987
|
+
* @description Only fire when realized PnL ≤ this value (USD).
|
|
1988
|
+
*/
|
|
1989
|
+
max_realized_pnl_usd?: number | null;
|
|
1990
|
+
/**
|
|
1991
|
+
* Format: double
|
|
1992
|
+
* @description Only fire when total trading volume ≥ this value (USD).
|
|
1993
|
+
*/
|
|
1994
|
+
min_volume_usd?: number | null;
|
|
1995
|
+
/**
|
|
1996
|
+
* Format: double
|
|
1997
|
+
* @description Only fire when total trading volume ≤ this value (USD).
|
|
1998
|
+
*/
|
|
1999
|
+
max_volume_usd?: number | null;
|
|
2000
|
+
/**
|
|
2001
|
+
* Format: double
|
|
2002
|
+
* @description Only fire when buy volume ≥ this value (USD).
|
|
2003
|
+
*/
|
|
2004
|
+
min_buy_usd?: number | null;
|
|
2005
|
+
/**
|
|
2006
|
+
* Format: double
|
|
2007
|
+
* @description Only fire when sell volume ≥ this value (USD).
|
|
2008
|
+
*/
|
|
2009
|
+
min_sell_volume_usd?: number | null;
|
|
2010
|
+
/**
|
|
2011
|
+
* Format: double
|
|
2012
|
+
* @description Only fire when market win rate ≥ this percentage (0.0–100.0).
|
|
2013
|
+
*/
|
|
2014
|
+
min_win_rate?: number | null;
|
|
2015
|
+
/**
|
|
2016
|
+
* Format: int64
|
|
2017
|
+
* @description Only fire when the trader has traded in ≥ this many markets.
|
|
2018
|
+
*/
|
|
2019
|
+
min_markets_traded?: number | null;
|
|
2020
|
+
/** @description Restrict to these PnL windows. Empty = all windows. */
|
|
2021
|
+
timeframes?: components["schemas"]["PnlFilterTimeframe"][] | null;
|
|
2022
|
+
};
|
|
2023
|
+
/** @description Subscription filters for the `trader_market_pnl` event. All fields are optional. */
|
|
2024
|
+
TraderMarketPnlFilters: {
|
|
2025
|
+
/** @description Track only these trader wallet addresses. */
|
|
2026
|
+
traders?: string[] | null;
|
|
2027
|
+
/** @description Restrict to these markets. */
|
|
2028
|
+
condition_ids?: string[] | null;
|
|
2029
|
+
/** @description Restrict to markets in these events. */
|
|
2030
|
+
event_slugs?: string[] | null;
|
|
2031
|
+
/**
|
|
2032
|
+
* Format: double
|
|
2033
|
+
* @description Only fire when per-market realized PnL ≥ this value (USD).
|
|
2034
|
+
*/
|
|
2035
|
+
min_realized_pnl_usd?: number | null;
|
|
2036
|
+
/**
|
|
2037
|
+
* Format: double
|
|
2038
|
+
* @description Only fire when per-market realized PnL ≤ this value (USD).
|
|
2039
|
+
*/
|
|
2040
|
+
max_realized_pnl_usd?: number | null;
|
|
2041
|
+
/**
|
|
2042
|
+
* Format: double
|
|
2043
|
+
* @description Only fire when total volume (buy + sell + redemption + merge) ≥ this value (USD).
|
|
2044
|
+
*/
|
|
2045
|
+
min_volume_usd?: number | null;
|
|
2046
|
+
/**
|
|
2047
|
+
* Format: double
|
|
2048
|
+
* @description Only fire when total volume ≤ this value (USD).
|
|
2049
|
+
*/
|
|
2050
|
+
max_volume_usd?: number | null;
|
|
2051
|
+
/**
|
|
2052
|
+
* Format: double
|
|
2053
|
+
* @description Only fire when buy volume in the market ≥ this value (USD).
|
|
2054
|
+
*/
|
|
2055
|
+
min_buy_usd?: number | null;
|
|
2056
|
+
/**
|
|
2057
|
+
* Format: double
|
|
2058
|
+
* @description Only fire when sell volume in the market ≥ this value (USD).
|
|
2059
|
+
*/
|
|
2060
|
+
min_sell_volume_usd?: number | null;
|
|
2061
|
+
/** @description Restrict to these PnL windows. */
|
|
2062
|
+
timeframes?: components["schemas"]["PnlFilterTimeframe"][] | null;
|
|
2063
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
2064
|
+
exclude_shortterm_markets?: boolean | null;
|
|
2065
|
+
};
|
|
2066
|
+
/** @description Subscription filters for the `trader_new_market` event. All fields are optional. */
|
|
2067
|
+
TraderNewMarketFilters: {
|
|
2068
|
+
/** @description Only fire for these wallet addresses (lowercase). Empty = all traders. */
|
|
2069
|
+
wallet_addresses?: string[] | null;
|
|
2070
|
+
/** @description Restrict to these markets. */
|
|
2071
|
+
condition_ids?: string[] | null;
|
|
2072
|
+
/** @description Restrict to markets belonging to these events. */
|
|
2073
|
+
event_slugs?: string[] | null;
|
|
2074
|
+
/**
|
|
2075
|
+
* Format: double
|
|
2076
|
+
* @description Minimum trade size in USD. Omit to match all sizes.
|
|
2077
|
+
*/
|
|
2078
|
+
min_usd_value?: number | null;
|
|
2079
|
+
/**
|
|
2080
|
+
* Format: double
|
|
2081
|
+
* @description Only fire when the outcome probability is ≥ this value.
|
|
2082
|
+
*/
|
|
2083
|
+
min_probability?: number | null;
|
|
2084
|
+
/**
|
|
2085
|
+
* Format: double
|
|
2086
|
+
* @description Only fire when the outcome probability is ≤ this value.
|
|
2087
|
+
*/
|
|
2088
|
+
max_probability?: number | null;
|
|
2089
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
2090
|
+
exclude_shortterm_markets?: boolean | null;
|
|
2091
|
+
};
|
|
2092
|
+
/** @description Subscription filters for the `trader_new_trade` event. All fields are optional. */
|
|
2093
|
+
TraderNewTradeFilters: {
|
|
2094
|
+
/** @description Only fire for trades by these wallet addresses. Empty = all traders. */
|
|
2095
|
+
wallet_addresses?: string[] | null;
|
|
2096
|
+
/** @description Restrict to these markets. */
|
|
2097
|
+
condition_ids?: string[] | null;
|
|
2098
|
+
/** @description Restrict to markets belonging to these events. */
|
|
2099
|
+
event_slugs?: string[] | null;
|
|
2100
|
+
/**
|
|
2101
|
+
* Format: double
|
|
2102
|
+
* @description Minimum trade size in USD. Defaults to 0 (matches all trades).
|
|
2103
|
+
*/
|
|
2104
|
+
min_usd_value?: number | null;
|
|
2105
|
+
/**
|
|
2106
|
+
* Format: double
|
|
2107
|
+
* @description Only fire when outcome probability is ≥ this value.
|
|
2108
|
+
*/
|
|
2109
|
+
min_probability?: number | null;
|
|
2110
|
+
/**
|
|
2111
|
+
* Format: double
|
|
2112
|
+
* @description Only fire when outcome probability is ≤ this value.
|
|
2113
|
+
*/
|
|
2114
|
+
max_probability?: number | null;
|
|
2115
|
+
/** @description Only fire for these fill-style trade types. Empty = OrderFilled and OrdersMatched only (default). */
|
|
2116
|
+
trade_types?: ("OrderFilled" | "OrdersMatched")[] | null;
|
|
2117
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
2118
|
+
exclude_shortterm_markets?: boolean | null;
|
|
2119
|
+
};
|
|
2120
|
+
/**
|
|
2121
|
+
* @description Subscription filters for the `trader_trade_event` event. All fields are optional.
|
|
2122
|
+
* `event_slugs` and `exclude_shortterm_markets` require explicit `trade_types` that
|
|
2123
|
+
* exclude `PositionsConverted`, because conversion events do not currently carry
|
|
2124
|
+
* `event_slug` in the typed webhook payload.
|
|
2125
|
+
*/
|
|
2126
|
+
TraderTradeEventFilters: {
|
|
2127
|
+
/** @description Only fire for events associated with these wallet addresses. Empty = all traders. */
|
|
2128
|
+
wallet_addresses?: string[] | null;
|
|
2129
|
+
/** @description Restrict to these markets. For `PositionsConverted`, this also matches the NegRisk `market_id`. */
|
|
2130
|
+
condition_ids?: string[] | null;
|
|
2131
|
+
/** @description Restrict to markets belonging to these events. Requires explicit `trade_types` that exclude `PositionsConverted`. */
|
|
2132
|
+
event_slugs?: string[] | null;
|
|
2133
|
+
/**
|
|
2134
|
+
* Format: double
|
|
2135
|
+
* @description Minimum USD amount for the underlying event. Defaults to 0 (matches all events).
|
|
2136
|
+
*/
|
|
2137
|
+
min_usd_value?: number | null;
|
|
2138
|
+
/**
|
|
2139
|
+
* Format: double
|
|
2140
|
+
* @description Only fire when event probability is ≥ this value. Events without probability data do not match.
|
|
2141
|
+
*/
|
|
2142
|
+
min_probability?: number | null;
|
|
2143
|
+
/**
|
|
2144
|
+
* Format: double
|
|
2145
|
+
* @description Only fire when event probability is ≤ this value. Events without probability data do not match.
|
|
2146
|
+
*/
|
|
2147
|
+
max_probability?: number | null;
|
|
2148
|
+
/** @description Only fire for these trade types. Empty = all supported trade-event variants. */
|
|
2149
|
+
trade_types?: ("OrderFilled" | "Redemption" | "Merge" | "Split" | "Cancelled" | "PositionsConverted" | "OrdersMatched" | "Initialization" | "Proposal" | "Dispute" | "Settled" | "Resolution" | "ConditionResolution" | "Reset" | "Flag" | "Unflag" | "Pause" | "Unpause" | "ManualResolution" | "NegRiskOutcomeReported" | "RegisterToken" | "Approval")[] | null;
|
|
2150
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Requires explicit `trade_types` that exclude `PositionsConverted`. Default: `false`. */
|
|
2151
|
+
exclude_shortterm_markets?: boolean | null;
|
|
2152
|
+
};
|
|
2153
|
+
/** @description Subscription filters for the `trader_whale_trade` event. All fields are optional. */
|
|
2154
|
+
TraderWhaleTradeFilters: {
|
|
2155
|
+
/** @description Only fire for trades by these wallet addresses. Empty = all traders. */
|
|
2156
|
+
wallet_addresses?: string[] | null;
|
|
2157
|
+
/** @description Restrict to these markets. */
|
|
2158
|
+
condition_ids?: string[] | null;
|
|
2159
|
+
/** @description Restrict to markets belonging to these events. */
|
|
2160
|
+
event_slugs?: string[] | null;
|
|
2161
|
+
/**
|
|
2162
|
+
* Format: double
|
|
2163
|
+
* @description Minimum trade size in USD. Defaults to 0 (matches all trades).
|
|
2164
|
+
*/
|
|
2165
|
+
min_usd_value?: number | null;
|
|
2166
|
+
/**
|
|
2167
|
+
* Format: double
|
|
2168
|
+
* @description Only fire when outcome probability is ≥ this value.
|
|
2169
|
+
*/
|
|
2170
|
+
min_probability?: number | null;
|
|
2171
|
+
/**
|
|
2172
|
+
* Format: double
|
|
2173
|
+
* @description Only fire when outcome probability is ≤ this value.
|
|
2174
|
+
*/
|
|
2175
|
+
max_probability?: number | null;
|
|
2176
|
+
/** @description When `true`, suppress webhooks for short-term "updown" markets. Default: `false`. */
|
|
2177
|
+
exclude_shortterm_markets?: boolean | null;
|
|
2178
|
+
};
|
|
1522
2179
|
/** @description Request body for updating a webhook */
|
|
1523
2180
|
UpdateWebhookRequestBody: {
|
|
1524
2181
|
/** @description Destination URL for webhook deliveries (must be HTTPS) */
|
|
@@ -1556,6 +2213,12 @@ export interface components {
|
|
|
1556
2213
|
*/
|
|
1557
2214
|
txns: number;
|
|
1558
2215
|
};
|
|
2216
|
+
/**
|
|
2217
|
+
* @description Aggregation windows accepted by `*_volume_spike.timeframes`. Includes `1d`
|
|
2218
|
+
* in addition to the metric set.
|
|
2219
|
+
* @enum {string}
|
|
2220
|
+
*/
|
|
2221
|
+
VolumeSpikeFilterTimeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "1d" | "24h" | "7d" | "30d";
|
|
1559
2222
|
/**
|
|
1560
2223
|
* @description Crypto asset symbols accepted by `asset_price_tick` and `asset_price_window_update` filters.
|
|
1561
2224
|
* @enum {string}
|
|
@@ -1780,30 +2443,30 @@ export interface components {
|
|
|
1780
2443
|
* @enum {string}
|
|
1781
2444
|
*/
|
|
1782
2445
|
WebhookTimeframe: "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "6h" | "1d" | "24h" | "7d" | "30d";
|
|
1783
|
-
/** @description
|
|
2446
|
+
/** @description Payload delivered when a trade exceeds the configured size and probability thresholds */
|
|
1784
2447
|
WhaleTradePayload: {
|
|
1785
|
-
/** @description
|
|
2448
|
+
/** @description Limit-order maker wallet address (lowercase) */
|
|
1786
2449
|
trader: string;
|
|
1787
|
-
/** @description
|
|
2450
|
+
/** @description Order filler wallet address (lowercase) */
|
|
1788
2451
|
taker: string;
|
|
1789
|
-
/** @description
|
|
2452
|
+
/** @description ERC-1155 outcome token ID */
|
|
1790
2453
|
position_id: string;
|
|
1791
|
-
/** @description
|
|
2454
|
+
/** @description Parent market condition ID */
|
|
1792
2455
|
condition_id?: string | null;
|
|
1793
2456
|
/** @description Outcome name (e.g. "Yes", "No") */
|
|
1794
2457
|
outcome?: string | null;
|
|
1795
2458
|
/**
|
|
1796
2459
|
* Format: int32
|
|
1797
|
-
* @description Outcome index
|
|
2460
|
+
* @description Outcome index: 0 = Yes/Up, 1 = No
|
|
1798
2461
|
*/
|
|
1799
2462
|
outcome_index?: number | null;
|
|
1800
|
-
/** @description Market question */
|
|
2463
|
+
/** @description Market question text */
|
|
1801
2464
|
question?: string | null;
|
|
1802
2465
|
/** @description Market slug */
|
|
1803
2466
|
market_slug?: string | null;
|
|
1804
|
-
/** @description
|
|
2467
|
+
/** @description Parent event slug */
|
|
1805
2468
|
event_slug?: string | null;
|
|
1806
|
-
/** @description
|
|
2469
|
+
/** @description Unique trade identifier */
|
|
1807
2470
|
trade_id: string;
|
|
1808
2471
|
/** @description Transaction hash */
|
|
1809
2472
|
hash: string;
|
|
@@ -1814,38 +2477,40 @@ export interface components {
|
|
|
1814
2477
|
block: number;
|
|
1815
2478
|
/**
|
|
1816
2479
|
* Format: int64
|
|
1817
|
-
* @description
|
|
2480
|
+
* @description Block confirmation timestamp (Unix seconds)
|
|
1818
2481
|
*/
|
|
1819
2482
|
confirmed_at: number;
|
|
1820
2483
|
/**
|
|
1821
2484
|
* Format: double
|
|
1822
|
-
* @description USD size of the trade
|
|
2485
|
+
* @description USD size of the trade (6 decimal places)
|
|
1823
2486
|
*/
|
|
1824
2487
|
amount_usd: number;
|
|
1825
2488
|
/**
|
|
1826
2489
|
* Format: double
|
|
1827
|
-
* @description Outcome shares traded
|
|
2490
|
+
* @description Outcome shares traded (6 decimal places)
|
|
1828
2491
|
*/
|
|
1829
2492
|
shares_amount: number;
|
|
1830
2493
|
/**
|
|
1831
2494
|
* Format: double
|
|
1832
|
-
* @description Fee paid (
|
|
2495
|
+
* @description Fee paid in USD (6 decimal places)
|
|
1833
2496
|
*/
|
|
1834
2497
|
fee: number;
|
|
1835
|
-
/** @description Trade
|
|
1836
|
-
side:
|
|
2498
|
+
/** @description Trade direction */
|
|
2499
|
+
side: "Buy" | "Sell";
|
|
1837
2500
|
/**
|
|
1838
2501
|
* Format: double
|
|
1839
|
-
* @description
|
|
2502
|
+
* @description Outcome token price (0.0–1.0)
|
|
1840
2503
|
*/
|
|
1841
2504
|
price: number;
|
|
1842
2505
|
/**
|
|
1843
2506
|
* Format: double
|
|
1844
|
-
* @description Implied probability
|
|
2507
|
+
* @description Implied probability (0.0–1.0); null when outcome is unknown
|
|
1845
2508
|
*/
|
|
1846
2509
|
probability?: number | null;
|
|
1847
|
-
|
|
1848
|
-
|
|
2510
|
+
/** @description Exchange contract that processed the trade */
|
|
2511
|
+
exchange: "CTFExchange" | "NegRiskExchange" | "ConditionalTokens" | "NegRiskAdapter" | "CTFExchangeV2" | "NegRiskExchangeV2" | "Unknown";
|
|
2512
|
+
/** @description Trade type (webhook events only fire on order fills) */
|
|
2513
|
+
trade_type: "OrderFilled" | "OrdersMatched";
|
|
1849
2514
|
};
|
|
1850
2515
|
/** @description Server acknowledgement for an oracle events stream subscription */
|
|
1851
2516
|
OracleEventsStreamSubscribeResponse: {
|