-
-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathapi-doc-config.generated.json
More file actions
1169 lines (1169 loc) · 71.6 KB
/
Copy pathapi-doc-config.generated.json
File metadata and controls
1169 lines (1169 loc) · 71.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"_generated": "Auto-generated by extract-jsdoc.js on 2026-06-23T14:45:30.753Z. Do not edit manually.",
"methods": {
"has": {
"summary": "HTTP verb for the endpoint (e.g. GET, POST). */",
"description": "method: string;\n /** URL path template, relative to the descriptor's baseUrl. */\n path: string;\n /** Whether this endpoint requires authenticated credentials. */\n isPrivate?: boolean;\n /** Identifier used to generate the implicit API method name. */\n operationId?: string;\n /**\nWhen set, requests use this base URL instead of the descriptor default\n(OpenAPI path- or operation-level `servers` override).\n/\n baseUrl?: string;\n}\n\nexport interface ApiDescriptor {\n /** Base URL that all endpoint paths are resolved against. */\n baseUrl: string;\n /** Map of endpoint key to endpoint definition used by the implicit API machinery. */\n endpoints: Record<string, ApiEndpoint>;\n}\n\nexport interface ImplicitApiMethodInfo {\n /** Generated method name exposed on the exchange instance. */\n name: string;\n /** HTTP verb for the underlying endpoint. */\n method: string;\n /** URL path template for the underlying endpoint. */\n path: string;\n /** Whether the underlying endpoint requires authenticated credentials. */\n isPrivate: boolean;\n}\n\nexport interface MarketFilterParams {\n /** Maximum number of results to return */\n limit?: number;\n /** Pagination offset — number of results to skip */\n offset?: number;\n /** Sort order for results */\n sort?: 'volume' | 'liquidity' | 'newest';\n status?: 'active' | 'inactive' | 'closed' | 'all'; // Filter by market status (default: 'active', 'inactive' and 'closed' are interchangeable)\n searchIn?: 'title' | 'description' | 'both'; // Where to search (default: 'title')\n query?: string; // For keyword search\n slug?: string; // For slug/ticker lookup\n marketId?: string; // Direct lookup by market ID\n outcomeId?: string; // Reverse lookup -- find market containing this outcome\n eventId?: string; // Find markets belonging to an event\n page?: number; // For pagination (used by Limitless)\n similarityThreshold?: number; // For semantic search (used by Limitless)\n /** Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias. */\n sourceExchange?: string;\n /** Alias for `sourceExchange`. */\n exchange?: string;\n}\n\nexport interface MarketFetchParams extends MarketFilterParams {\n /** Optional client-side filter applied after fetching */\n filter?: MarketFilterCriteria;\n /** Filter by category. Each market belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). */\n category?: string;\n /** Filter by tags. Returns markets matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Sports\" market might carry tags [\"Sports\", \"FIFA World Cup\", \"2026 FIFA World Cup\"]. Common tags include \"Crypto\", \"Politics\", \"Elections\", \"Geopolitics\", \"Fed Rates\", \"Trump\". */\n tags?: string[];\n}\n\nexport interface EventFetchParams {\n query?: string; // For keyword search\n /** Maximum number of results to return */\n limit?: number;\n /** Opaque venue pagination cursor, where supported. */\n cursor?: string;\n /** Pagination offset — number of results to skip */\n offset?: number;\n /** Sort order for results */\n sort?: 'volume' | 'liquidity' | 'newest';\n status?: 'active' | 'inactive' | 'closed' | 'all'; // Filter by event status (default: 'active', 'inactive' and 'closed' are interchangeable)\n /** Where to search (default: 'title') */\n searchIn?: 'title' | 'description' | 'both';\n eventId?: string; // Direct lookup by event ID\n slug?: string; // Lookup by event slug\n /** Filter events by their parent series. Accepts the venue-native series id / ticker / slug (e.g. Kalshi `\"KXATPMATCH\"`, Polymarket `\"wta\"`). Passed through to the vendor where supported, otherwise applied to `sourceMetadata` after fetch. */\n series?: string;\n /** Optional client-side filter applied after fetching */\n filter?: EventFilterCriteria;\n /** Filter by category. Each event belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). */\n category?: string;\n /** Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Politics\" event might carry tags [\"Politics\", \"Geopolitics\", \"Middle East\", \"Iran\"]. Common tags include \"Crypto\", \"Elections\", \"Fed Rates\", \"FIFA World Cup\", \"Trump\". */\n tags?: string[];\n /** Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias. */\n sourceExchange?: string;\n /** Alias for `sourceExchange`. */\n exchange?: string;\n}\n\n/**\nParameters for `fetchSeries`. Venues that don't expose a series concept\nreturn an empty array regardless of the filters.\n/\nexport interface SeriesFetchParams {\n /** Direct lookup by venue-native series id (e.g. \"KXATPMATCH\" on Kalshi, \"atp\" or \"1\" on Polymarket Gamma). When set, the result is the matching series with its events populated where the venue supports it. */\n id?: string;\n /** Lookup by series slug (e.g. \"wta\", \"nfl\"). */\n slug?: string;\n /** Keyword search across series title / description. */\n query?: string;\n /** Filter by recurrence cadence ('daily', 'weekly', 'annual', ...). */\n recurrence?: string;\n /** Maximum number of results to return. */\n limit?: number;\n /** Pagination offset. */\n offset?: number;\n}\n\n/**\nDeprecated - use OHLCVParams or TradesParams instead. Resolution is optional for backward compatibility.\n/\nexport interface HistoryFilterParams {\n resolution?: CandleInterval; // Optional for backward compatibility\n /** Start of the time range */\n start?: Date;\n /** End of the time range */\n end?: Date;\n /** Maximum number of results to return */\n limit?: number;\n}\n\nexport interface OHLCVParams {\n resolution: CandleInterval; // Required for candle aggregation\n /** Start of the time range */\n start?: Date;\n /** End of the time range */\n end?: Date;\n /** Maximum number of results to return */\n limit?: number;\n}\n\n/**\nParameters for fetching trade history. No resolution parameter - trades are discrete events.\n/\n/** Maximum allowed value for `TradesParams.limit`. */\nexport const MAX_TRADES_LIMIT = 1000;\n\nexport interface TradesParams {\n // No resolution - trades are discrete events, not aggregated\n /** Start of the time range */\n start?: Date;\n /** End of the time range */\n end?: Date;\n /** Maximum number of results to return (max {@link MAX_TRADES_LIMIT}) */\n limit?: number;\n}\n\nexport interface MyTradesParams {\n outcomeId?: string; // filter to specific outcome/ticker\n marketId?: string; // filter to specific market\n /** Only return records after this date */\n since?: Date;\n /** Only return records before this date */\n until?: Date;\n /** Maximum number of results to return */\n limit?: number;\n cursor?: string; // for Kalshi cursor pagination\n}\n\nexport interface FetchOrderBookParams {\n /** Outcome side: 'yes' or 'no'. Required for exchanges like Limitless\n where the API returns a single orderbook per market. */\n side?: 'yes' | 'no';\n /** Outcome alias: 'yes' or 'no', or an outcome token ID. When set,\n the first argument is treated as a market ID and this value selects\n which outcome's order book to fetch. Accepts the literal strings\n 'yes'/'no' (resolved via a market lookup) or a raw outcome token ID. */\n outcome?: string;\n /** Unix timestamp (ms) — fetch a historical snapshot at or before this\n time, or the start of a range when combined with `until` (hosted API only). */\n since?: number;\n /** Unix timestamp (ms) — end of a historical range. When combined with\n `since`, returns an array of reconstructed L2 OrderBook snapshots\n between `since` and `until` (hosted API only). */\n until?: number;\n}\n\nexport interface OrderHistoryParams {\n marketId?: string; // required for Limitless (slug)\n /** Only return records after this date */\n since?: Date;\n /** Only return records before this date */\n until?: Date;\n /** Maximum number of results to return */\n limit?: number;\n /** Opaque pagination cursor from a previous response */\n cursor?: string;\n}\n\n// ----------------------------------------------------------------------------\n// Filtering Types\n// ----------------------------------------------------------------------------\n\nexport interface MarketFilterCriteria {\n // Text search\n text?: string;\n searchIn?: ('title' | 'description' | 'category' | 'tags' | 'outcomes')[]; // Default: ['title']\n\n // Numeric range filters\n volume24h?: { min?: number; max?: number };\n /** Filter by total (lifetime) volume range */\n volume?: { min?: number; max?: number };\n /** Filter by current liquidity range */\n liquidity?: { min?: number; max?: number };\n /** Filter by open interest range */\n openInterest?: { min?: number; max?: number };\n\n // Date filters\n resolutionDate?: {\n before?: Date;\n after?: Date;\n };\n\n // Category/tag filters\n /** Filter by category. Common values: \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). */\n category?: string;\n /** Match markets that have ANY of these tags. Examples: [\"Crypto\", \"Crypto Prices\"], [\"Politics\", \"Elections\"], [\"Sports\", \"FIFA World Cup\"]. */\n tags?: string[];\n\n // Price filters (for binary markets)\n price?: {\n outcome: 'yes' | 'no' | 'up' | 'down';\n min?: number; // 0.0 to 1.0\n max?: number;\n };\n\n // Price change filters\n priceChange24h?: {\n outcome: 'yes' | 'no' | 'up' | 'down';\n min?: number; // e.g., -0.1 for 10% drop\n max?: number;\n };\n}\n\nexport type MarketFilterFunction = (market: UnifiedMarket) => boolean;\n\nexport interface EventFilterCriteria {\n // Text search\n text?: string;\n searchIn?: ('title' | 'description' | 'category' | 'tags')[]; // Default: ['title']\n\n // Category/tag filters\n /** Filter by category. Common values: \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). */\n category?: string;\n /** Match events that have ANY of these tags. Examples: [\"Crypto\"], [\"Politics\", \"Geopolitics\", \"Middle East\"], [\"Sports\", \"FIFA World Cup\"]. */\n tags?: string[];\n\n // Filter by contained markets\n marketCount?: { min?: number; max?: number };\n totalVolume?: { min?: number; max?: number }; // Sum of market volumes\n}\n\nexport type EventFilterFunction = (event: UnifiedEvent) => boolean;\n\n// ----------------------------------------------------------------------------\n// Capability Map (ccxt-style exchange.has)\n// ----------------------------------------------------------------------------\n\nexport type ExchangeCapability = true | false | 'emulated';\n\nexport interface ExchangeHas {\n /** Whether this exchange supports fetching markets. */\n fetchMarkets: ExchangeCapability;\n /** Whether this exchange supports fetching events. */\n fetchEvents: ExchangeCapability;\n /** Whether this exchange exposes a recurring-series concept (Series -> Event -> Market -> Outcome). Venues without one return `false` and an empty array from `fetchSeries`. */\n fetchSeries: ExchangeCapability;\n /** Whether this exchange supports fetching OHLCV candles. */\n fetchOHLCV: ExchangeCapability;\n /** Whether this exchange supports fetching the order book. */\n fetchOrderBook: ExchangeCapability;\n /** Whether this exchange supports fetching multiple market order books. */\n fetchOrderBooks: ExchangeCapability;\n /** Whether this exchange supports fetching public trades. */\n fetchTrades: ExchangeCapability;\n /** Whether this exchange supports creating orders. */\n createOrder: ExchangeCapability;\n /** Whether this exchange supports cancelling orders. */\n cancelOrder: ExchangeCapability;\n /** Whether this exchange supports fetching a single order by id. */\n fetchOrder: ExchangeCapability;\n /** Whether this exchange supports fetching open orders. */\n fetchOpenOrders: ExchangeCapability;\n /** Whether this exchange supports fetching account positions. */\n fetchPositions: ExchangeCapability;\n /** Whether this exchange supports fetching account balances. */\n fetchBalance: ExchangeCapability;\n /** Whether this exchange supports subscribing to an on-chain address for updates. */\n watchAddress: ExchangeCapability;\n /** Whether this exchange supports unsubscribing from a watched address. */\n unwatchAddress: ExchangeCapability;\n /** Whether this exchange supports streaming order book updates. */\n watchOrderBook: ExchangeCapability;\n /** Whether this exchange supports batch-subscribing to multiple order book streams. */\n watchOrderBooks: ExchangeCapability;\n /** Whether this exchange supports unsubscribing from an order book stream. */\n unwatchOrderBook: ExchangeCapability;\n /** Whether this exchange supports streaming trade updates. */\n watchTrades: ExchangeCapability;\n /** Whether this exchange supports fetching the authenticated user's trade history. */\n fetchMyTrades: ExchangeCapability;\n /** Whether this exchange supports fetching closed orders. */\n fetchClosedOrders: ExchangeCapability;\n /** Whether this exchange supports fetching all orders (open and closed). */\n fetchAllOrders: ExchangeCapability;\n /** Whether this exchange supports building a signed order without submitting it. */\n buildOrder: ExchangeCapability;\n /** Whether this exchange supports submitting a pre-built order. */\n submitOrder: ExchangeCapability;\n /** Whether this exchange supports fetching cross-venue market matches. */\n fetchMarketMatches: ExchangeCapability;\n /** @deprecated Use {@link fetchMarketMatches} instead. */\n fetchMatches: ExchangeCapability;\n /** Whether this exchange supports fetching cross-venue event matches. */\n fetchEventMatches: ExchangeCapability;\n /** Whether this exchange supports comparing prices across venues. */\n compareMarketPrices: ExchangeCapability;\n /** Whether this exchange supports finding related markets across venues. */\n fetchRelatedMarkets: ExchangeCapability;\n /** Whether this exchange supports fetching matched markets across venues. */\n fetchMatchedMarkets: ExchangeCapability;\n /** @deprecated Use {@link fetchMatchedMarkets} instead. */\n fetchMatchedPrices: ExchangeCapability;\n /** @deprecated Use {@link fetchRelatedMarkets} instead. */\n fetchHedges: ExchangeCapability;\n /** @deprecated Use {@link fetchMatchedMarkets} instead. */\n fetchArbitrage: ExchangeCapability;\n}\n\n/**\nOptional authentication credentials for exchange operations.\n/\nexport interface ExchangeCredentials {\n // Standard API authentication (Kalshi, etc.)\n apiKey?: string;\n /** Standard API secret for HMAC-authenticated exchanges */\n apiSecret?: string;\n /** Standard API passphrase for HMAC-authenticated exchanges */\n passphrase?: string;\n /** Metaculus: `Authorization: Token <apiToken>` for higher rate limits */\n apiToken?: string;\n\n // Blockchain-based authentication (Polymarket)\n privateKey?: string; // Required for Polymarket L1 auth\n\n // Polymarket-specific L2 fields\n signatureType?: number | string; // 0 = EOA, 1 = Poly Proxy, 2 = Gnosis Safe (Can also use 'eoa', 'polyproxy', 'gnosis_safe')\n funderAddress?: string; // The address funding the trades (defaults to signer address)\n\n // Limitless: wallet address for delegated signing profile lookup\n walletAddress?: string;\n\n // Optional base URL override for venue API (e.g., proxy for geo-restricted venues)\n baseUrl?: string;\n}\n\nexport interface ExchangeOptions {\n /**\nHow long (ms) a market snapshot created by `fetchMarketsPaginated` remains valid\nbefore being discarded and re-fetched from the API on the next call.\nDefaults to 0 (no TTL — the snapshot is re-fetched on every initial call).\n/\n snapshotTTL?: number;\n}\n\n/** Shape returned by fetchMarketsPaginated */\nexport interface PaginatedMarketsResult {\n /** The page of unified markets */\n data: UnifiedMarket[];\n /** Total number of markets in the snapshot */\n total: number;\n /** Cursor to pass to the next call, or undefined if this is the last page */\n nextCursor?: string;\n}\n\n/** Shape returned by fetchEventsPaginated */\nexport interface PaginatedEventsResult {\n /** The page of unified events */\n data: UnifiedEvent[];\n /** Total number of events in the snapshot */\n total: number;\n /** Cursor to pass to the next call, or undefined if this is the last page */\n nextCursor?: string;\n}\n\n// ----------------------------------------------------------------------------\n// Base Exchange Class\n// ----------------------------------------------------------------------------\n\nexport abstract class PredictionMarketExchange {\n [key: string]: any; // Allow dynamic method assignment for implicit API\n\n public verbose: boolean = false;\n public http: AxiosInstance;\n public enableRateLimit: boolean = true;\n // Market Cache\n public markets: Record<string, UnifiedMarket> = {};\n public marketsBySlug: Record<string, UnifiedMarket> = {};\n public loadedMarkets: boolean = false;\n /**\nCapability map derived automatically from method overrides at runtime.\nExchanges do NOT need to declare this manually -- if a subclass overrides\na method (and the override does not throw \"not supported\"), it is `true`.\nTo mark a capability as `'emulated'`, add its key to `emulatedCapabilities`.",
"params": [],
"returns": {
"type": "ExchangeHas",
"description": "Result"
},
"source": "BaseExchange.ts:42"
},
"implicitApi": {
"summary": "Override in subclasses to force specific capability values.",
"description": "Use `'emulated'` for methods backed by a non-native mechanism,\nor `false` for methods that override the base only to throw a\nbetter error message (e.g. \"pari-mutuel bets cannot be cancelled\").\n/\n protected readonly capabilityOverrides: Partial<Record<keyof ExchangeHas, ExchangeCapability>> = {};\n\n protected credentials?: ExchangeCredentials;\n // Implicit API (merged across multiple defineImplicitApi calls)\n protected apiDescriptor?: ApiDescriptor;\n private _throttler: Throttler;\n // Snapshot state for cursor-based pagination\n private _snapshotTTL: number;\n private _snapshot?: { markets: UnifiedMarket[]; takenAt: number; id: string };\n private _eventSnapshot?: { events: UnifiedEvent[]; takenAt: number; id: string };\n private apiDescriptors: ApiDescriptor[] = [];\n\n constructor(credentials?: ExchangeCredentials, options?: ExchangeOptions) {\n this.credentials = credentials;\n this._snapshotTTL = options?.snapshotTTL ?? 0;\n this.http = axios.create({\n headers: {\n 'User-Agent': `pmxt (https://github.com/pmxt-dev/pmxt)`\n },\n paramsSerializer: {\n serialize: (params) => {\n const sp = new URLSearchParams();\n for (const [k, v] of Object.entries(params)) {\n if (v === undefined || v === null) continue;\n if (Array.isArray(v)) v.forEach((x) => sp.append(k, String(x)));\n else sp.append(k, String(v));\n }\n return sp.toString();\n },\n },\n });\n this._throttler = new Throttler({\n refillRate: 1 / this._rateLimit,\n capacity: 1,\n delay: 1,\n });\n\n // Rate Limit Interceptor\n this.http.interceptors.request.use(async (config: InternalAxiosRequestConfig) => {\n if (this.enableRateLimit) {\n await this._throttler.throttle();\n }\n return config;\n });\n\n // Request Interceptor\n this.http.interceptors.request.use((config: InternalAxiosRequestConfig) => {\n if (this.verbose) {\n logger.debug(`-> ${config.method?.toUpperCase()} ${config.url}`);\n if (config.params) logger.debug('params:', { params: config.params });\n if (config.data) logger.debug('body:', { body: config.data });\n }\n return config;\n });\n\n // Response Interceptor\n this.http.interceptors.response.use(\n (response: AxiosResponse) => {\n if (this.verbose) {\n logger.debug(`<- ${response.status} ${response.statusText} ${response.config.url}`);\n }\n return response;\n },\n (error: any) => {\n if (this.verbose) {\n logger.debug(`REQUEST FAILED: ${error.config?.url}`, {\n error: error.message,\n status: error.response?.status,\n data: error.response?.data,\n });\n }\n return Promise.reject(error);\n }\n );\n }\n\n private _rateLimit: number = 1000;\n\n get rateLimit(): number {\n return this._rateLimit;\n }\n\n set rateLimit(value: number) {\n this._rateLimit = value;\n this._throttler = new Throttler({\n refillRate: 1 / value,\n capacity: 1,\n delay: 1,\n });\n }\n\n abstract get name(): string;\n\n /**\nIntrospection getter: returns info about all implicit API methods.",
"params": [],
"returns": {
"type": "ImplicitApiMethodInfo[]",
"description": "Result"
},
"source": "BaseExchange.ts:459"
},
"loadMarkets": {
"summary": "Load and cache all markets from the exchange into `this.markets` and `this.marketsBySlug`.",
"description": "Subsequent calls return the cached result without hitting the API again.\n\nThis is the correct way to paginate or iterate over markets without drift.\nBecause `fetchMarkets()` always hits the API, repeated calls with different `offset`\nvalues may return inconsistent results if the exchange reorders or adds markets between\nrequests. Use `loadMarkets()` once to get a stable snapshot, then paginate over\n`Object.values(exchange.markets)` locally.",
"params": [
{
"name": "reload",
"type": "boolean",
"optional": false,
"description": "Force a fresh fetch from the API even if markets are already loaded"
}
],
"returns": {
"type": "Record<string, UnifiedMarket>",
"description": "Dictionary of markets indexed by marketId"
},
"source": "BaseExchange.ts:572"
},
"fetchMarkets": {
"summary": "Fetch markets with optional filtering, search, or slug lookup.",
"description": "Always hits the exchange API — results reflect the live state at the time of the call.",
"params": [
{
"name": "params",
"type": "MarketFetchParams",
"optional": true,
"description": "Optional parameters for filtering and search"
}
],
"subParams": [
{
"name": "params.query",
"description": "Search keyword to filter markets"
},
{
"name": "params.slug",
"description": "Market slug/ticker for direct lookup"
},
{
"name": "params.limit",
"description": "Maximum number of results"
},
{
"name": "params.offset",
"description": "Pagination offset"
},
{
"name": "params.sort",
"description": "Sort order ('volume' | 'liquidity' | 'newest')"
},
{
"name": "params.searchIn",
"description": "Where to search ('title' | 'description' | 'both')"
}
],
"returns": {
"type": "UnifiedMarket[]",
"description": "Array of unified markets"
},
"notes": [
"ordering — exchanges may reorder or add markets between requests. For stable iteration\nacross pages, use `loadMarkets()` and paginate over `Object.values(exchange.markets)`.",
"Some exchanges (like Limitless) may only support status 'active' for search results."
],
"source": "BaseExchange.ts:609"
},
"fetchMarketsPaginated": {
"summary": "Fetch markets with cursor-based pagination backed by a stable in-memory snapshot.",
"description": "On the first call (or when no cursor is supplied), fetches all markets once and\ncaches them. Subsequent calls with a cursor returned from a previous call slice\ndirectly from the cached snapshot — no additional API calls are made.\n\nThe snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions`\nin the constructor). A request using a cursor from an expired snapshot throws\n`'Cursor has expired'`.",
"params": [
{
"name": "params",
"type": "{ limit?: number; cursor?: string; filter?: MarketFilterCriteria }",
"optional": true,
"description": "params"
}
],
"subParams": [
{
"name": "params.limit",
"description": "Page size (default: return all markets)"
},
{
"name": "params.cursor",
"description": "Opaque cursor returned by a previous call"
}
],
"returns": {
"type": "PaginatedMarketsResult",
"description": "PaginatedMarketsResult with data, total, and optional nextCursor"
},
"source": "BaseExchange.ts:664"
},
"fetchEventsPaginated": {
"summary": "Paginated variant of {@link fetchEvents}.",
"description": "On the first call (no `cursor`), all events are fetched from the exchange\nand cached in an in-memory snapshot. A cursor is returned along with the\nfirst page. Subsequent calls with that cursor serve additional pages\ndirectly from the cached snapshot -- no additional API calls are made.\n\nThe snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions`\nin the constructor). A request using a cursor from an expired snapshot throws\n`'Cursor has expired'`.",
"params": [
{
"name": "params",
"type": "{ limit?: number; cursor?: string; filter?: EventFilterCriteria }",
"optional": true,
"description": "params"
}
],
"subParams": [
{
"name": "params.limit",
"description": "Page size (default: return all events)"
},
{
"name": "params.cursor",
"description": "Opaque cursor returned by a previous call"
}
],
"returns": {
"type": "PaginatedEventsResult",
"description": "PaginatedEventsResult with data, total, and optional nextCursor"
},
"source": "BaseExchange.ts:733"
},
"fetchEvents": {
"summary": "Fetch events with optional keyword search.",
"description": "Events group related markets together (e.g., \"Who will be Fed Chair?\" contains multiple candidate markets).",
"params": [
{
"name": "params",
"type": "EventFetchParams",
"optional": true,
"description": "Optional parameters for search and filtering"
}
],
"subParams": [
{
"name": "params.query",
"description": "Search keyword to filter events. If omitted, returns top events by volume."
},
{
"name": "params.limit",
"description": "Maximum number of results"
},
{
"name": "params.offset",
"description": "Pagination offset"
},
{
"name": "params.searchIn",
"description": "Where to search ('title' | 'description' | 'both')"
}
],
"returns": {
"type": "UnifiedEvent[]",
"description": "Array of unified events"
},
"notes": [
"Some exchanges (like Limitless) may only support status 'active' for search results."
],
"source": "BaseExchange.ts:802"
},
"fetchSeries": {
"summary": "Fetch the recurring series (fourth tier above Event -> Market -> Outcome)",
"description": "that this venue exposes. Returns an empty array on venues without a\nseries concept (Limitless, Smarkets, Probable, Metaculus, Baozi,\nHyperliquid, SuiBets, Polymarket US).\n\n- `params.id` -> a single matching series with its events populated where supported.\n- no params -> the full list, typically without nested events for payload size.",
"params": [
{
"name": "params",
"type": "SeriesFetchParams",
"optional": true,
"description": "params"
}
],
"returns": {
"type": "UnifiedSeries[]",
"description": "Array of unified series. Always an array, including the singular-lookup case."
},
"source": "BaseExchange.ts:841"
},
"fetchMarket": {
"summary": "Fetch a single market by lookup parameters.",
"description": "Convenience wrapper around fetchMarkets() that returns a single result or throws MarketNotFound.",
"params": [
{
"name": "params",
"type": "MarketFetchParams",
"optional": true,
"description": "Lookup parameters (marketId, outcomeId, slug, etc.)"
}
],
"returns": {
"type": "UnifiedMarket",
"description": "A single unified market"
},
"source": "BaseExchange.ts:859"
},
"fetchEvent": {
"summary": "Fetch a single event by lookup parameters.",
"description": "Convenience wrapper around fetchEvents() that returns a single result or throws EventNotFound.",
"params": [
{
"name": "params",
"type": "EventFetchParams",
"optional": true,
"description": "Lookup parameters (eventId, slug, query)"
}
],
"returns": {
"type": "UnifiedEvent",
"description": "A single unified event"
},
"source": "BaseExchange.ts:959"
},
"fetchOHLCV": {
"summary": "Fetch historical OHLCV (candlestick) price data for a specific market outcome.",
"description": "Fetch historical OHLCV (candlestick) price data for a specific market outcome.",
"params": [
{
"name": "outcomeId",
"type": "string",
"optional": false,
"description": "The Outcome ID (outcomeId). Use outcome.outcomeId, NOT market.marketId"
},
{
"name": "params",
"type": "OHLCVParams",
"optional": false,
"description": "OHLCV parameters including resolution (required)"
}
],
"returns": {
"type": "PriceCandle[]",
"description": "Array of price candles"
},
"notes": [
"**CRITICAL**: Use `outcome.outcomeId` (TS) / `outcome.outcome_id` (Python), not the market ID.",
"Polymarket: outcomeId is the CLOB Token ID. Kalshi: outcomeId is the Market Ticker.",
"Common resolutions: '1m' | '5m' | '15m' | '1h' | '6h' | '1d'. Arbitrary intervals (e.g. '30s', '120s', '3h') accepted by venues that support them."
],
"source": "BaseExchange.ts:976"
},
"fetchOrderBook": {
"summary": "Fetch the order book (bids/asks) for a specific outcome.",
"description": "Supports live and historical queries. For historical data, pass `since`\nto get a single snapshot, or `since` + `until` to get an array of fully\nreconstructed L2 books from the archive. Range queries return up to\n`limit` snapshots (default 100, max 1000).",
"params": [
{
"name": "outcomeId",
"type": "string",
"optional": false,
"description": "The Outcome ID (outcomeId) or market slug"
},
{
"name": "limit",
"type": "number",
"optional": true,
"description": "Max number of bid/ask levels to return. For range"
},
{
"name": "params",
"type": "FetchOrderBookParams",
"optional": true,
"description": "Optional parameters:"
}
],
"returns": {
"type": "OrderBook",
"description": "Order book with bids and asks. Returns OrderBook[] when"
},
"source": "BaseExchange.ts:991"
},
"fetchOrderBooks": {
"summary": "Batch variant of {@link fetchOrderBook}. Fetches order books for",
"description": "multiple outcomes in a single request where the exchange supports it.",
"params": [
{
"name": "outcomeIds",
"type": "string[]",
"optional": false,
"description": "List of Outcome IDs (outcomeId). Each id must be in the"
}
],
"returns": {
"type": "Record<string, OrderBook>",
"description": "A map keyed by the input id (preserving the caller's exact"
},
"source": "BaseExchange.ts:1019"
},
"fetchTrades": {
"summary": "Fetch raw trade history for a specific outcome.",
"description": "Fetch raw trade history for a specific outcome.",
"params": [
{
"name": "outcomeId",
"type": "string",
"optional": false,
"description": "The Outcome ID (outcomeId)"
},
{
"name": "params",
"type": "TradesParams | HistoryFilterParams",
"optional": false,
"description": "Trade filter parameters"
}
],
"returns": {
"type": "Trade[]",
"description": "Array of recent trades"
},
"notes": [
"Polymarket requires an API key for trade history. Use fetchOHLCV for public historical data."
],
"source": "BaseExchange.ts:1032"
},
"createOrder": {
"summary": "Place a new order on the exchange.",
"description": "Place a new order on the exchange.",
"params": [
{
"name": "params",
"type": "CreateOrderParams",
"optional": false,
"description": "Order parameters"
}
],
"returns": {
"type": "Order",
"description": "The created order"
},
"source": "BaseExchange.ts:1049"
},
"buildOrder": {
"summary": "Build an order payload without submitting it to the exchange.",
"description": "Returns the exchange-native signed order or request body for inspection,\nforwarding through a middleware layer, or deferred submission via submitOrder().",
"params": [
{
"name": "params",
"type": "CreateOrderParams",
"optional": false,
"description": "Order parameters (same as createOrder)"
}
],
"returns": {
"type": "BuiltOrder",
"description": "A BuiltOrder containing the exchange-native payload"
},
"source": "BaseExchange.ts:1063"
},
"submitOrder": {
"summary": "Submit a pre-built order returned by buildOrder().",
"description": "Submit a pre-built order returned by buildOrder().",
"params": [
{
"name": "built",
"type": "BuiltOrder",
"optional": false,
"description": "A BuiltOrder from buildOrder()"
}
],
"returns": {
"type": "Order",
"description": "The submitted order"
},
"source": "BaseExchange.ts:1075"
},
"cancelOrder": {
"summary": "Cancel an existing open order.",
"description": "Cancel an existing open order.",
"params": [
{
"name": "orderId",
"type": "string",
"optional": false,
"description": "The order ID to cancel"
}
],
"returns": {
"type": "Order",
"description": "The cancelled order"
},
"source": "BaseExchange.ts:1085"
},
"fetchOrder": {
"summary": "Fetch a specific order by ID.",
"description": "Fetch a specific order by ID.",
"params": [
{
"name": "orderId",
"type": "string",
"optional": false,
"description": "The order ID to look up"
}
],
"returns": {
"type": "Order",
"description": "The order details"
},
"source": "BaseExchange.ts:1095"
},
"fetchOpenOrders": {
"summary": "Fetch all open orders, optionally filtered by market.",
"description": "Fetch all open orders, optionally filtered by market.",
"params": [
{
"name": "marketId",
"type": "string",
"optional": true,
"description": "Optional market ID to filter by"
}
],
"returns": {
"type": "Order[]",
"description": "Array of open orders"
},
"source": "BaseExchange.ts:1105"
},
"fetchMyTrades": {
"summary": "Fetch authenticated user trade history.",
"description": "Fetch authenticated user trade history.",
"params": [
{
"name": "params",
"type": "MyTradesParams",
"optional": true,
"description": "Optional trade history filters"
}
],
"subParams": [
{
"name": "params.outcomeId",
"description": "Filter by outcome token ID"
},
{
"name": "params.marketId",
"description": "Filter by market ID or ticker"
},
{
"name": "params.since",
"description": "Start timestamp or ISO date"
},
{
"name": "params.until",
"description": "End timestamp or ISO date"
},
{
"name": "params.limit",
"description": "Maximum number of trades"
},
{
"name": "params.cursor",
"description": "Pagination cursor"
}
],
"returns": {
"type": "UserTrade[]",
"description": "Array of user trades"
},
"source": "BaseExchange.ts:1115"
},
"fetchClosedOrders": {
"summary": "Fetch authenticated closed orders.",
"description": "Fetch authenticated closed orders.",
"params": [
{
"name": "params",
"type": "OrderHistoryParams",
"optional": true,
"description": "Optional order history filters"
}
],
"subParams": [
{
"name": "params.marketId",
"description": "Filter by market ID or ticker"
},
{
"name": "params.since",
"description": "Start timestamp or ISO date"
},
{
"name": "params.until",
"description": "End timestamp or ISO date"
},
{
"name": "params.limit",
"description": "Maximum number of orders"
},
{
"name": "params.cursor",
"description": "Pagination cursor"
}
],
"returns": {
"type": "Order[]",
"description": "Array of closed orders"
},
"source": "BaseExchange.ts:1131"
},
"fetchAllOrders": {
"summary": "Fetch authenticated order history across open and closed orders.",
"description": "Fetch authenticated order history across open and closed orders.",
"params": [
{
"name": "params",
"type": "OrderHistoryParams",
"optional": true,
"description": "Optional order history filters"
}
],
"subParams": [
{
"name": "params.marketId",
"description": "Filter by market ID or ticker"
},
{
"name": "params.since",
"description": "Start timestamp or ISO date"
},
{
"name": "params.until",
"description": "End timestamp or ISO date"
},
{
"name": "params.limit",
"description": "Maximum number of orders"
},
{
"name": "params.cursor",
"description": "Pagination cursor"
}
],
"returns": {
"type": "Order[]",
"description": "Array of orders"
},
"source": "BaseExchange.ts:1146"
},
"fetchPositions": {
"summary": "Fetch current user positions across all markets.",
"description": "Fetch current user positions across all markets.",
"params": [
{
"name": "address",
"type": "string",
"optional": true,
"description": "Optional public wallet address"
}
],
"returns": {
"type": "Position[]",
"description": "Array of user positions"
},
"source": "BaseExchange.ts:1161"
},
"fetchBalance": {
"summary": "Fetch account balances.",
"description": "Fetch account balances.",
"params": [
{
"name": "address",
"type": "string",
"optional": true,
"description": "Optional public wallet address"
}
],
"returns": {
"type": "Balance[]",
"description": "Array of account balances"
},
"source": "BaseExchange.ts:1171"
},
"getExecutionPrice": {
"summary": "Calculate the volume-weighted average execution price for a given order size.",
"description": "Returns 0 if the order cannot be fully filled.",
"params": [
{
"name": "orderBook",
"type": "OrderBook",
"optional": false,
"description": "The current order book"
},
{
"name": "side",
"type": "'buy' | 'sell'",
"optional": false,
"description": "'buy' or 'sell'"
},
{
"name": "amount",
"type": "number",
"optional": false,
"description": "Number of contracts to simulate"
}
],
"returns": {
"type": "number",
"description": "Average execution price, or 0 if insufficient liquidity"
},
"source": "BaseExchange.ts:1181"
},
"getExecutionPriceDetailed": {
"summary": "Calculate detailed execution price information including partial fill data.",
"description": "Calculate detailed execution price information including partial fill data.",
"params": [
{
"name": "orderBook",
"type": "OrderBook",
"optional": false,
"description": "The current order book"
},
{
"name": "side",
"type": "'buy' | 'sell'",
"optional": false,
"description": "'buy' or 'sell'"
},
{
"name": "amount",
"type": "number",
"optional": false,
"description": "Number of contracts to simulate"
}
],
"returns": {
"type": "ExecutionPriceResult",
"description": "Detailed execution result with price, filled amount, and fill status"
},
"source": "BaseExchange.ts:1194"
},
"filterMarkets": {
"summary": "Filter a list of markets by criteria.",
"description": "Can filter by string query, structured criteria object, or custom filter function.",
"params": [
{
"name": "markets",
"type": "UnifiedMarket[]",
"optional": false,
"description": "Array of markets to filter"
},
{
"name": "criteria",
"type": "string | MarketFilterCriteria | MarketFilterFunction",
"optional": false,
"description": "Filter criteria: string (text search), object (structured), or function (predicate)"
}
],
"returns": {
"type": "UnifiedMarket[]",
"description": "Filtered array of markets"
},
"source": "BaseExchange.ts:1210"
},
"filterEvents": {
"summary": "Filter a list of events by criteria.",
"description": "Can filter by string query, structured criteria object, or custom filter function.",
"params": [
{
"name": "events",
"type": "UnifiedEvent[]",
"optional": false,
"description": "Array of events to filter"
},
{
"name": "criteria",
"type": "string | EventFilterCriteria | EventFilterFunction",
"optional": false,
"description": "Filter criteria: string (text search), object (structured), or function (predicate)"
}
],
"returns": {
"type": "UnifiedEvent[]",
"description": "Filtered array of events"
},
"source": "BaseExchange.ts:1370"
},
"watchOrderBook": {
"summary": "Watch order book updates in real-time via WebSocket.",
"description": "Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).",
"params": [
{
"name": "outcomeId",
"type": "string",
"optional": false,
"description": "The Outcome ID to watch"
},
{
"name": "limit",
"type": "number",
"optional": true,
"description": "Optional limit for orderbook depth"
},
{
"name": "params",
"type": "Record<string, any>",
"optional": false,
"description": "Optional exchange-specific parameters"
}
],
"returns": {
"type": "OrderBook",
"description": "Promise that resolves with the current orderbook state"
},
"source": "BaseExchange.ts:1466"
},
"watchOrderBooks": {
"summary": "Watch multiple order books simultaneously via WebSocket.",
"description": "Returns a promise that resolves with a record of order book snapshots keyed by ID.\nExchanges with native batch support (e.g. Kalshi) send a single subscribe message\nfor all tickers; others fall back to individual watchOrderBook calls.",
"params": [
{
"name": "outcomeIds",
"type": "string[]",
"optional": false,
"description": "Array of Outcome IDs to watch"
},
{
"name": "limit",
"type": "number",
"optional": true,
"description": "Optional limit for orderbook depth"
},
{
"name": "params",
"type": "Record<string, any>",
"optional": false,
"description": "Optional exchange-specific parameters"
}
],
"returns": {
"type": "Record<string, OrderBook>",
"description": "Promise that resolves with order books keyed by ID"
},
"source": "BaseExchange.ts:1479"
},
"unwatchOrderBook": {
"summary": "Unsubscribe from a previously watched order book stream.",
"description": "Unsubscribe from a previously watched order book stream.",
"params": [
{
"name": "outcomeId",
"type": "string",
"optional": false,
"description": "The Outcome ID to stop watching"
}
],
"returns": {
"type": "void",
"description": "Result"
},
"source": "BaseExchange.ts:1507"
},
"watchTrades": {
"summary": "Watch trade executions in real-time via WebSocket.",
"description": "Returns a promise that resolves with the next trade(s). Call repeatedly in a loop to stream updates (CCXT Pro pattern).",
"params": [
{
"name": "outcomeId",
"type": "string",
"optional": false,
"description": "The Outcome ID to watch"
},
{
"name": "address",
"type": "string",
"optional": true,
"description": "Public wallet address"
},
{
"name": "since",
"type": "number",
"optional": true,
"description": "Optional timestamp to filter trades from"
},
{
"name": "limit",
"type": "number",
"optional": true,
"description": "Optional limit for number of trades"
}
],
"returns": {
"type": "Trade[]",
"description": "Promise that resolves with recent trades"
},
"source": "BaseExchange.ts:1520"
},
"watchAddress": {
"summary": "Stream activity for a public wallet address",
"description": "Returns a promise that resolves with the next activity snapshot whenever a change\nis detected. Call repeatedly in a loop to stream updates (CCXT Pro pattern).",
"params": [
{
"name": "address",
"type": "string",
"optional": false,
"description": "Public wallet address to watch"
},
{
"name": "types",
"type": "SubscriptionOption[]",
"optional": true,
"description": "Subset of activity to watch (default: all types)"
}
],
"returns": {
"type": "SubscribedAddressSnapshot",
"description": "Promise that resolves with the latest SubscribedAddressSnapshot snapshot"
},
"source": "BaseExchange.ts:1534"
},
"unwatchAddress": {
"summary": "Stop watching a previously registered wallet address and release its resource updates.",
"description": "Stop watching a previously registered wallet address and release its resource updates.",
"params": [
{
"name": "address",
"type": "string",
"optional": false,
"description": "Public wallet address to stop watching"
}
],
"returns": {
"type": "void",
"description": "Result"
},
"source": "BaseExchange.ts:1547"
},
"close": {
"summary": "Close all WebSocket connections and clean up resources.",
"description": "Call this when you're done streaming to properly release connections.",
"params": [],
"returns": {
"type": "void",
"description": "Result"
},
"source": "BaseExchange.ts:1556"
},
"fetchMarketMatches": {
"summary": "Find the same or related market on other venues. Two modes:",
"description": "**Lookup mode** (marketId/slug/url provided): Given a market on one venue, discover\nsemantically equivalent markets across every other venue PMXT ingests.\n\n**Browse mode** (no identifier): Returns all matched market pairs from the catalog.\nSupports query, category, minDifference, and sort params for filtering.",
"params": [
{
"name": "params",
"type": "FetchMarketMatchesParams",
"optional": true,
"description": "Match filter parameters"
}
],
"returns": {
"type": "MatchResult[]",
"description": "Array of matched markets with relation and confidence"
},
"source": "BaseExchange.ts:1570"
},
"fetchMatches": {
"summary": "fetchMatches",
"description": "fetchMatches",
"params": [
{
"name": "params",
"type": "FetchMatchesParams",
"optional": false,
"description": "params"
}
],
"returns": {
"type": "MatchResult[]",
"description": "Result"
},
"source": "BaseExchange.ts:1586"
},
"fetchEventMatches": {
"summary": "Find the same or related event on other venues. Two modes:",
"description": "**Lookup mode** (eventId/slug provided): Given an event on one venue, discover\nsemantically equivalent events across every other venue PMXT ingests.\n\n**Browse mode** (no identifier): Returns all matched event pairs from the catalog.\nSupports query and category params for filtering.",
"params": [
{
"name": "params",
"type": "FetchEventMatchesParams",
"optional": true,
"description": "Event match filter parameters"
}
],
"returns": {
"type": "EventMatchResult[]",
"description": "Array of matched events with market-level match details"
},
"source": "BaseExchange.ts:1594"
},
"compareMarketPrices": {
"summary": "Compare live prices for the same market across venues. Finds identity matches and returns side-by-side best bid/ask prices so you can spot price differences at a glance.",
"description": "Compare live prices for the same market across venues. Finds identity matches and returns side-by-side best bid/ask prices so you can spot price differences at a glance.",
"params": [
{
"name": "params",
"type": "FetchMatchesParams",
"optional": false,
"description": "Match filter parameters (uses relation: 'identity' internally)"
}
],
"returns": {
"type": "PriceComparison[]",
"description": "Array of price comparisons across venues"
},
"source": "BaseExchange.ts:1610"
},
"fetchRelatedMarkets": {
"summary": "Find related markets across venues. Discovers subset/superset market relationships",
"description": "where one market's outcome implies another, with live prices.",
"params": [
{
"name": "params",
"type": "FetchMatchesParams",
"optional": false,
"description": "Match filter parameters"
}
],
"returns": {
"type": "PriceComparison[]",
"description": "Array of subset/superset matches with live prices"
},
"source": "BaseExchange.ts:1620"
},
"fetchMatchedMarkets": {
"summary": "fetchMatchedMarkets",
"description": "fetchMatchedMarkets",
"params": [
{
"name": "params",
"type": "FetchMatchedMarketsParams",
"optional": true,
"description": "params"
}
],
"returns": {
"type": "MatchedMarketPair[]",
"description": "Result"
},
"source": "BaseExchange.ts:1631"
},
"fetchMatchedPrices": {
"summary": "fetchMatchedPrices",
"description": "fetchMatchedPrices",
"params": [
{
"name": "params",
"type": "FetchMatchedPricesParams",
"optional": true,
"description": "Price comparison parameters (minDifference, category, limit)"
}
],
"returns": {
"type": "MatchedPricePair[]",
"description": "Array of matched market pairs with prices from each venue"
},
"source": "BaseExchange.ts:1639"
},
"fetchHedges": {
"summary": "fetchHedges",
"description": "fetchHedges",
"params": [
{
"name": "params",
"type": "FetchMatchesParams",
"optional": false,
"description": "Match filter parameters"
}
],
"returns": {
"type": "PriceComparison[]",
"description": "Array of subset/superset matches with live prices"
},
"source": "BaseExchange.ts:1650"
},
"fetchArbitrage": {
"summary": "fetchArbitrage",
"description": "fetchArbitrage",
"params": [
{
"name": "params",
"type": "FetchArbitrageParams",
"optional": true,
"description": "Arbitrage scan parameters (minSpread, category, limit)"
}
],
"returns": {
"type": "ArbitrageOpportunity[]",