@mostlyrightmd/markets 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -225,7 +225,7 @@ var SETTLE_DELAY_HOURS = Object.freeze({
225
225
  other: 24
226
226
  });
227
227
  var SLUG_DATE_RE = /(\d{4})-(\d{2})-(\d{2})/g;
228
- var DEFERRED_STATIONS = /* @__PURE__ */ new Set(["VHHH", "RCTP"]);
228
+ var DEFERRED_STATIONS = /* @__PURE__ */ new Set(["HKO", "RCSS"]);
229
229
 
230
230
  // src/polymarket/description.ts
231
231
  var URL_RE = /https?:\/\/[^\s<>"')]{1,2048}/g;
@@ -286,92 +286,92 @@ var POLYMARKET_CITY_STATIONS = {
286
286
  amsterdam: {
287
287
  default: "EHAM"
288
288
  },
289
+ ankara: {
290
+ default: "LTAC"
291
+ },
289
292
  atlanta: {
290
293
  default: "KATL"
291
294
  },
292
- auckland: {
293
- default: "NZAA"
294
- },
295
295
  austin: {
296
296
  default: "KAUS"
297
297
  },
298
- bangkok: {
299
- default: "VTBS"
300
- },
301
- barcelona: {
302
- default: "LEBL"
303
- },
304
298
  beijing: {
305
299
  default: "ZBAA"
306
300
  },
307
- berlin: {
308
- default: "EDDB"
301
+ buenos_aires: {
302
+ default: "SAEZ"
309
303
  },
310
- boston: {
311
- default: "KBOS"
304
+ busan: {
305
+ default: "RKPK"
312
306
  },
313
- brisbane: {
314
- default: "YBBN"
307
+ cape_town: {
308
+ default: "FACT"
315
309
  },
316
- buenos_aires: {
317
- default: "SAEZ"
310
+ chengdu: {
311
+ default: "ZUUU"
318
312
  },
319
313
  chicago: {
320
314
  default: "KORD",
321
315
  high: "KORD",
322
316
  low: "KORD"
323
317
  },
324
- copenhagen: {
325
- default: "EKCH"
318
+ chongqing: {
319
+ default: "ZUCK"
326
320
  },
327
321
  dallas: {
328
- default: "KDFW"
329
- },
330
- delhi: {
331
- default: "VIDP"
322
+ default: "KDAL"
332
323
  },
333
324
  denver: {
334
- default: "KDEN"
335
- },
336
- detroit: {
337
- default: "KDTW"
338
- },
339
- doha: {
340
- default: "OTHH"
341
- },
342
- dubai: {
343
- default: "OMDB"
325
+ default: "KBKF"
344
326
  },
345
- frankfurt: {
346
- default: "EDDF"
327
+ guangzhou: {
328
+ default: "ZGGG"
347
329
  },
348
330
  helsinki: {
349
331
  default: "EFHK"
350
332
  },
351
333
  hong_kong: {
352
- default: "VHHH",
353
- high: "VHHH",
354
- low: "VHHH"
334
+ default: "HKO",
335
+ high: "HKO",
336
+ low: "HKO"
355
337
  },
356
338
  houston: {
357
- default: "KIAH"
339
+ default: "KHOU"
358
340
  },
359
- london: {
360
- default: "EGLL"
341
+ istanbul: {
342
+ default: "LTFM"
343
+ },
344
+ jeddah: {
345
+ default: "OEJN"
346
+ },
347
+ jinan: {
348
+ default: "ZSJN"
361
349
  },
362
- london_gatwick: {
363
- default: "EGKK"
350
+ karachi: {
351
+ default: "OPKC"
352
+ },
353
+ kuala_lumpur: {
354
+ default: "WMKK"
355
+ },
356
+ london: {
357
+ default: "EGLC"
364
358
  },
365
359
  los_angeles: {
366
360
  default: "KLAX",
367
361
  high: "KLAX",
368
362
  low: "KLAX"
369
363
  },
364
+ lucknow: {
365
+ default: "VILK"
366
+ },
370
367
  madrid: {
371
368
  default: "LEMD"
372
369
  },
373
- melbourne: {
374
- default: "YMML"
370
+ manila: {
371
+ default: "RPLL"
372
+ },
373
+ mexico_city: {
374
+ default: "MMMX"
375
375
  },
376
376
  miami: {
377
377
  default: "KMIA"
@@ -379,14 +379,8 @@ var POLYMARKET_CITY_STATIONS = {
379
379
  milan: {
380
380
  default: "LIMC"
381
381
  },
382
- minneapolis: {
383
- default: "KMSP"
384
- },
385
382
  moscow: {
386
- default: "UUEE"
387
- },
388
- mumbai: {
389
- default: "VABB"
383
+ default: "UUWW"
390
384
  },
391
385
  munich: {
392
386
  default: "EDDM"
@@ -396,25 +390,14 @@ var POLYMARKET_CITY_STATIONS = {
396
390
  high: "KLGA",
397
391
  low: "KLGA"
398
392
  },
399
- paris: {
400
- default: "LFPG",
401
- high: "LFPG",
402
- low: "LFPB"
403
- },
404
- paris_orly: {
405
- default: "LFPO"
406
- },
407
- philadelphia: {
408
- default: "KPHL"
409
- },
410
- phoenix: {
411
- default: "KPHX"
393
+ panama_city: {
394
+ default: "MPMG"
412
395
  },
413
- riyadh: {
414
- default: "OERK"
396
+ paris: {
397
+ default: "LFPB"
415
398
  },
416
- rome: {
417
- default: "LIRF"
399
+ qingdao: {
400
+ default: "ZSQD"
418
401
  },
419
402
  san_francisco: {
420
403
  default: "KSFO"
@@ -431,40 +414,37 @@ var POLYMARKET_CITY_STATIONS = {
431
414
  shanghai: {
432
415
  default: "ZSPD"
433
416
  },
417
+ shenzhen: {
418
+ default: "ZGSZ"
419
+ },
434
420
  singapore: {
435
421
  default: "WSSS"
436
422
  },
437
- stockholm: {
438
- default: "ESSA"
439
- },
440
- sydney: {
441
- default: "YSSY"
442
- },
443
423
  taipei: {
444
- default: "RCTP"
424
+ default: "RCSS"
425
+ },
426
+ tel_aviv: {
427
+ default: "LLBG"
445
428
  },
446
429
  tokyo: {
447
430
  default: "RJTT",
448
431
  high: "RJTT",
449
432
  low: "RJTT"
450
433
  },
451
- tokyo_narita: {
452
- default: "RJAA"
453
- },
454
- vienna: {
455
- default: "LOWW"
434
+ toronto: {
435
+ default: "CYYZ"
456
436
  },
457
437
  warsaw: {
458
438
  default: "EPWA"
459
439
  },
460
- washington_dc: {
461
- default: "KDCA"
462
- },
463
440
  wellington: {
464
441
  default: "NZWN"
465
442
  },
466
- zurich: {
467
- default: "LSZH"
443
+ wuhan: {
444
+ default: "ZHHH"
445
+ },
446
+ zhengzhou: {
447
+ default: "ZHCC"
468
448
  }
469
449
  };
470
450
 
@@ -533,19 +513,9 @@ function resolveStationForEvent(event, marketMeasure) {
533
513
  const urlText = `${desc} ${resSrc}`;
534
514
  const extractedIcao = extractIcaoFromResolutionSource(urlText);
535
515
  if (extractedIcao !== null) {
536
- if (extractedIcao === "RCTP") {
516
+ if (DEFERRED_STATIONS.has(extractedIcao)) {
537
517
  throw new import_core3.DeferredMarketError(
538
- `Polymarket market for station ${extractedIcao} is deferred until the v0.2 CWA client lands`
539
- );
540
- }
541
- if (extractedIcao === "VHHH" && marketMeasure === "low") {
542
- throw new import_core3.DeferredMarketError(
543
- `Polymarket low-extreme market for station ${extractedIcao} is deferred until the v0.2 HKO client lands`
544
- );
545
- }
546
- if (DEFERRED_STATIONS.has(extractedIcao) && marketMeasure === "default") {
547
- throw new import_core3.DeferredMarketError(
548
- `Polymarket market for deferred station ${extractedIcao} (measure=default) requires v0.2 client`
518
+ `Polymarket market for station ${extractedIcao} is deferred until the v0.2 source client lands (HKO/RCSS)`
549
519
  );
550
520
  }
551
521
  const cityForRow = cityKey ?? deriveCity(event) ?? "";
@@ -562,19 +532,9 @@ function resolveStationForEvent(event, marketMeasure) {
562
532
  else if (marketMeasure === "low" && typeof entry.low === "string") stationMeasure = "low";
563
533
  const icao = entry[stationMeasure] ?? entry.default;
564
534
  if (typeof icao !== "string") return null;
565
- if (icao === "RCTP") {
566
- throw new import_core3.DeferredMarketError(
567
- `Polymarket market for station ${icao} is deferred until the v0.2 CWA client lands`
568
- );
569
- }
570
- if (icao === "VHHH" && marketMeasure === "low") {
571
- throw new import_core3.DeferredMarketError(
572
- `Polymarket low-extreme market for station ${icao} is deferred until the v0.2 HKO client lands`
573
- );
574
- }
575
- if (DEFERRED_STATIONS.has(icao) && marketMeasure === "default") {
535
+ if (DEFERRED_STATIONS.has(icao)) {
576
536
  throw new import_core3.DeferredMarketError(
577
- `Polymarket market for deferred station ${icao} (measure=default) requires v0.2 client`
537
+ `Polymarket market for station ${icao} is deferred until the v0.2 source client lands (HKO/RCSS)`
578
538
  );
579
539
  }
580
540
  return { city: cityKey, icao, stationMeasure };
@@ -670,14 +630,14 @@ var POLYMARKET_KNOWN_WRONG_STATIONS = Object.freeze({
670
630
  nyc: /* @__PURE__ */ new Set(["KNYC", "KJFK", "KEWR"]),
671
631
  // Chicago: Polymarket uses KORD. KMDW is the common wrong answer.
672
632
  chicago: /* @__PURE__ */ new Set(["KMDW"]),
673
- // Houston: Polymarket uses KIAH. KHOU is the common wrong answer.
674
- houston: /* @__PURE__ */ new Set(["KHOU"]),
675
- // Dallas: Polymarket uses KDFW. KDAL is the common wrong answer.
676
- dallas: /* @__PURE__ */ new Set(["KDAL"]),
633
+ // Houston: Phase 23 moved Polymarket to KHOU. KIAH (Kalshi's station) is
634
+ // now the cross-venue wrong answer for a Polymarket Houston market.
635
+ houston: /* @__PURE__ */ new Set(["KIAH"]),
636
+ // Dallas: Phase 23 moved Polymarket to KDAL. KDFW (Kalshi's station) is
637
+ // now the cross-venue wrong answer.
638
+ dallas: /* @__PURE__ */ new Set(["KDFW"]),
677
639
  // SF: Polymarket uses KSFO. KOAK is the common wrong answer.
678
- san_francisco: /* @__PURE__ */ new Set(["KOAK"]),
679
- // DC: Polymarket uses KDCA. KIAD/KBWI are common wrong answers.
680
- washington_dc: /* @__PURE__ */ new Set(["KIAD", "KBWI"])
640
+ san_francisco: /* @__PURE__ */ new Set(["KOAK"])
681
641
  });
682
642
 
683
643
  // src/polymarket/settle.ts