@polymarket/bindings 0.12.0 → 0.14.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.
Files changed (39) hide show
  1. package/dist/chunk-JPPG656Y.js +2 -0
  2. package/dist/chunk-JPPG656Y.js.map +1 -0
  3. package/dist/chunk-YXNKEMRF.js +2 -0
  4. package/dist/chunk-YXNKEMRF.js.map +1 -0
  5. package/dist/chunk-ZMJTXTXA.js +2 -0
  6. package/dist/chunk-ZMJTXTXA.js.map +1 -0
  7. package/dist/clob/index.d.ts +489 -8
  8. package/dist/clob/index.js +1 -1
  9. package/dist/clob/index.js.map +1 -1
  10. package/dist/combos/index.d.ts +1 -1
  11. package/dist/combos/index.js +1 -1
  12. package/dist/combos/index.js.map +1 -1
  13. package/dist/{comment-CKJIqOZS.d.ts → comment-tQ-L48Di.d.ts} +2 -2
  14. package/dist/data/index.d.ts +446 -10
  15. package/dist/data/index.js +1 -1
  16. package/dist/data/index.js.map +1 -1
  17. package/dist/gamma/index.d.ts +79 -4
  18. package/dist/gamma/index.js +1 -1
  19. package/dist/gamma/index.js.map +1 -1
  20. package/dist/index.d.ts +108 -213
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/{orders-BMW5PN-Q.d.ts → orders-SIFuRgWc.d.ts} +608 -35
  24. package/dist/perps/index.d.ts +995 -4
  25. package/dist/perps/index.js +1 -1
  26. package/dist/perps/index.js.map +1 -1
  27. package/dist/relayer/index.d.ts +1 -1
  28. package/dist/relayer/index.js +1 -1
  29. package/dist/shared-QrXQ5O6x.d.ts +223 -0
  30. package/dist/subscriptions/index.d.ts +668 -78
  31. package/dist/subscriptions/index.js +1 -1
  32. package/dist/subscriptions/index.js.map +1 -1
  33. package/package.json +2 -2
  34. package/dist/chunk-2FRDSBWY.js +0 -2
  35. package/dist/chunk-2FRDSBWY.js.map +0 -1
  36. package/dist/chunk-3IZ4N7C2.js +0 -2
  37. package/dist/chunk-3IZ4N7C2.js.map +0 -1
  38. package/dist/chunk-DAWT25YZ.js +0 -2
  39. package/dist/chunk-DAWT25YZ.js.map +0 -1
@@ -1,16 +1,18 @@
1
1
  import { z } from 'zod';
2
- import { PositionId, TokenId, ConditionId, DecimalString, EpochMilliseconds, IsoDateTimeString, OrderSide, OrderType, TradeStatus, BaseUnits, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId } from '../index.js';
3
- import { P as PerpsInstrumentId, y as PerpsBuilderEarningId, k as PerpsTradeId, aB as PerpsOrderId, V as PerpsClientOrderId, an as PerpsLiquidityRole, ag as PerpsKlineInterval, c as PerpsDepositStatus, l as PerpsSide, b as PerpsFundingPaymentId, at as PerpsNotificationId, ay as PerpsNotificationType, av as PerpsNotificationOrderType, ao as PerpsMarginType, aU as PerpsTimeInForce, aE as PerpsOrderStatus, aW as PerpsTpSlKind, a_ as PerpsTpSlScope, g as PerpsWithdrawalId, h as PerpsKnownWithdrawalStatus } from '../orders-BMW5PN-Q.js';
2
+ import { am as PositionId, aK as TokenId, u as ConditionId, y as DecimalString, H as EpochMilliseconds, $ as IsoDateTimeString, af as OrderSide, ah as OrderType, aM as TradeStatus, B as BaseUnits, q as CommentId, s as CommentParentEntityType, O as EventId, az as SeriesId, V as ImageOptimizationId } from '../shared-QrXQ5O6x.js';
3
+ import { P as PerpsInstrumentId, B as PerpsBuilderEarningId, k as PerpsTradeId, n as PerpsOrderId, m as PerpsClientOrderId, az as PerpsLiquidityRole, ap as PerpsKlineInterval, c as PerpsDepositStatus, l as PerpsSide, aw as PerpsLiquidationMethod, b as PerpsFundingPaymentId, aF as PerpsNotificationId, aK as PerpsNotificationType, aH as PerpsNotificationOrderType, aA as PerpsMarginType, b5 as PerpsTimeInForce, aP as PerpsOrderStatus, a0 as PerpsChaseId, b7 as PerpsTpSlKind, bb as PerpsTpSlScope, g as PerpsWithdrawalId, h as PerpsKnownWithdrawalStatus } from '../orders-SIFuRgWc.js';
4
4
  import * as _polymarket_types from '@polymarket/types';
5
- import { R as ReactionType } from '../comment-CKJIqOZS.js';
5
+ import { l as ReactionType } from '../comment-tQ-L48Di.js';
6
6
 
7
7
  declare enum UserOrderStatus {
8
8
  Live = "LIVE",
9
9
  Matched = "MATCHED",
10
10
  Delayed = "DELAYED",
11
11
  Unmatched = "UNMATCHED",
12
- Canceled = "CANCELED"
12
+ Canceled = "CANCELED",
13
+ Invalid = "INVALID"
13
14
  }
15
+ type CanceledWithReasonStatus = `CANCELED_${string}`;
14
16
  declare const OrderBookLevelSchema: z.ZodObject<{
15
17
  price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
16
18
  size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -354,7 +356,7 @@ declare const NewMarketEventSchema: z.ZodPipe<z.ZodObject<{
354
356
  clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
355
357
  sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
356
358
  line: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
357
- game_start_time: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>>;
359
+ game_start_time: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>>>;
358
360
  order_price_min_tick_size: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
359
361
  group_item_title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
362
  taker_base_fee: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
@@ -549,7 +551,7 @@ declare const UserOrderEventSchema: z.ZodPipe<z.ZodObject<{
549
551
  created_at: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>>>;
550
552
  expiration: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString | undefined, string>>>>;
551
553
  order_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof OrderType>>>;
552
- status: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof UserOrderStatus>>>;
554
+ status: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<typeof UserOrderStatus>, z.ZodCustom<`CANCELED_${string}`, `CANCELED_${string}`>]>>>;
553
555
  maker_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
554
556
  timestamp: z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>;
555
557
  }, z.core.$strip>, z.ZodTransform<{
@@ -575,7 +577,7 @@ declare const UserOrderEventSchema: z.ZodPipe<z.ZodObject<{
575
577
  price: DecimalString;
576
578
  timestamp: EpochMilliseconds;
577
579
  outcome?: string | null | undefined;
578
- status?: UserOrderStatus | null | undefined;
580
+ status?: `CANCELED_${string}` | UserOrderStatus | null | undefined;
579
581
  };
580
582
  }, {
581
583
  event_type: "order";
@@ -595,7 +597,7 @@ declare const UserOrderEventSchema: z.ZodPipe<z.ZodObject<{
595
597
  created_at?: IsoDateTimeString | null | undefined;
596
598
  expiration?: IsoDateTimeString | null | undefined;
597
599
  order_type?: OrderType | null | undefined;
598
- status?: UserOrderStatus | null | undefined;
600
+ status?: `CANCELED_${string}` | UserOrderStatus | null | undefined;
599
601
  maker_address?: string | null | undefined;
600
602
  }>>;
601
603
  type UserOrderEvent = {
@@ -621,7 +623,7 @@ type UserOrderEvent = {
621
623
  createdAt: IsoDateTimeString | null | undefined;
622
624
  expiresAt: IsoDateTimeString | null | undefined;
623
625
  orderType: OrderType | null | undefined;
624
- status?: UserOrderStatus | null;
626
+ status?: UserOrderStatus | CanceledWithReasonStatus | null;
625
627
  makerAddress: string | null | undefined;
626
628
  timestamp: EpochMilliseconds;
627
629
  };
@@ -1040,7 +1042,7 @@ declare const CustomMarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
1040
1042
  clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1041
1043
  sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1042
1044
  line: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
1043
- game_start_time: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>>;
1045
+ game_start_time: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>>>;
1044
1046
  order_price_min_tick_size: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
1045
1047
  group_item_title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1046
1048
  taker_base_fee: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
@@ -1398,7 +1400,7 @@ declare const MarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<
1398
1400
  clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1399
1401
  sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1400
1402
  line: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
1401
- game_start_time: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>>;
1403
+ game_start_time: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>>>;
1402
1404
  order_price_min_tick_size: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
1403
1405
  group_item_title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1404
1406
  taker_base_fee: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
@@ -1539,7 +1541,7 @@ declare const UserEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<{
1539
1541
  created_at: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>>>;
1540
1542
  expiration: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString | undefined, string>>>>;
1541
1543
  order_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof OrderType>>>;
1542
- status: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof UserOrderStatus>>>;
1544
+ status: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<typeof UserOrderStatus>, z.ZodCustom<`CANCELED_${string}`, `CANCELED_${string}`>]>>>;
1543
1545
  maker_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1544
1546
  timestamp: z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>;
1545
1547
  }, z.core.$strip>, z.ZodTransform<{
@@ -1565,7 +1567,7 @@ declare const UserEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<{
1565
1567
  price: DecimalString;
1566
1568
  timestamp: EpochMilliseconds;
1567
1569
  outcome?: string | null | undefined;
1568
- status?: UserOrderStatus | null | undefined;
1570
+ status?: `CANCELED_${string}` | UserOrderStatus | null | undefined;
1569
1571
  };
1570
1572
  }, {
1571
1573
  event_type: "order";
@@ -1585,7 +1587,7 @@ declare const UserEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<{
1585
1587
  created_at?: IsoDateTimeString | null | undefined;
1586
1588
  expiration?: IsoDateTimeString | null | undefined;
1587
1589
  order_type?: OrderType | null | undefined;
1588
- status?: UserOrderStatus | null | undefined;
1590
+ status?: `CANCELED_${string}` | UserOrderStatus | null | undefined;
1589
1591
  maker_address?: string | null | undefined;
1590
1592
  }>>, z.ZodPipe<z.ZodObject<{
1591
1593
  event_type: z.ZodLiteral<"trade">;
@@ -1728,12 +1730,14 @@ type UserEvent = UserOrderEvent | UserTradeEvent;
1728
1730
  */
1729
1731
  declare const PerpsTradeEventSchema: z.ZodPipe<z.ZodObject<{
1730
1732
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1733
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
1731
1734
  sq: z.ZodNumber;
1732
1735
  ch: z.ZodString;
1733
1736
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
1734
1737
  tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
1735
1738
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1736
1739
  side: z.ZodEnum<typeof PerpsSide>;
1740
+ settlement: z.ZodDefault<z.ZodBoolean>;
1737
1741
  p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1738
1742
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1739
1743
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
@@ -1742,6 +1746,7 @@ declare const PerpsTradeEventSchema: z.ZodPipe<z.ZodObject<{
1742
1746
  tradeId: PerpsTradeId;
1743
1747
  instrumentId: PerpsInstrumentId;
1744
1748
  side: PerpsSide;
1749
+ settlement: boolean;
1745
1750
  price: DecimalString;
1746
1751
  quantity: DecimalString;
1747
1752
  timestamp: EpochMilliseconds;
@@ -1750,6 +1755,7 @@ declare const PerpsTradeEventSchema: z.ZodPipe<z.ZodObject<{
1750
1755
  tid: PerpsTradeId;
1751
1756
  iid: PerpsInstrumentId;
1752
1757
  side: PerpsSide;
1758
+ settlement: boolean;
1753
1759
  p: DecimalString;
1754
1760
  qty: DecimalString;
1755
1761
  ts: EpochMilliseconds;
@@ -1760,11 +1766,14 @@ declare const PerpsTradeEventSchema: z.ZodPipe<z.ZodObject<{
1760
1766
  type: "trade";
1761
1767
  channel: string;
1762
1768
  timestamp: EpochMilliseconds;
1769
+ /** Newest reflected event time; null means the event horizon is unknown. */
1770
+ eventTimestamp: EpochMilliseconds | null;
1763
1771
  sequence: number;
1764
1772
  payload: {
1765
1773
  tradeId: PerpsTradeId;
1766
1774
  instrumentId: PerpsInstrumentId;
1767
1775
  side: PerpsSide;
1776
+ settlement: boolean;
1768
1777
  price: DecimalString;
1769
1778
  quantity: DecimalString;
1770
1779
  timestamp: EpochMilliseconds;
@@ -1772,12 +1781,14 @@ declare const PerpsTradeEventSchema: z.ZodPipe<z.ZodObject<{
1772
1781
  }[];
1773
1782
  }, {
1774
1783
  ts: EpochMilliseconds;
1784
+ ets: EpochMilliseconds | null;
1775
1785
  sq: number;
1776
1786
  ch: string;
1777
1787
  data: {
1778
1788
  tradeId: PerpsTradeId;
1779
1789
  instrumentId: PerpsInstrumentId;
1780
1790
  side: PerpsSide;
1791
+ settlement: boolean;
1781
1792
  price: DecimalString;
1782
1793
  quantity: DecimalString;
1783
1794
  timestamp: EpochMilliseconds;
@@ -1793,6 +1804,7 @@ type PerpsTradeEvent = z.infer<typeof PerpsTradeEventSchema>;
1793
1804
  */
1794
1805
  declare const PerpsBboEventSchema: z.ZodPipe<z.ZodObject<{
1795
1806
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1807
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
1796
1808
  sq: z.ZodNumber;
1797
1809
  ch: z.ZodString;
1798
1810
  data: z.ZodPipe<z.ZodObject<{
@@ -1819,6 +1831,8 @@ declare const PerpsBboEventSchema: z.ZodPipe<z.ZodObject<{
1819
1831
  type: "bbo";
1820
1832
  channel: string;
1821
1833
  timestamp: EpochMilliseconds;
1834
+ /** Newest reflected event time; null means the event horizon is unknown. */
1835
+ eventTimestamp: EpochMilliseconds | null;
1822
1836
  sequence: number;
1823
1837
  payload: {
1824
1838
  instrumentId: PerpsInstrumentId;
@@ -1829,6 +1843,7 @@ declare const PerpsBboEventSchema: z.ZodPipe<z.ZodObject<{
1829
1843
  };
1830
1844
  }, {
1831
1845
  ts: EpochMilliseconds;
1846
+ ets: EpochMilliseconds | null;
1832
1847
  sq: number;
1833
1848
  ch: string;
1834
1849
  data: {
@@ -1848,6 +1863,7 @@ type PerpsBboEvent = z.infer<typeof PerpsBboEventSchema>;
1848
1863
  */
1849
1864
  declare const PerpsBookEventSchema: z.ZodPipe<z.ZodObject<{
1850
1865
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1866
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
1851
1867
  sq: z.ZodNumber;
1852
1868
  ch: z.ZodString;
1853
1869
  data: z.ZodPipe<z.ZodObject<{
@@ -1883,6 +1899,8 @@ declare const PerpsBookEventSchema: z.ZodPipe<z.ZodObject<{
1883
1899
  type: "book";
1884
1900
  channel: string;
1885
1901
  timestamp: EpochMilliseconds;
1902
+ /** Newest reflected event time; null means the event horizon is unknown. */
1903
+ eventTimestamp: EpochMilliseconds | null;
1886
1904
  sequence: number;
1887
1905
  payload: {
1888
1906
  bids: {
@@ -1897,6 +1915,7 @@ declare const PerpsBookEventSchema: z.ZodPipe<z.ZodObject<{
1897
1915
  };
1898
1916
  }, {
1899
1917
  ts: EpochMilliseconds;
1918
+ ets: EpochMilliseconds | null;
1900
1919
  sq: number;
1901
1920
  ch: string;
1902
1921
  data: {
@@ -1919,6 +1938,7 @@ type PerpsBookEvent = z.infer<typeof PerpsBookEventSchema>;
1919
1938
  */
1920
1939
  declare const PerpsTickerEventSchema: z.ZodPipe<z.ZodObject<{
1921
1940
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1941
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
1922
1942
  sq: z.ZodNumber;
1923
1943
  ch: z.ZodString;
1924
1944
  data: z.ZodPipe<z.ZodObject<{
@@ -1954,6 +1974,8 @@ declare const PerpsTickerEventSchema: z.ZodPipe<z.ZodObject<{
1954
1974
  type: "ticker";
1955
1975
  channel: string;
1956
1976
  timestamp: EpochMilliseconds;
1977
+ /** Newest reflected event time; null means the event horizon is unknown. */
1978
+ eventTimestamp: EpochMilliseconds | null;
1957
1979
  sequence: number;
1958
1980
  payload: {
1959
1981
  instrumentId: PerpsInstrumentId;
@@ -1967,6 +1989,7 @@ declare const PerpsTickerEventSchema: z.ZodPipe<z.ZodObject<{
1967
1989
  };
1968
1990
  }, {
1969
1991
  ts: EpochMilliseconds;
1992
+ ets: EpochMilliseconds | null;
1970
1993
  sq: number;
1971
1994
  ch: string;
1972
1995
  data: {
@@ -1989,6 +2012,7 @@ type PerpsTickerEvent = z.infer<typeof PerpsTickerEventSchema>;
1989
2012
  */
1990
2013
  declare const PerpsStatisticEventSchema: z.ZodPipe<z.ZodObject<{
1991
2014
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2015
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
1992
2016
  sq: z.ZodNumber;
1993
2017
  ch: z.ZodString;
1994
2018
  data: z.ZodPipe<z.ZodObject<{
@@ -2036,6 +2060,8 @@ declare const PerpsStatisticEventSchema: z.ZodPipe<z.ZodObject<{
2036
2060
  type: "statistic";
2037
2061
  channel: string;
2038
2062
  timestamp: EpochMilliseconds;
2063
+ /** Newest reflected event time; null means the event horizon is unknown. */
2064
+ eventTimestamp: EpochMilliseconds | null;
2039
2065
  sequence: number;
2040
2066
  payload: {
2041
2067
  instrumentId: PerpsInstrumentId;
@@ -2053,6 +2079,7 @@ declare const PerpsStatisticEventSchema: z.ZodPipe<z.ZodObject<{
2053
2079
  };
2054
2080
  }, {
2055
2081
  ts: EpochMilliseconds;
2082
+ ets: EpochMilliseconds | null;
2056
2083
  sq: number;
2057
2084
  ch: string;
2058
2085
  data: {
@@ -2079,6 +2106,7 @@ type PerpsStatisticEvent = z.infer<typeof PerpsStatisticEventSchema>;
2079
2106
  */
2080
2107
  declare const PerpsCandleEventSchema: z.ZodPipe<z.ZodObject<{
2081
2108
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2109
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2082
2110
  sq: z.ZodNumber;
2083
2111
  ch: z.ZodString;
2084
2112
  data: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodNumber], null>, z.ZodTransform<{
@@ -2095,6 +2123,8 @@ declare const PerpsCandleEventSchema: z.ZodPipe<z.ZodObject<{
2095
2123
  type: "candle";
2096
2124
  channel: string;
2097
2125
  timestamp: EpochMilliseconds;
2126
+ /** Newest reflected event time; null means the event horizon is unknown. */
2127
+ eventTimestamp: EpochMilliseconds | null;
2098
2128
  sequence: number;
2099
2129
  payload: {
2100
2130
  instrumentId: PerpsInstrumentId;
@@ -2111,6 +2141,7 @@ declare const PerpsCandleEventSchema: z.ZodPipe<z.ZodObject<{
2111
2141
  };
2112
2142
  }, {
2113
2143
  ts: EpochMilliseconds;
2144
+ ets: EpochMilliseconds | null;
2114
2145
  sq: number;
2115
2146
  ch: string;
2116
2147
  data: {
@@ -2132,12 +2163,14 @@ type PerpsCandleEvent = z.infer<typeof PerpsCandleEventSchema>;
2132
2163
  */
2133
2164
  declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
2134
2165
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2166
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2135
2167
  sq: z.ZodNumber;
2136
2168
  ch: z.ZodString;
2137
2169
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
2138
2170
  tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
2139
2171
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2140
2172
  side: z.ZodEnum<typeof PerpsSide>;
2173
+ settlement: z.ZodDefault<z.ZodBoolean>;
2141
2174
  p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2142
2175
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2143
2176
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
@@ -2146,6 +2179,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2146
2179
  tradeId: PerpsTradeId;
2147
2180
  instrumentId: PerpsInstrumentId;
2148
2181
  side: PerpsSide;
2182
+ settlement: boolean;
2149
2183
  price: DecimalString;
2150
2184
  quantity: DecimalString;
2151
2185
  timestamp: EpochMilliseconds;
@@ -2154,6 +2188,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2154
2188
  tid: PerpsTradeId;
2155
2189
  iid: PerpsInstrumentId;
2156
2190
  side: PerpsSide;
2191
+ settlement: boolean;
2157
2192
  p: DecimalString;
2158
2193
  qty: DecimalString;
2159
2194
  ts: EpochMilliseconds;
@@ -2164,11 +2199,14 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2164
2199
  type: "trade";
2165
2200
  channel: string;
2166
2201
  timestamp: EpochMilliseconds;
2202
+ /** Newest reflected event time; null means the event horizon is unknown. */
2203
+ eventTimestamp: EpochMilliseconds | null;
2167
2204
  sequence: number;
2168
2205
  payload: {
2169
2206
  tradeId: PerpsTradeId;
2170
2207
  instrumentId: PerpsInstrumentId;
2171
2208
  side: PerpsSide;
2209
+ settlement: boolean;
2172
2210
  price: DecimalString;
2173
2211
  quantity: DecimalString;
2174
2212
  timestamp: EpochMilliseconds;
@@ -2176,12 +2214,14 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2176
2214
  }[];
2177
2215
  }, {
2178
2216
  ts: EpochMilliseconds;
2217
+ ets: EpochMilliseconds | null;
2179
2218
  sq: number;
2180
2219
  ch: string;
2181
2220
  data: {
2182
2221
  tradeId: PerpsTradeId;
2183
2222
  instrumentId: PerpsInstrumentId;
2184
2223
  side: PerpsSide;
2224
+ settlement: boolean;
2185
2225
  price: DecimalString;
2186
2226
  quantity: DecimalString;
2187
2227
  timestamp: EpochMilliseconds;
@@ -2189,6 +2229,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2189
2229
  }[];
2190
2230
  }>>, z.ZodPipe<z.ZodObject<{
2191
2231
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2232
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2192
2233
  sq: z.ZodNumber;
2193
2234
  ch: z.ZodString;
2194
2235
  data: z.ZodPipe<z.ZodObject<{
@@ -2215,6 +2256,8 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2215
2256
  type: "bbo";
2216
2257
  channel: string;
2217
2258
  timestamp: EpochMilliseconds;
2259
+ /** Newest reflected event time; null means the event horizon is unknown. */
2260
+ eventTimestamp: EpochMilliseconds | null;
2218
2261
  sequence: number;
2219
2262
  payload: {
2220
2263
  instrumentId: PerpsInstrumentId;
@@ -2225,6 +2268,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2225
2268
  };
2226
2269
  }, {
2227
2270
  ts: EpochMilliseconds;
2271
+ ets: EpochMilliseconds | null;
2228
2272
  sq: number;
2229
2273
  ch: string;
2230
2274
  data: {
@@ -2236,6 +2280,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2236
2280
  };
2237
2281
  }>>, z.ZodPipe<z.ZodObject<{
2238
2282
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2283
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2239
2284
  sq: z.ZodNumber;
2240
2285
  ch: z.ZodString;
2241
2286
  data: z.ZodPipe<z.ZodObject<{
@@ -2271,6 +2316,8 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2271
2316
  type: "book";
2272
2317
  channel: string;
2273
2318
  timestamp: EpochMilliseconds;
2319
+ /** Newest reflected event time; null means the event horizon is unknown. */
2320
+ eventTimestamp: EpochMilliseconds | null;
2274
2321
  sequence: number;
2275
2322
  payload: {
2276
2323
  bids: {
@@ -2285,6 +2332,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2285
2332
  };
2286
2333
  }, {
2287
2334
  ts: EpochMilliseconds;
2335
+ ets: EpochMilliseconds | null;
2288
2336
  sq: number;
2289
2337
  ch: string;
2290
2338
  data: {
@@ -2299,6 +2347,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2299
2347
  };
2300
2348
  }>>, z.ZodPipe<z.ZodObject<{
2301
2349
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2350
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2302
2351
  sq: z.ZodNumber;
2303
2352
  ch: z.ZodString;
2304
2353
  data: z.ZodPipe<z.ZodObject<{
@@ -2334,6 +2383,8 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2334
2383
  type: "ticker";
2335
2384
  channel: string;
2336
2385
  timestamp: EpochMilliseconds;
2386
+ /** Newest reflected event time; null means the event horizon is unknown. */
2387
+ eventTimestamp: EpochMilliseconds | null;
2337
2388
  sequence: number;
2338
2389
  payload: {
2339
2390
  instrumentId: PerpsInstrumentId;
@@ -2347,6 +2398,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2347
2398
  };
2348
2399
  }, {
2349
2400
  ts: EpochMilliseconds;
2401
+ ets: EpochMilliseconds | null;
2350
2402
  sq: number;
2351
2403
  ch: string;
2352
2404
  data: {
@@ -2361,6 +2413,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2361
2413
  };
2362
2414
  }>>, z.ZodPipe<z.ZodObject<{
2363
2415
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2416
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2364
2417
  sq: z.ZodNumber;
2365
2418
  ch: z.ZodString;
2366
2419
  data: z.ZodPipe<z.ZodObject<{
@@ -2408,6 +2461,8 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2408
2461
  type: "statistic";
2409
2462
  channel: string;
2410
2463
  timestamp: EpochMilliseconds;
2464
+ /** Newest reflected event time; null means the event horizon is unknown. */
2465
+ eventTimestamp: EpochMilliseconds | null;
2411
2466
  sequence: number;
2412
2467
  payload: {
2413
2468
  instrumentId: PerpsInstrumentId;
@@ -2425,6 +2480,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2425
2480
  };
2426
2481
  }, {
2427
2482
  ts: EpochMilliseconds;
2483
+ ets: EpochMilliseconds | null;
2428
2484
  sq: number;
2429
2485
  ch: string;
2430
2486
  data: {
@@ -2443,6 +2499,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2443
2499
  };
2444
2500
  }>>, z.ZodPipe<z.ZodObject<{
2445
2501
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2502
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2446
2503
  sq: z.ZodNumber;
2447
2504
  ch: z.ZodString;
2448
2505
  data: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodNumber], null>, z.ZodTransform<{
@@ -2459,6 +2516,8 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2459
2516
  type: "candle";
2460
2517
  channel: string;
2461
2518
  timestamp: EpochMilliseconds;
2519
+ /** Newest reflected event time; null means the event horizon is unknown. */
2520
+ eventTimestamp: EpochMilliseconds | null;
2462
2521
  sequence: number;
2463
2522
  payload: {
2464
2523
  instrumentId: PerpsInstrumentId;
@@ -2475,6 +2534,7 @@ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodOb
2475
2534
  };
2476
2535
  }, {
2477
2536
  ts: EpochMilliseconds;
2537
+ ets: EpochMilliseconds | null;
2478
2538
  sq: number;
2479
2539
  ch: string;
2480
2540
  data: {
@@ -2496,6 +2556,7 @@ type PerpsMarketDataEvent = z.infer<typeof PerpsMarketDataEventSchema>;
2496
2556
  */
2497
2557
  declare const PerpsBalanceUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2498
2558
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2559
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2499
2560
  sq: z.ZodNumber;
2500
2561
  ch: z.ZodLiteral<"balances">;
2501
2562
  data: z.ZodObject<{
@@ -2507,6 +2568,8 @@ declare const PerpsBalanceUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2507
2568
  type: "balance";
2508
2569
  channel: "balances";
2509
2570
  timestamp: number;
2571
+ /** Newest reflected event time; null means the event horizon is unknown. */
2572
+ eventTimestamp: EpochMilliseconds | null;
2510
2573
  sequence: number;
2511
2574
  payload: {
2512
2575
  asset: string;
@@ -2515,6 +2578,7 @@ declare const PerpsBalanceUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2515
2578
  };
2516
2579
  }, {
2517
2580
  ts: EpochMilliseconds;
2581
+ ets: EpochMilliseconds | null;
2518
2582
  sq: number;
2519
2583
  ch: "balances";
2520
2584
  data: {
@@ -2532,6 +2596,7 @@ type PerpsBalanceUpdateEvent = z.infer<typeof PerpsBalanceUpdateEventSchema>;
2532
2596
  */
2533
2597
  declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2534
2598
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2599
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2535
2600
  sq: z.ZodNumber;
2536
2601
  ch: z.ZodLiteral<"portfolio">;
2537
2602
  data: z.ZodPipe<z.ZodObject<{
@@ -2549,6 +2614,7 @@ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2549
2614
  unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2550
2615
  return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2551
2616
  cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2617
+ adl_index: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
2552
2618
  }, z.core.$strip>, z.ZodTransform<{
2553
2619
  instrumentId: PerpsInstrumentId;
2554
2620
  symbol: string;
@@ -2563,6 +2629,7 @@ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2563
2629
  unrealizedPnl: DecimalString;
2564
2630
  returnOnEquity: DecimalString;
2565
2631
  cumulativeFunding: DecimalString;
2632
+ adlIndex: 0 | 1 | 2 | 3;
2566
2633
  }, {
2567
2634
  instrument_id: PerpsInstrumentId;
2568
2635
  symbol: string;
@@ -2577,25 +2644,30 @@ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2577
2644
  unrealized_pnl: DecimalString;
2578
2645
  return_on_equity: DecimalString;
2579
2646
  cumulative_funding: DecimalString;
2647
+ adl_index: 0 | 1 | 2 | 3;
2580
2648
  }>>>;
2581
2649
  margin: z.ZodPipe<z.ZodObject<{
2582
2650
  total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2651
+ available_order_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2583
2652
  total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2584
2653
  total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2585
2654
  total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2586
2655
  }, z.core.$strip>, z.ZodTransform<{
2587
2656
  totalAccountValue: DecimalString;
2657
+ availableOrderMargin: DecimalString;
2588
2658
  totalInitialMargin: DecimalString;
2589
2659
  totalMaintenanceMargin: DecimalString;
2590
2660
  totalPositionValue: DecimalString;
2591
2661
  }, {
2592
2662
  total_account_value: DecimalString;
2663
+ available_order_margin: DecimalString;
2593
2664
  total_initial_margin: DecimalString;
2594
2665
  total_maintenance_margin: DecimalString;
2595
2666
  total_position_value: DecimalString;
2596
2667
  }>>;
2597
2668
  withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2598
2669
  in_liquidation: z.ZodBoolean;
2670
+ fee_tier: z.ZodNumber;
2599
2671
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2600
2672
  }, z.core.$strip>, z.ZodTransform<{
2601
2673
  positions: {
@@ -2612,15 +2684,18 @@ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2612
2684
  unrealizedPnl: DecimalString;
2613
2685
  returnOnEquity: DecimalString;
2614
2686
  cumulativeFunding: DecimalString;
2687
+ adlIndex: 0 | 1 | 2 | 3;
2615
2688
  }[];
2616
2689
  margin: {
2617
2690
  totalAccountValue: DecimalString;
2691
+ availableOrderMargin: DecimalString;
2618
2692
  totalInitialMargin: DecimalString;
2619
2693
  totalMaintenanceMargin: DecimalString;
2620
2694
  totalPositionValue: DecimalString;
2621
2695
  };
2622
2696
  withdrawable: DecimalString;
2623
2697
  inLiquidation: boolean;
2698
+ feeTier: number;
2624
2699
  timestamp: EpochMilliseconds;
2625
2700
  }, {
2626
2701
  positions: {
@@ -2637,21 +2712,26 @@ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2637
2712
  unrealizedPnl: DecimalString;
2638
2713
  returnOnEquity: DecimalString;
2639
2714
  cumulativeFunding: DecimalString;
2715
+ adlIndex: 0 | 1 | 2 | 3;
2640
2716
  }[];
2641
2717
  margin: {
2642
2718
  totalAccountValue: DecimalString;
2719
+ availableOrderMargin: DecimalString;
2643
2720
  totalInitialMargin: DecimalString;
2644
2721
  totalMaintenanceMargin: DecimalString;
2645
2722
  totalPositionValue: DecimalString;
2646
2723
  };
2647
2724
  withdrawable: DecimalString;
2648
2725
  in_liquidation: boolean;
2726
+ fee_tier: number;
2649
2727
  timestamp: EpochMilliseconds;
2650
2728
  }>>;
2651
2729
  }, z.core.$strip>, z.ZodTransform<{
2652
2730
  type: "portfolio";
2653
2731
  channel: "portfolio";
2654
2732
  timestamp: number;
2733
+ /** Newest reflected event time; null means the event horizon is unknown. */
2734
+ eventTimestamp: EpochMilliseconds | null;
2655
2735
  sequence: number;
2656
2736
  payload: {
2657
2737
  positions: {
@@ -2668,19 +2748,23 @@ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2668
2748
  unrealizedPnl: DecimalString;
2669
2749
  returnOnEquity: DecimalString;
2670
2750
  cumulativeFunding: DecimalString;
2751
+ adlIndex: 0 | 1 | 2 | 3;
2671
2752
  }[];
2672
2753
  margin: {
2673
2754
  totalAccountValue: DecimalString;
2755
+ availableOrderMargin: DecimalString;
2674
2756
  totalInitialMargin: DecimalString;
2675
2757
  totalMaintenanceMargin: DecimalString;
2676
2758
  totalPositionValue: DecimalString;
2677
2759
  };
2678
2760
  withdrawable: DecimalString;
2679
2761
  inLiquidation: boolean;
2762
+ feeTier: number;
2680
2763
  timestamp: EpochMilliseconds;
2681
2764
  };
2682
2765
  }, {
2683
2766
  ts: EpochMilliseconds;
2767
+ ets: EpochMilliseconds | null;
2684
2768
  sq: number;
2685
2769
  ch: "portfolio";
2686
2770
  data: {
@@ -2698,15 +2782,18 @@ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2698
2782
  unrealizedPnl: DecimalString;
2699
2783
  returnOnEquity: DecimalString;
2700
2784
  cumulativeFunding: DecimalString;
2785
+ adlIndex: 0 | 1 | 2 | 3;
2701
2786
  }[];
2702
2787
  margin: {
2703
2788
  totalAccountValue: DecimalString;
2789
+ availableOrderMargin: DecimalString;
2704
2790
  totalInitialMargin: DecimalString;
2705
2791
  totalMaintenanceMargin: DecimalString;
2706
2792
  totalPositionValue: DecimalString;
2707
2793
  };
2708
2794
  withdrawable: DecimalString;
2709
2795
  inLiquidation: boolean;
2796
+ feeTier: number;
2710
2797
  timestamp: EpochMilliseconds;
2711
2798
  };
2712
2799
  }>>;
@@ -2719,6 +2806,7 @@ type PerpsPortfolioUpdateEvent = z.infer<typeof PerpsPortfolioUpdateEventSchema>
2719
2806
  */
2720
2807
  declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2721
2808
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2809
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2722
2810
  sq: z.ZodNumber;
2723
2811
  ch: z.ZodLiteral<"orders">;
2724
2812
  data: z.ZodPipe<z.ZodObject<{
@@ -2736,6 +2824,7 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2736
2824
  cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2737
2825
  uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2738
2826
  coid: z.ZodOptional<z.ZodString>;
2827
+ chid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>>;
2739
2828
  tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
2740
2829
  kind: z.ZodEnum<typeof PerpsTpSlKind>;
2741
2830
  scope: z.ZodEnum<typeof PerpsTpSlScope>;
@@ -2743,6 +2832,10 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2743
2832
  parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
2744
2833
  armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2745
2834
  slip_bps: z.ZodOptional<z.ZodNumber>;
2835
+ trail_bps: z.ZodOptional<z.ZodNumber>;
2836
+ act: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2837
+ trail_anchor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2838
+ trail_active: z.ZodOptional<z.ZodBoolean>;
2746
2839
  }, z.core.$strip>, z.ZodTransform<{
2747
2840
  kind: PerpsTpSlKind;
2748
2841
  scope: PerpsTpSlScope;
@@ -2750,6 +2843,10 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2750
2843
  parentOrderId: PerpsOrderId | undefined;
2751
2844
  armedQuantity: DecimalString | undefined;
2752
2845
  slippageBps: number | undefined;
2846
+ trailingBps: number | undefined;
2847
+ activationPrice: DecimalString | undefined;
2848
+ trailingAnchor: DecimalString | undefined;
2849
+ trailingActive: boolean | undefined;
2753
2850
  }, {
2754
2851
  kind: PerpsTpSlKind;
2755
2852
  scope: PerpsTpSlScope;
@@ -2757,6 +2854,10 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2757
2854
  parent_oid?: PerpsOrderId | undefined;
2758
2855
  armed_qty?: DecimalString | undefined;
2759
2856
  slip_bps?: number | undefined;
2857
+ trail_bps?: number | undefined;
2858
+ act?: DecimalString | undefined;
2859
+ trail_anchor?: DecimalString | undefined;
2860
+ trail_active?: boolean | undefined;
2760
2861
  }>>>>;
2761
2862
  builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2762
2863
  address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
@@ -2773,6 +2874,19 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2773
2874
  address: _polymarket_types.EvmAddress;
2774
2875
  feeRate: DecimalString;
2775
2876
  } | undefined;
2877
+ tpSl: {
2878
+ kind: PerpsTpSlKind;
2879
+ scope: PerpsTpSlScope;
2880
+ triggerPrice: DecimalString;
2881
+ parentOrderId: PerpsOrderId | undefined;
2882
+ armedQuantity: DecimalString | undefined;
2883
+ slippageBps: number | undefined;
2884
+ trailingBps: number | undefined;
2885
+ activationPrice: DecimalString | undefined;
2886
+ trailingAnchor: DecimalString | undefined;
2887
+ trailingActive: boolean | undefined;
2888
+ } | undefined;
2889
+ chaseId?: PerpsChaseId | undefined;
2776
2890
  id: PerpsOrderId;
2777
2891
  instrumentId: PerpsInstrumentId;
2778
2892
  side: OrderSide;
@@ -2787,14 +2901,6 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2787
2901
  createdTimestamp: EpochMilliseconds;
2788
2902
  updatedTimestamp: EpochMilliseconds;
2789
2903
  clientOrderId: string | undefined;
2790
- tpSl: {
2791
- kind: PerpsTpSlKind;
2792
- scope: PerpsTpSlScope;
2793
- triggerPrice: DecimalString;
2794
- parentOrderId: PerpsOrderId | undefined;
2795
- armedQuantity: DecimalString | undefined;
2796
- slippageBps: number | undefined;
2797
- } | undefined;
2798
2904
  }, {
2799
2905
  oid: PerpsOrderId;
2800
2906
  iid: PerpsInstrumentId;
@@ -2810,6 +2916,7 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2810
2916
  cts: EpochMilliseconds;
2811
2917
  uts: EpochMilliseconds;
2812
2918
  coid?: string | undefined;
2919
+ chid?: PerpsChaseId | undefined;
2813
2920
  tpsl?: {
2814
2921
  kind: PerpsTpSlKind;
2815
2922
  scope: PerpsTpSlScope;
@@ -2817,6 +2924,10 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2817
2924
  parentOrderId: PerpsOrderId | undefined;
2818
2925
  armedQuantity: DecimalString | undefined;
2819
2926
  slippageBps: number | undefined;
2927
+ trailingBps: number | undefined;
2928
+ activationPrice: DecimalString | undefined;
2929
+ trailingAnchor: DecimalString | undefined;
2930
+ trailingActive: boolean | undefined;
2820
2931
  } | null | undefined;
2821
2932
  builder?: {
2822
2933
  address: _polymarket_types.EvmAddress;
@@ -2827,12 +2938,27 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2827
2938
  type: "order";
2828
2939
  channel: "orders";
2829
2940
  timestamp: number;
2941
+ /** Newest reflected event time; null means the event horizon is unknown. */
2942
+ eventTimestamp: EpochMilliseconds | null;
2830
2943
  sequence: number;
2831
2944
  payload: {
2832
2945
  builder?: {
2833
2946
  address: _polymarket_types.EvmAddress;
2834
2947
  feeRate: DecimalString;
2835
2948
  } | undefined;
2949
+ tpSl: {
2950
+ kind: PerpsTpSlKind;
2951
+ scope: PerpsTpSlScope;
2952
+ triggerPrice: DecimalString;
2953
+ parentOrderId: PerpsOrderId | undefined;
2954
+ armedQuantity: DecimalString | undefined;
2955
+ slippageBps: number | undefined;
2956
+ trailingBps: number | undefined;
2957
+ activationPrice: DecimalString | undefined;
2958
+ trailingAnchor: DecimalString | undefined;
2959
+ trailingActive: boolean | undefined;
2960
+ } | undefined;
2961
+ chaseId?: PerpsChaseId | undefined;
2836
2962
  id: PerpsOrderId;
2837
2963
  instrumentId: PerpsInstrumentId;
2838
2964
  side: OrderSide;
@@ -2847,17 +2973,10 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2847
2973
  createdTimestamp: EpochMilliseconds;
2848
2974
  updatedTimestamp: EpochMilliseconds;
2849
2975
  clientOrderId: string | undefined;
2850
- tpSl: {
2851
- kind: PerpsTpSlKind;
2852
- scope: PerpsTpSlScope;
2853
- triggerPrice: DecimalString;
2854
- parentOrderId: PerpsOrderId | undefined;
2855
- armedQuantity: DecimalString | undefined;
2856
- slippageBps: number | undefined;
2857
- } | undefined;
2858
2976
  };
2859
2977
  }, {
2860
2978
  ts: EpochMilliseconds;
2979
+ ets: EpochMilliseconds | null;
2861
2980
  sq: number;
2862
2981
  ch: "orders";
2863
2982
  data: {
@@ -2865,6 +2984,19 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2865
2984
  address: _polymarket_types.EvmAddress;
2866
2985
  feeRate: DecimalString;
2867
2986
  } | undefined;
2987
+ tpSl: {
2988
+ kind: PerpsTpSlKind;
2989
+ scope: PerpsTpSlScope;
2990
+ triggerPrice: DecimalString;
2991
+ parentOrderId: PerpsOrderId | undefined;
2992
+ armedQuantity: DecimalString | undefined;
2993
+ slippageBps: number | undefined;
2994
+ trailingBps: number | undefined;
2995
+ activationPrice: DecimalString | undefined;
2996
+ trailingAnchor: DecimalString | undefined;
2997
+ trailingActive: boolean | undefined;
2998
+ } | undefined;
2999
+ chaseId?: PerpsChaseId | undefined;
2868
3000
  id: PerpsOrderId;
2869
3001
  instrumentId: PerpsInstrumentId;
2870
3002
  side: OrderSide;
@@ -2879,14 +3011,6 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2879
3011
  createdTimestamp: EpochMilliseconds;
2880
3012
  updatedTimestamp: EpochMilliseconds;
2881
3013
  clientOrderId: string | undefined;
2882
- tpSl: {
2883
- kind: PerpsTpSlKind;
2884
- scope: PerpsTpSlScope;
2885
- triggerPrice: DecimalString;
2886
- parentOrderId: PerpsOrderId | undefined;
2887
- armedQuantity: DecimalString | undefined;
2888
- slippageBps: number | undefined;
2889
- } | undefined;
2890
3014
  };
2891
3015
  }>>;
2892
3016
  /**
@@ -2898,6 +3022,7 @@ type PerpsOrderUpdateEvent = z.infer<typeof PerpsOrderUpdateEventSchema>;
2898
3022
  */
2899
3023
  declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2900
3024
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3025
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
2901
3026
  sq: z.ZodNumber;
2902
3027
  ch: z.ZodLiteral<"fills">;
2903
3028
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
@@ -2905,6 +3030,7 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2905
3030
  oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
2906
3031
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2907
3032
  side: z.ZodEnum<typeof PerpsSide>;
3033
+ settlement: z.ZodDefault<z.ZodBoolean>;
2908
3034
  p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2909
3035
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2910
3036
  taker: z.ZodBoolean;
@@ -2926,6 +3052,20 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2926
3052
  pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2927
3053
  pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2928
3054
  liq: z.ZodBoolean;
3055
+ adl: z.ZodBoolean;
3056
+ liquidation_details: z.ZodOptional<z.ZodPipe<z.ZodObject<{
3057
+ liquidated_user: z.ZodOptional<z.ZodString>;
3058
+ mark: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
3059
+ method: z.ZodEnum<typeof PerpsLiquidationMethod>;
3060
+ }, z.core.$strip>, z.ZodTransform<{
3061
+ mark: DecimalString;
3062
+ method: PerpsLiquidationMethod;
3063
+ liquidatedUser?: string | undefined;
3064
+ }, {
3065
+ mark: DecimalString;
3066
+ method: PerpsLiquidationMethod;
3067
+ liquidated_user?: string | undefined;
3068
+ }>>>;
2929
3069
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2930
3070
  coid: z.ZodOptional<z.ZodString>;
2931
3071
  }, z.core.$strip>, z.ZodTransform<{
@@ -2934,6 +3074,12 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2934
3074
  previousEntryPrice: DecimalString;
2935
3075
  pnl: DecimalString;
2936
3076
  liquidation: boolean;
3077
+ adl: boolean;
3078
+ liquidationDetails: {
3079
+ mark: DecimalString;
3080
+ method: PerpsLiquidationMethod;
3081
+ liquidatedUser?: string | undefined;
3082
+ } | undefined;
2937
3083
  timestamp: EpochMilliseconds;
2938
3084
  clientOrderId: string | undefined;
2939
3085
  builder?: {
@@ -2944,6 +3090,7 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2944
3090
  orderId: PerpsOrderId;
2945
3091
  instrumentId: PerpsInstrumentId;
2946
3092
  side: PerpsSide;
3093
+ settlement: boolean;
2947
3094
  price: DecimalString;
2948
3095
  quantity: DecimalString;
2949
3096
  taker: boolean;
@@ -2955,6 +3102,7 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2955
3102
  oid: PerpsOrderId;
2956
3103
  iid: PerpsInstrumentId;
2957
3104
  side: PerpsSide;
3105
+ settlement: boolean;
2958
3106
  p: DecimalString;
2959
3107
  qty: DecimalString;
2960
3108
  taker: boolean;
@@ -2964,6 +3112,7 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2964
3112
  pep: DecimalString;
2965
3113
  pnl: DecimalString;
2966
3114
  liq: boolean;
3115
+ adl: boolean;
2967
3116
  ts: EpochMilliseconds;
2968
3117
  builder_fee?: DecimalString | undefined;
2969
3118
  total_fee?: DecimalString | undefined;
@@ -2971,12 +3120,19 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2971
3120
  address: _polymarket_types.EvmAddress;
2972
3121
  feeRate: DecimalString;
2973
3122
  } | undefined;
3123
+ liquidation_details?: {
3124
+ mark: DecimalString;
3125
+ method: PerpsLiquidationMethod;
3126
+ liquidatedUser?: string | undefined;
3127
+ } | undefined;
2974
3128
  coid?: string | undefined;
2975
3129
  }>>>;
2976
3130
  }, z.core.$strip>, z.ZodTransform<{
2977
3131
  type: "fill";
2978
3132
  channel: "fills";
2979
3133
  timestamp: number;
3134
+ /** Newest reflected event time; null means the event horizon is unknown. */
3135
+ eventTimestamp: EpochMilliseconds | null;
2980
3136
  sequence: number;
2981
3137
  payload: {
2982
3138
  feeAsset: string;
@@ -2984,6 +3140,12 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2984
3140
  previousEntryPrice: DecimalString;
2985
3141
  pnl: DecimalString;
2986
3142
  liquidation: boolean;
3143
+ adl: boolean;
3144
+ liquidationDetails: {
3145
+ mark: DecimalString;
3146
+ method: PerpsLiquidationMethod;
3147
+ liquidatedUser?: string | undefined;
3148
+ } | undefined;
2987
3149
  timestamp: EpochMilliseconds;
2988
3150
  clientOrderId: string | undefined;
2989
3151
  builder?: {
@@ -2994,6 +3156,7 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2994
3156
  orderId: PerpsOrderId;
2995
3157
  instrumentId: PerpsInstrumentId;
2996
3158
  side: PerpsSide;
3159
+ settlement: boolean;
2997
3160
  price: DecimalString;
2998
3161
  quantity: DecimalString;
2999
3162
  taker: boolean;
@@ -3003,6 +3166,7 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3003
3166
  }[];
3004
3167
  }, {
3005
3168
  ts: EpochMilliseconds;
3169
+ ets: EpochMilliseconds | null;
3006
3170
  sq: number;
3007
3171
  ch: "fills";
3008
3172
  data: {
@@ -3011,6 +3175,12 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3011
3175
  previousEntryPrice: DecimalString;
3012
3176
  pnl: DecimalString;
3013
3177
  liquidation: boolean;
3178
+ adl: boolean;
3179
+ liquidationDetails: {
3180
+ mark: DecimalString;
3181
+ method: PerpsLiquidationMethod;
3182
+ liquidatedUser?: string | undefined;
3183
+ } | undefined;
3014
3184
  timestamp: EpochMilliseconds;
3015
3185
  clientOrderId: string | undefined;
3016
3186
  builder?: {
@@ -3021,6 +3191,7 @@ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3021
3191
  orderId: PerpsOrderId;
3022
3192
  instrumentId: PerpsInstrumentId;
3023
3193
  side: PerpsSide;
3194
+ settlement: boolean;
3024
3195
  price: DecimalString;
3025
3196
  quantity: DecimalString;
3026
3197
  taker: boolean;
@@ -3039,6 +3210,7 @@ type PerpsFillUpdateEvent = z.infer<typeof PerpsFillUpdateEventSchema>;
3039
3210
  */
3040
3211
  declare const PerpsBuilderFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3041
3212
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3213
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3042
3214
  sq: z.ZodNumber;
3043
3215
  ch: z.ZodLiteral<"builderFills">;
3044
3216
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
@@ -3103,6 +3275,8 @@ declare const PerpsBuilderFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3103
3275
  type: "builderFill";
3104
3276
  channel: "builderFills";
3105
3277
  timestamp: EpochMilliseconds;
3278
+ /** Newest reflected event time; null means the event horizon is unknown. */
3279
+ eventTimestamp: EpochMilliseconds | null;
3106
3280
  sequence: number;
3107
3281
  payload: {
3108
3282
  liquidityRole: PerpsLiquidityRole;
@@ -3126,6 +3300,7 @@ declare const PerpsBuilderFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3126
3300
  }[];
3127
3301
  }, {
3128
3302
  ts: EpochMilliseconds;
3303
+ ets: EpochMilliseconds | null;
3129
3304
  sq: number;
3130
3305
  ch: "builderFills";
3131
3306
  data: {
@@ -3156,6 +3331,7 @@ type PerpsBuilderFillUpdateEvent = z.infer<typeof PerpsBuilderFillUpdateEventSch
3156
3331
  */
3157
3332
  declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3158
3333
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3334
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3159
3335
  sq: z.ZodNumber;
3160
3336
  ch: z.ZodLiteral<"funding">;
3161
3337
  data: z.ZodPipe<z.ZodObject<{
@@ -3187,6 +3363,8 @@ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3187
3363
  type: "funding";
3188
3364
  channel: "funding";
3189
3365
  timestamp: number;
3366
+ /** Newest reflected event time; null means the event horizon is unknown. */
3367
+ eventTimestamp: EpochMilliseconds | null;
3190
3368
  sequence: number;
3191
3369
  payload: {
3192
3370
  id: PerpsFundingPaymentId;
@@ -3199,6 +3377,7 @@ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3199
3377
  };
3200
3378
  }, {
3201
3379
  ts: EpochMilliseconds;
3380
+ ets: EpochMilliseconds | null;
3202
3381
  sq: number;
3203
3382
  ch: "funding";
3204
3383
  data: {
@@ -3220,6 +3399,7 @@ type PerpsFundingUpdateEvent = z.infer<typeof PerpsFundingUpdateEventSchema>;
3220
3399
  */
3221
3400
  declare const PerpsDepositUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3222
3401
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3402
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3223
3403
  sq: z.ZodNumber;
3224
3404
  ch: z.ZodLiteral<"deposits">;
3225
3405
  data: z.ZodPipe<z.ZodObject<{
@@ -3242,6 +3422,8 @@ declare const PerpsDepositUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3242
3422
  type: "deposit";
3243
3423
  channel: "deposits";
3244
3424
  timestamp: number;
3425
+ /** Newest reflected event time; null means the event horizon is unknown. */
3426
+ eventTimestamp: EpochMilliseconds | null;
3245
3427
  sequence: number;
3246
3428
  payload: {
3247
3429
  hash: _polymarket_types.TxHash | undefined;
@@ -3251,6 +3433,7 @@ declare const PerpsDepositUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3251
3433
  };
3252
3434
  }, {
3253
3435
  ts: EpochMilliseconds;
3436
+ ets: EpochMilliseconds | null;
3254
3437
  sq: number;
3255
3438
  ch: "deposits";
3256
3439
  data: {
@@ -3269,6 +3452,7 @@ type PerpsDepositUpdateEvent = z.infer<typeof PerpsDepositUpdateEventSchema>;
3269
3452
  */
3270
3453
  declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3271
3454
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3455
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3272
3456
  sq: z.ZodNumber;
3273
3457
  ch: z.ZodLiteral<"withdrawals">;
3274
3458
  data: z.ZodPipe<z.ZodObject<{
@@ -3300,6 +3484,8 @@ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3300
3484
  type: "withdrawal";
3301
3485
  channel: "withdrawals";
3302
3486
  timestamp: number;
3487
+ /** Newest reflected event time; null means the event horizon is unknown. */
3488
+ eventTimestamp: EpochMilliseconds | null;
3303
3489
  sequence: number;
3304
3490
  payload: {
3305
3491
  withdrawalId: PerpsWithdrawalId;
@@ -3312,6 +3498,7 @@ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3312
3498
  };
3313
3499
  }, {
3314
3500
  ts: EpochMilliseconds;
3501
+ ets: EpochMilliseconds | null;
3315
3502
  sq: number;
3316
3503
  ch: "withdrawals";
3317
3504
  data: {
@@ -3333,6 +3520,7 @@ type PerpsWithdrawalUpdateEvent = z.infer<typeof PerpsWithdrawalUpdateEventSchem
3333
3520
  */
3334
3521
  declare const PerpsNotificationUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3335
3522
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3523
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3336
3524
  sq: z.ZodNumber;
3337
3525
  ch: z.ZodLiteral<"notifications">;
3338
3526
  data: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<{
@@ -3482,11 +3670,40 @@ declare const PerpsNotificationUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3482
3670
  pnl: DecimalString | null;
3483
3671
  margin_type: PerpsMarginType;
3484
3672
  via_backstop: boolean;
3673
+ }>>, z.ZodPipe<z.ZodObject<{
3674
+ id: z.ZodPipe<z.ZodUUID, z.ZodTransform<PerpsNotificationId, string>>;
3675
+ type: z.ZodLiteral<PerpsNotificationType.PositionDeleveraged>;
3676
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3677
+ side: z.ZodEnum<typeof PerpsSide>;
3678
+ size_closed: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3679
+ price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3680
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3681
+ margin_type: z.ZodEnum<typeof PerpsMarginType>;
3682
+ }, z.core.$strip>, z.ZodTransform<{
3683
+ id: PerpsNotificationId;
3684
+ type: PerpsNotificationType.PositionDeleveraged;
3685
+ instrumentId: PerpsInstrumentId;
3686
+ side: PerpsSide;
3687
+ sizeClosed: DecimalString;
3688
+ price: DecimalString;
3689
+ pnl: DecimalString;
3690
+ marginType: PerpsMarginType;
3691
+ }, {
3692
+ id: PerpsNotificationId;
3693
+ type: PerpsNotificationType.PositionDeleveraged;
3694
+ instrument_id: PerpsInstrumentId;
3695
+ side: PerpsSide;
3696
+ size_closed: DecimalString;
3697
+ price: DecimalString;
3698
+ pnl: DecimalString;
3699
+ margin_type: PerpsMarginType;
3485
3700
  }>>], "type">;
3486
3701
  }, z.core.$strip>, z.ZodTransform<{
3487
3702
  type: "notification";
3488
3703
  channel: "notifications";
3489
3704
  timestamp: number;
3705
+ /** Newest reflected event time; null means the event horizon is unknown. */
3706
+ eventTimestamp: EpochMilliseconds | null;
3490
3707
  sequence: number;
3491
3708
  payload: {
3492
3709
  id: PerpsNotificationId;
@@ -3535,9 +3752,19 @@ declare const PerpsNotificationUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3535
3752
  pnl: DecimalString | null;
3536
3753
  marginType: PerpsMarginType;
3537
3754
  viaBackstop: boolean;
3755
+ } | {
3756
+ id: PerpsNotificationId;
3757
+ type: PerpsNotificationType.PositionDeleveraged;
3758
+ instrumentId: PerpsInstrumentId;
3759
+ side: PerpsSide;
3760
+ sizeClosed: DecimalString;
3761
+ price: DecimalString;
3762
+ pnl: DecimalString;
3763
+ marginType: PerpsMarginType;
3538
3764
  };
3539
3765
  }, {
3540
3766
  ts: EpochMilliseconds;
3767
+ ets: EpochMilliseconds | null;
3541
3768
  sq: number;
3542
3769
  ch: "notifications";
3543
3770
  data: {
@@ -3587,6 +3814,15 @@ declare const PerpsNotificationUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3587
3814
  pnl: DecimalString | null;
3588
3815
  marginType: PerpsMarginType;
3589
3816
  viaBackstop: boolean;
3817
+ } | {
3818
+ id: PerpsNotificationId;
3819
+ type: PerpsNotificationType.PositionDeleveraged;
3820
+ instrumentId: PerpsInstrumentId;
3821
+ side: PerpsSide;
3822
+ sizeClosed: DecimalString;
3823
+ price: DecimalString;
3824
+ pnl: DecimalString;
3825
+ marginType: PerpsMarginType;
3590
3826
  };
3591
3827
  }>>;
3592
3828
  /**
@@ -3603,16 +3839,21 @@ type PerpsNotificationUpdateEvent = z.infer<typeof PerpsNotificationUpdateEventS
3603
3839
  declare const PerpsNotificationsResyncFrameSchema: z.ZodPipe<z.ZodObject<{
3604
3840
  ch: z.ZodLiteral<"notifications">;
3605
3841
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3842
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3606
3843
  sq: z.ZodNumber;
3607
3844
  type: z.ZodLiteral<"resync">;
3608
3845
  }, z.core.$strip>, z.ZodTransform<{
3609
3846
  type: "resync";
3847
+ reason: "server";
3610
3848
  channel: "notifications";
3611
3849
  timestamp: EpochMilliseconds;
3850
+ /** Newest reflected event time; null means the event horizon is unknown. */
3851
+ eventTimestamp: EpochMilliseconds | null;
3612
3852
  sequence: number;
3613
3853
  }, {
3614
3854
  ch: "notifications";
3615
3855
  ts: EpochMilliseconds;
3856
+ ets: EpochMilliseconds | null;
3616
3857
  sq: number;
3617
3858
  type: "resync";
3618
3859
  }>>;
@@ -3621,6 +3862,7 @@ declare const PerpsNotificationsResyncFrameSchema: z.ZodPipe<z.ZodObject<{
3621
3862
  */
3622
3863
  declare const PerpsTpSlUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3623
3864
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3865
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3624
3866
  sq: z.ZodNumber;
3625
3867
  ch: z.ZodString;
3626
3868
  data: z.ZodPipe<z.ZodObject<{
@@ -3630,34 +3872,38 @@ declare const PerpsTpSlUpdateEventSchema: z.ZodPipe<z.ZodObject<{
3630
3872
  untriggered: "untriggered";
3631
3873
  armed: "armed";
3632
3874
  expired: "expired";
3875
+ activated: "activated";
3633
3876
  }>;
3634
3877
  reason: z.ZodOptional<z.ZodString>;
3635
3878
  }, z.core.$strip>, z.ZodTransform<{
3636
3879
  orderId: PerpsOrderId;
3637
- status: "cancelled" | "untriggered" | "armed" | "expired";
3880
+ status: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
3638
3881
  reason: string | undefined;
3639
3882
  }, {
3640
3883
  oid: PerpsOrderId;
3641
- st: "cancelled" | "untriggered" | "armed" | "expired";
3884
+ st: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
3642
3885
  reason?: string | undefined;
3643
3886
  }>>;
3644
3887
  }, z.core.$strip>, z.ZodTransform<{
3645
3888
  type: "tpsl";
3646
3889
  channel: string;
3647
3890
  timestamp: EpochMilliseconds;
3891
+ /** Newest reflected event time; null means the event horizon is unknown. */
3892
+ eventTimestamp: EpochMilliseconds | null;
3648
3893
  sequence: number;
3649
3894
  payload: {
3650
3895
  orderId: PerpsOrderId;
3651
- status: "cancelled" | "untriggered" | "armed" | "expired";
3896
+ status: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
3652
3897
  reason: string | undefined;
3653
3898
  };
3654
3899
  }, {
3655
3900
  ts: EpochMilliseconds;
3901
+ ets: EpochMilliseconds | null;
3656
3902
  sq: number;
3657
3903
  ch: string;
3658
3904
  data: {
3659
3905
  orderId: PerpsOrderId;
3660
- status: "cancelled" | "untriggered" | "armed" | "expired";
3906
+ status: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
3661
3907
  reason: string | undefined;
3662
3908
  };
3663
3909
  }>>;
@@ -3670,6 +3916,7 @@ type PerpsTpSlUpdateEvent = z.infer<typeof PerpsTpSlUpdateEventSchema>;
3670
3916
  */
3671
3917
  declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
3672
3918
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3919
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3673
3920
  sq: z.ZodNumber;
3674
3921
  ch: z.ZodLiteral<"balances">;
3675
3922
  data: z.ZodObject<{
@@ -3681,6 +3928,8 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3681
3928
  type: "balance";
3682
3929
  channel: "balances";
3683
3930
  timestamp: number;
3931
+ /** Newest reflected event time; null means the event horizon is unknown. */
3932
+ eventTimestamp: EpochMilliseconds | null;
3684
3933
  sequence: number;
3685
3934
  payload: {
3686
3935
  asset: string;
@@ -3689,6 +3938,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3689
3938
  };
3690
3939
  }, {
3691
3940
  ts: EpochMilliseconds;
3941
+ ets: EpochMilliseconds | null;
3692
3942
  sq: number;
3693
3943
  ch: "balances";
3694
3944
  data: {
@@ -3698,6 +3948,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3698
3948
  };
3699
3949
  }>>, z.ZodPipe<z.ZodObject<{
3700
3950
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3951
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3701
3952
  sq: z.ZodNumber;
3702
3953
  ch: z.ZodLiteral<"portfolio">;
3703
3954
  data: z.ZodPipe<z.ZodObject<{
@@ -3715,6 +3966,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3715
3966
  unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3716
3967
  return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3717
3968
  cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3969
+ adl_index: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
3718
3970
  }, z.core.$strip>, z.ZodTransform<{
3719
3971
  instrumentId: PerpsInstrumentId;
3720
3972
  symbol: string;
@@ -3729,6 +3981,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3729
3981
  unrealizedPnl: DecimalString;
3730
3982
  returnOnEquity: DecimalString;
3731
3983
  cumulativeFunding: DecimalString;
3984
+ adlIndex: 0 | 1 | 2 | 3;
3732
3985
  }, {
3733
3986
  instrument_id: PerpsInstrumentId;
3734
3987
  symbol: string;
@@ -3743,25 +3996,30 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3743
3996
  unrealized_pnl: DecimalString;
3744
3997
  return_on_equity: DecimalString;
3745
3998
  cumulative_funding: DecimalString;
3999
+ adl_index: 0 | 1 | 2 | 3;
3746
4000
  }>>>;
3747
4001
  margin: z.ZodPipe<z.ZodObject<{
3748
4002
  total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4003
+ available_order_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3749
4004
  total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3750
4005
  total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3751
4006
  total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3752
4007
  }, z.core.$strip>, z.ZodTransform<{
3753
4008
  totalAccountValue: DecimalString;
4009
+ availableOrderMargin: DecimalString;
3754
4010
  totalInitialMargin: DecimalString;
3755
4011
  totalMaintenanceMargin: DecimalString;
3756
4012
  totalPositionValue: DecimalString;
3757
4013
  }, {
3758
4014
  total_account_value: DecimalString;
4015
+ available_order_margin: DecimalString;
3759
4016
  total_initial_margin: DecimalString;
3760
4017
  total_maintenance_margin: DecimalString;
3761
4018
  total_position_value: DecimalString;
3762
4019
  }>>;
3763
4020
  withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3764
4021
  in_liquidation: z.ZodBoolean;
4022
+ fee_tier: z.ZodNumber;
3765
4023
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3766
4024
  }, z.core.$strip>, z.ZodTransform<{
3767
4025
  positions: {
@@ -3778,15 +4036,18 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3778
4036
  unrealizedPnl: DecimalString;
3779
4037
  returnOnEquity: DecimalString;
3780
4038
  cumulativeFunding: DecimalString;
4039
+ adlIndex: 0 | 1 | 2 | 3;
3781
4040
  }[];
3782
4041
  margin: {
3783
4042
  totalAccountValue: DecimalString;
4043
+ availableOrderMargin: DecimalString;
3784
4044
  totalInitialMargin: DecimalString;
3785
4045
  totalMaintenanceMargin: DecimalString;
3786
4046
  totalPositionValue: DecimalString;
3787
4047
  };
3788
4048
  withdrawable: DecimalString;
3789
4049
  inLiquidation: boolean;
4050
+ feeTier: number;
3790
4051
  timestamp: EpochMilliseconds;
3791
4052
  }, {
3792
4053
  positions: {
@@ -3803,21 +4064,26 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3803
4064
  unrealizedPnl: DecimalString;
3804
4065
  returnOnEquity: DecimalString;
3805
4066
  cumulativeFunding: DecimalString;
4067
+ adlIndex: 0 | 1 | 2 | 3;
3806
4068
  }[];
3807
4069
  margin: {
3808
4070
  totalAccountValue: DecimalString;
4071
+ availableOrderMargin: DecimalString;
3809
4072
  totalInitialMargin: DecimalString;
3810
4073
  totalMaintenanceMargin: DecimalString;
3811
4074
  totalPositionValue: DecimalString;
3812
4075
  };
3813
4076
  withdrawable: DecimalString;
3814
4077
  in_liquidation: boolean;
4078
+ fee_tier: number;
3815
4079
  timestamp: EpochMilliseconds;
3816
4080
  }>>;
3817
4081
  }, z.core.$strip>, z.ZodTransform<{
3818
4082
  type: "portfolio";
3819
4083
  channel: "portfolio";
3820
4084
  timestamp: number;
4085
+ /** Newest reflected event time; null means the event horizon is unknown. */
4086
+ eventTimestamp: EpochMilliseconds | null;
3821
4087
  sequence: number;
3822
4088
  payload: {
3823
4089
  positions: {
@@ -3834,19 +4100,23 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3834
4100
  unrealizedPnl: DecimalString;
3835
4101
  returnOnEquity: DecimalString;
3836
4102
  cumulativeFunding: DecimalString;
4103
+ adlIndex: 0 | 1 | 2 | 3;
3837
4104
  }[];
3838
4105
  margin: {
3839
4106
  totalAccountValue: DecimalString;
4107
+ availableOrderMargin: DecimalString;
3840
4108
  totalInitialMargin: DecimalString;
3841
4109
  totalMaintenanceMargin: DecimalString;
3842
4110
  totalPositionValue: DecimalString;
3843
4111
  };
3844
4112
  withdrawable: DecimalString;
3845
4113
  inLiquidation: boolean;
4114
+ feeTier: number;
3846
4115
  timestamp: EpochMilliseconds;
3847
4116
  };
3848
4117
  }, {
3849
4118
  ts: EpochMilliseconds;
4119
+ ets: EpochMilliseconds | null;
3850
4120
  sq: number;
3851
4121
  ch: "portfolio";
3852
4122
  data: {
@@ -3864,19 +4134,23 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3864
4134
  unrealizedPnl: DecimalString;
3865
4135
  returnOnEquity: DecimalString;
3866
4136
  cumulativeFunding: DecimalString;
4137
+ adlIndex: 0 | 1 | 2 | 3;
3867
4138
  }[];
3868
4139
  margin: {
3869
4140
  totalAccountValue: DecimalString;
4141
+ availableOrderMargin: DecimalString;
3870
4142
  totalInitialMargin: DecimalString;
3871
4143
  totalMaintenanceMargin: DecimalString;
3872
4144
  totalPositionValue: DecimalString;
3873
4145
  };
3874
4146
  withdrawable: DecimalString;
3875
4147
  inLiquidation: boolean;
4148
+ feeTier: number;
3876
4149
  timestamp: EpochMilliseconds;
3877
4150
  };
3878
4151
  }>>, z.ZodPipe<z.ZodObject<{
3879
4152
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4153
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
3880
4154
  sq: z.ZodNumber;
3881
4155
  ch: z.ZodLiteral<"orders">;
3882
4156
  data: z.ZodPipe<z.ZodObject<{
@@ -3894,6 +4168,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3894
4168
  cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3895
4169
  uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3896
4170
  coid: z.ZodOptional<z.ZodString>;
4171
+ chid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>>;
3897
4172
  tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
3898
4173
  kind: z.ZodEnum<typeof PerpsTpSlKind>;
3899
4174
  scope: z.ZodEnum<typeof PerpsTpSlScope>;
@@ -3901,6 +4176,10 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3901
4176
  parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
3902
4177
  armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
3903
4178
  slip_bps: z.ZodOptional<z.ZodNumber>;
4179
+ trail_bps: z.ZodOptional<z.ZodNumber>;
4180
+ act: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
4181
+ trail_anchor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
4182
+ trail_active: z.ZodOptional<z.ZodBoolean>;
3904
4183
  }, z.core.$strip>, z.ZodTransform<{
3905
4184
  kind: PerpsTpSlKind;
3906
4185
  scope: PerpsTpSlScope;
@@ -3908,6 +4187,10 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3908
4187
  parentOrderId: PerpsOrderId | undefined;
3909
4188
  armedQuantity: DecimalString | undefined;
3910
4189
  slippageBps: number | undefined;
4190
+ trailingBps: number | undefined;
4191
+ activationPrice: DecimalString | undefined;
4192
+ trailingAnchor: DecimalString | undefined;
4193
+ trailingActive: boolean | undefined;
3911
4194
  }, {
3912
4195
  kind: PerpsTpSlKind;
3913
4196
  scope: PerpsTpSlScope;
@@ -3915,6 +4198,10 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3915
4198
  parent_oid?: PerpsOrderId | undefined;
3916
4199
  armed_qty?: DecimalString | undefined;
3917
4200
  slip_bps?: number | undefined;
4201
+ trail_bps?: number | undefined;
4202
+ act?: DecimalString | undefined;
4203
+ trail_anchor?: DecimalString | undefined;
4204
+ trail_active?: boolean | undefined;
3918
4205
  }>>>>;
3919
4206
  builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
3920
4207
  address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
@@ -3931,6 +4218,19 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3931
4218
  address: _polymarket_types.EvmAddress;
3932
4219
  feeRate: DecimalString;
3933
4220
  } | undefined;
4221
+ tpSl: {
4222
+ kind: PerpsTpSlKind;
4223
+ scope: PerpsTpSlScope;
4224
+ triggerPrice: DecimalString;
4225
+ parentOrderId: PerpsOrderId | undefined;
4226
+ armedQuantity: DecimalString | undefined;
4227
+ slippageBps: number | undefined;
4228
+ trailingBps: number | undefined;
4229
+ activationPrice: DecimalString | undefined;
4230
+ trailingAnchor: DecimalString | undefined;
4231
+ trailingActive: boolean | undefined;
4232
+ } | undefined;
4233
+ chaseId?: PerpsChaseId | undefined;
3934
4234
  id: PerpsOrderId;
3935
4235
  instrumentId: PerpsInstrumentId;
3936
4236
  side: OrderSide;
@@ -3945,14 +4245,6 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3945
4245
  createdTimestamp: EpochMilliseconds;
3946
4246
  updatedTimestamp: EpochMilliseconds;
3947
4247
  clientOrderId: string | undefined;
3948
- tpSl: {
3949
- kind: PerpsTpSlKind;
3950
- scope: PerpsTpSlScope;
3951
- triggerPrice: DecimalString;
3952
- parentOrderId: PerpsOrderId | undefined;
3953
- armedQuantity: DecimalString | undefined;
3954
- slippageBps: number | undefined;
3955
- } | undefined;
3956
4248
  }, {
3957
4249
  oid: PerpsOrderId;
3958
4250
  iid: PerpsInstrumentId;
@@ -3968,6 +4260,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3968
4260
  cts: EpochMilliseconds;
3969
4261
  uts: EpochMilliseconds;
3970
4262
  coid?: string | undefined;
4263
+ chid?: PerpsChaseId | undefined;
3971
4264
  tpsl?: {
3972
4265
  kind: PerpsTpSlKind;
3973
4266
  scope: PerpsTpSlScope;
@@ -3975,6 +4268,10 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3975
4268
  parentOrderId: PerpsOrderId | undefined;
3976
4269
  armedQuantity: DecimalString | undefined;
3977
4270
  slippageBps: number | undefined;
4271
+ trailingBps: number | undefined;
4272
+ activationPrice: DecimalString | undefined;
4273
+ trailingAnchor: DecimalString | undefined;
4274
+ trailingActive: boolean | undefined;
3978
4275
  } | null | undefined;
3979
4276
  builder?: {
3980
4277
  address: _polymarket_types.EvmAddress;
@@ -3985,12 +4282,27 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3985
4282
  type: "order";
3986
4283
  channel: "orders";
3987
4284
  timestamp: number;
4285
+ /** Newest reflected event time; null means the event horizon is unknown. */
4286
+ eventTimestamp: EpochMilliseconds | null;
3988
4287
  sequence: number;
3989
4288
  payload: {
3990
4289
  builder?: {
3991
4290
  address: _polymarket_types.EvmAddress;
3992
4291
  feeRate: DecimalString;
3993
4292
  } | undefined;
4293
+ tpSl: {
4294
+ kind: PerpsTpSlKind;
4295
+ scope: PerpsTpSlScope;
4296
+ triggerPrice: DecimalString;
4297
+ parentOrderId: PerpsOrderId | undefined;
4298
+ armedQuantity: DecimalString | undefined;
4299
+ slippageBps: number | undefined;
4300
+ trailingBps: number | undefined;
4301
+ activationPrice: DecimalString | undefined;
4302
+ trailingAnchor: DecimalString | undefined;
4303
+ trailingActive: boolean | undefined;
4304
+ } | undefined;
4305
+ chaseId?: PerpsChaseId | undefined;
3994
4306
  id: PerpsOrderId;
3995
4307
  instrumentId: PerpsInstrumentId;
3996
4308
  side: OrderSide;
@@ -4005,17 +4317,10 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4005
4317
  createdTimestamp: EpochMilliseconds;
4006
4318
  updatedTimestamp: EpochMilliseconds;
4007
4319
  clientOrderId: string | undefined;
4008
- tpSl: {
4009
- kind: PerpsTpSlKind;
4010
- scope: PerpsTpSlScope;
4011
- triggerPrice: DecimalString;
4012
- parentOrderId: PerpsOrderId | undefined;
4013
- armedQuantity: DecimalString | undefined;
4014
- slippageBps: number | undefined;
4015
- } | undefined;
4016
4320
  };
4017
4321
  }, {
4018
4322
  ts: EpochMilliseconds;
4323
+ ets: EpochMilliseconds | null;
4019
4324
  sq: number;
4020
4325
  ch: "orders";
4021
4326
  data: {
@@ -4023,6 +4328,19 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4023
4328
  address: _polymarket_types.EvmAddress;
4024
4329
  feeRate: DecimalString;
4025
4330
  } | undefined;
4331
+ tpSl: {
4332
+ kind: PerpsTpSlKind;
4333
+ scope: PerpsTpSlScope;
4334
+ triggerPrice: DecimalString;
4335
+ parentOrderId: PerpsOrderId | undefined;
4336
+ armedQuantity: DecimalString | undefined;
4337
+ slippageBps: number | undefined;
4338
+ trailingBps: number | undefined;
4339
+ activationPrice: DecimalString | undefined;
4340
+ trailingAnchor: DecimalString | undefined;
4341
+ trailingActive: boolean | undefined;
4342
+ } | undefined;
4343
+ chaseId?: PerpsChaseId | undefined;
4026
4344
  id: PerpsOrderId;
4027
4345
  instrumentId: PerpsInstrumentId;
4028
4346
  side: OrderSide;
@@ -4037,17 +4355,10 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4037
4355
  createdTimestamp: EpochMilliseconds;
4038
4356
  updatedTimestamp: EpochMilliseconds;
4039
4357
  clientOrderId: string | undefined;
4040
- tpSl: {
4041
- kind: PerpsTpSlKind;
4042
- scope: PerpsTpSlScope;
4043
- triggerPrice: DecimalString;
4044
- parentOrderId: PerpsOrderId | undefined;
4045
- armedQuantity: DecimalString | undefined;
4046
- slippageBps: number | undefined;
4047
- } | undefined;
4048
4358
  };
4049
4359
  }>>, z.ZodPipe<z.ZodObject<{
4050
4360
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4361
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
4051
4362
  sq: z.ZodNumber;
4052
4363
  ch: z.ZodLiteral<"fills">;
4053
4364
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
@@ -4055,6 +4366,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4055
4366
  oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
4056
4367
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
4057
4368
  side: z.ZodEnum<typeof PerpsSide>;
4369
+ settlement: z.ZodDefault<z.ZodBoolean>;
4058
4370
  p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4059
4371
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4060
4372
  taker: z.ZodBoolean;
@@ -4076,6 +4388,20 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4076
4388
  pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4077
4389
  pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4078
4390
  liq: z.ZodBoolean;
4391
+ adl: z.ZodBoolean;
4392
+ liquidation_details: z.ZodOptional<z.ZodPipe<z.ZodObject<{
4393
+ liquidated_user: z.ZodOptional<z.ZodString>;
4394
+ mark: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
4395
+ method: z.ZodEnum<typeof PerpsLiquidationMethod>;
4396
+ }, z.core.$strip>, z.ZodTransform<{
4397
+ mark: DecimalString;
4398
+ method: PerpsLiquidationMethod;
4399
+ liquidatedUser?: string | undefined;
4400
+ }, {
4401
+ mark: DecimalString;
4402
+ method: PerpsLiquidationMethod;
4403
+ liquidated_user?: string | undefined;
4404
+ }>>>;
4079
4405
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4080
4406
  coid: z.ZodOptional<z.ZodString>;
4081
4407
  }, z.core.$strip>, z.ZodTransform<{
@@ -4084,6 +4410,12 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4084
4410
  previousEntryPrice: DecimalString;
4085
4411
  pnl: DecimalString;
4086
4412
  liquidation: boolean;
4413
+ adl: boolean;
4414
+ liquidationDetails: {
4415
+ mark: DecimalString;
4416
+ method: PerpsLiquidationMethod;
4417
+ liquidatedUser?: string | undefined;
4418
+ } | undefined;
4087
4419
  timestamp: EpochMilliseconds;
4088
4420
  clientOrderId: string | undefined;
4089
4421
  builder?: {
@@ -4094,6 +4426,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4094
4426
  orderId: PerpsOrderId;
4095
4427
  instrumentId: PerpsInstrumentId;
4096
4428
  side: PerpsSide;
4429
+ settlement: boolean;
4097
4430
  price: DecimalString;
4098
4431
  quantity: DecimalString;
4099
4432
  taker: boolean;
@@ -4105,6 +4438,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4105
4438
  oid: PerpsOrderId;
4106
4439
  iid: PerpsInstrumentId;
4107
4440
  side: PerpsSide;
4441
+ settlement: boolean;
4108
4442
  p: DecimalString;
4109
4443
  qty: DecimalString;
4110
4444
  taker: boolean;
@@ -4114,6 +4448,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4114
4448
  pep: DecimalString;
4115
4449
  pnl: DecimalString;
4116
4450
  liq: boolean;
4451
+ adl: boolean;
4117
4452
  ts: EpochMilliseconds;
4118
4453
  builder_fee?: DecimalString | undefined;
4119
4454
  total_fee?: DecimalString | undefined;
@@ -4121,12 +4456,19 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4121
4456
  address: _polymarket_types.EvmAddress;
4122
4457
  feeRate: DecimalString;
4123
4458
  } | undefined;
4459
+ liquidation_details?: {
4460
+ mark: DecimalString;
4461
+ method: PerpsLiquidationMethod;
4462
+ liquidatedUser?: string | undefined;
4463
+ } | undefined;
4124
4464
  coid?: string | undefined;
4125
4465
  }>>>;
4126
4466
  }, z.core.$strip>, z.ZodTransform<{
4127
4467
  type: "fill";
4128
4468
  channel: "fills";
4129
4469
  timestamp: number;
4470
+ /** Newest reflected event time; null means the event horizon is unknown. */
4471
+ eventTimestamp: EpochMilliseconds | null;
4130
4472
  sequence: number;
4131
4473
  payload: {
4132
4474
  feeAsset: string;
@@ -4134,6 +4476,12 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4134
4476
  previousEntryPrice: DecimalString;
4135
4477
  pnl: DecimalString;
4136
4478
  liquidation: boolean;
4479
+ adl: boolean;
4480
+ liquidationDetails: {
4481
+ mark: DecimalString;
4482
+ method: PerpsLiquidationMethod;
4483
+ liquidatedUser?: string | undefined;
4484
+ } | undefined;
4137
4485
  timestamp: EpochMilliseconds;
4138
4486
  clientOrderId: string | undefined;
4139
4487
  builder?: {
@@ -4144,6 +4492,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4144
4492
  orderId: PerpsOrderId;
4145
4493
  instrumentId: PerpsInstrumentId;
4146
4494
  side: PerpsSide;
4495
+ settlement: boolean;
4147
4496
  price: DecimalString;
4148
4497
  quantity: DecimalString;
4149
4498
  taker: boolean;
@@ -4153,6 +4502,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4153
4502
  }[];
4154
4503
  }, {
4155
4504
  ts: EpochMilliseconds;
4505
+ ets: EpochMilliseconds | null;
4156
4506
  sq: number;
4157
4507
  ch: "fills";
4158
4508
  data: {
@@ -4161,6 +4511,12 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4161
4511
  previousEntryPrice: DecimalString;
4162
4512
  pnl: DecimalString;
4163
4513
  liquidation: boolean;
4514
+ adl: boolean;
4515
+ liquidationDetails: {
4516
+ mark: DecimalString;
4517
+ method: PerpsLiquidationMethod;
4518
+ liquidatedUser?: string | undefined;
4519
+ } | undefined;
4164
4520
  timestamp: EpochMilliseconds;
4165
4521
  clientOrderId: string | undefined;
4166
4522
  builder?: {
@@ -4171,6 +4527,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4171
4527
  orderId: PerpsOrderId;
4172
4528
  instrumentId: PerpsInstrumentId;
4173
4529
  side: PerpsSide;
4530
+ settlement: boolean;
4174
4531
  price: DecimalString;
4175
4532
  quantity: DecimalString;
4176
4533
  taker: boolean;
@@ -4180,6 +4537,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4180
4537
  }[];
4181
4538
  }>>, z.ZodPipe<z.ZodObject<{
4182
4539
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4540
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
4183
4541
  sq: z.ZodNumber;
4184
4542
  ch: z.ZodLiteral<"builderFills">;
4185
4543
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
@@ -4244,6 +4602,8 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4244
4602
  type: "builderFill";
4245
4603
  channel: "builderFills";
4246
4604
  timestamp: EpochMilliseconds;
4605
+ /** Newest reflected event time; null means the event horizon is unknown. */
4606
+ eventTimestamp: EpochMilliseconds | null;
4247
4607
  sequence: number;
4248
4608
  payload: {
4249
4609
  liquidityRole: PerpsLiquidityRole;
@@ -4267,6 +4627,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4267
4627
  }[];
4268
4628
  }, {
4269
4629
  ts: EpochMilliseconds;
4630
+ ets: EpochMilliseconds | null;
4270
4631
  sq: number;
4271
4632
  ch: "builderFills";
4272
4633
  data: {
@@ -4291,6 +4652,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4291
4652
  }[];
4292
4653
  }>>, z.ZodPipe<z.ZodObject<{
4293
4654
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4655
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
4294
4656
  sq: z.ZodNumber;
4295
4657
  ch: z.ZodLiteral<"funding">;
4296
4658
  data: z.ZodPipe<z.ZodObject<{
@@ -4322,6 +4684,8 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4322
4684
  type: "funding";
4323
4685
  channel: "funding";
4324
4686
  timestamp: number;
4687
+ /** Newest reflected event time; null means the event horizon is unknown. */
4688
+ eventTimestamp: EpochMilliseconds | null;
4325
4689
  sequence: number;
4326
4690
  payload: {
4327
4691
  id: PerpsFundingPaymentId;
@@ -4334,6 +4698,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4334
4698
  };
4335
4699
  }, {
4336
4700
  ts: EpochMilliseconds;
4701
+ ets: EpochMilliseconds | null;
4337
4702
  sq: number;
4338
4703
  ch: "funding";
4339
4704
  data: {
@@ -4347,6 +4712,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4347
4712
  };
4348
4713
  }>>, z.ZodPipe<z.ZodObject<{
4349
4714
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4715
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
4350
4716
  sq: z.ZodNumber;
4351
4717
  ch: z.ZodLiteral<"deposits">;
4352
4718
  data: z.ZodPipe<z.ZodObject<{
@@ -4369,6 +4735,8 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4369
4735
  type: "deposit";
4370
4736
  channel: "deposits";
4371
4737
  timestamp: number;
4738
+ /** Newest reflected event time; null means the event horizon is unknown. */
4739
+ eventTimestamp: EpochMilliseconds | null;
4372
4740
  sequence: number;
4373
4741
  payload: {
4374
4742
  hash: _polymarket_types.TxHash | undefined;
@@ -4378,6 +4746,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4378
4746
  };
4379
4747
  }, {
4380
4748
  ts: EpochMilliseconds;
4749
+ ets: EpochMilliseconds | null;
4381
4750
  sq: number;
4382
4751
  ch: "deposits";
4383
4752
  data: {
@@ -4388,6 +4757,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4388
4757
  };
4389
4758
  }>>, z.ZodPipe<z.ZodObject<{
4390
4759
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4760
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
4391
4761
  sq: z.ZodNumber;
4392
4762
  ch: z.ZodLiteral<"withdrawals">;
4393
4763
  data: z.ZodPipe<z.ZodObject<{
@@ -4419,6 +4789,8 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4419
4789
  type: "withdrawal";
4420
4790
  channel: "withdrawals";
4421
4791
  timestamp: number;
4792
+ /** Newest reflected event time; null means the event horizon is unknown. */
4793
+ eventTimestamp: EpochMilliseconds | null;
4422
4794
  sequence: number;
4423
4795
  payload: {
4424
4796
  withdrawalId: PerpsWithdrawalId;
@@ -4431,6 +4803,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4431
4803
  };
4432
4804
  }, {
4433
4805
  ts: EpochMilliseconds;
4806
+ ets: EpochMilliseconds | null;
4434
4807
  sq: number;
4435
4808
  ch: "withdrawals";
4436
4809
  data: {
@@ -4444,6 +4817,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4444
4817
  };
4445
4818
  }>>, z.ZodPipe<z.ZodObject<{
4446
4819
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4820
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
4447
4821
  sq: z.ZodNumber;
4448
4822
  ch: z.ZodLiteral<"notifications">;
4449
4823
  data: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<{
@@ -4593,11 +4967,40 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4593
4967
  pnl: DecimalString | null;
4594
4968
  margin_type: PerpsMarginType;
4595
4969
  via_backstop: boolean;
4970
+ }>>, z.ZodPipe<z.ZodObject<{
4971
+ id: z.ZodPipe<z.ZodUUID, z.ZodTransform<PerpsNotificationId, string>>;
4972
+ type: z.ZodLiteral<PerpsNotificationType.PositionDeleveraged>;
4973
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
4974
+ side: z.ZodEnum<typeof PerpsSide>;
4975
+ size_closed: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4976
+ price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4977
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4978
+ margin_type: z.ZodEnum<typeof PerpsMarginType>;
4979
+ }, z.core.$strip>, z.ZodTransform<{
4980
+ id: PerpsNotificationId;
4981
+ type: PerpsNotificationType.PositionDeleveraged;
4982
+ instrumentId: PerpsInstrumentId;
4983
+ side: PerpsSide;
4984
+ sizeClosed: DecimalString;
4985
+ price: DecimalString;
4986
+ pnl: DecimalString;
4987
+ marginType: PerpsMarginType;
4988
+ }, {
4989
+ id: PerpsNotificationId;
4990
+ type: PerpsNotificationType.PositionDeleveraged;
4991
+ instrument_id: PerpsInstrumentId;
4992
+ side: PerpsSide;
4993
+ size_closed: DecimalString;
4994
+ price: DecimalString;
4995
+ pnl: DecimalString;
4996
+ margin_type: PerpsMarginType;
4596
4997
  }>>], "type">;
4597
4998
  }, z.core.$strip>, z.ZodTransform<{
4598
4999
  type: "notification";
4599
5000
  channel: "notifications";
4600
5001
  timestamp: number;
5002
+ /** Newest reflected event time; null means the event horizon is unknown. */
5003
+ eventTimestamp: EpochMilliseconds | null;
4601
5004
  sequence: number;
4602
5005
  payload: {
4603
5006
  id: PerpsNotificationId;
@@ -4646,9 +5049,19 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4646
5049
  pnl: DecimalString | null;
4647
5050
  marginType: PerpsMarginType;
4648
5051
  viaBackstop: boolean;
5052
+ } | {
5053
+ id: PerpsNotificationId;
5054
+ type: PerpsNotificationType.PositionDeleveraged;
5055
+ instrumentId: PerpsInstrumentId;
5056
+ side: PerpsSide;
5057
+ sizeClosed: DecimalString;
5058
+ price: DecimalString;
5059
+ pnl: DecimalString;
5060
+ marginType: PerpsMarginType;
4649
5061
  };
4650
5062
  }, {
4651
5063
  ts: EpochMilliseconds;
5064
+ ets: EpochMilliseconds | null;
4652
5065
  sq: number;
4653
5066
  ch: "notifications";
4654
5067
  data: {
@@ -4698,9 +5111,19 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4698
5111
  pnl: DecimalString | null;
4699
5112
  marginType: PerpsMarginType;
4700
5113
  viaBackstop: boolean;
5114
+ } | {
5115
+ id: PerpsNotificationId;
5116
+ type: PerpsNotificationType.PositionDeleveraged;
5117
+ instrumentId: PerpsInstrumentId;
5118
+ side: PerpsSide;
5119
+ sizeClosed: DecimalString;
5120
+ price: DecimalString;
5121
+ pnl: DecimalString;
5122
+ marginType: PerpsMarginType;
4701
5123
  };
4702
5124
  }>>, z.ZodPipe<z.ZodObject<{
4703
5125
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5126
+ ets: z.ZodPipe<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodTransform<EpochMilliseconds | null, EpochMilliseconds>>;
4704
5127
  sq: z.ZodNumber;
4705
5128
  ch: z.ZodString;
4706
5129
  data: z.ZodPipe<z.ZodObject<{
@@ -4710,34 +5133,38 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4710
5133
  untriggered: "untriggered";
4711
5134
  armed: "armed";
4712
5135
  expired: "expired";
5136
+ activated: "activated";
4713
5137
  }>;
4714
5138
  reason: z.ZodOptional<z.ZodString>;
4715
5139
  }, z.core.$strip>, z.ZodTransform<{
4716
5140
  orderId: PerpsOrderId;
4717
- status: "cancelled" | "untriggered" | "armed" | "expired";
5141
+ status: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
4718
5142
  reason: string | undefined;
4719
5143
  }, {
4720
5144
  oid: PerpsOrderId;
4721
- st: "cancelled" | "untriggered" | "armed" | "expired";
5145
+ st: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
4722
5146
  reason?: string | undefined;
4723
5147
  }>>;
4724
5148
  }, z.core.$strip>, z.ZodTransform<{
4725
5149
  type: "tpsl";
4726
5150
  channel: string;
4727
5151
  timestamp: EpochMilliseconds;
5152
+ /** Newest reflected event time; null means the event horizon is unknown. */
5153
+ eventTimestamp: EpochMilliseconds | null;
4728
5154
  sequence: number;
4729
5155
  payload: {
4730
5156
  orderId: PerpsOrderId;
4731
- status: "cancelled" | "untriggered" | "armed" | "expired";
5157
+ status: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
4732
5158
  reason: string | undefined;
4733
5159
  };
4734
5160
  }, {
4735
5161
  ts: EpochMilliseconds;
5162
+ ets: EpochMilliseconds | null;
4736
5163
  sq: number;
4737
5164
  ch: string;
4738
5165
  data: {
4739
5166
  orderId: PerpsOrderId;
4740
- status: "cancelled" | "untriggered" | "armed" | "expired";
5167
+ status: "cancelled" | "untriggered" | "armed" | "expired" | "activated";
4741
5168
  reason: string | undefined;
4742
5169
  };
4743
5170
  }>>]>;
@@ -4746,15 +5173,24 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
4746
5173
  */
4747
5174
  type PerpsSessionUpdateEvent = z.infer<typeof PerpsSessionUpdateEventSchema>;
4748
5175
  /**
5176
+ * A recovery signal after reconnect, a sequence gap, or dropped notifications.
5177
+ * For `reason: 'server'`, `sequence` is the highest dropped notification
5178
+ * sequence, not a backfill lower bound. Backfill from the last notification
5179
+ * successfully processed and deduplicate by notification id.
5180
+ *
4749
5181
  * @experimental This API may change in a breaking way in any release, including patch releases.
4750
5182
  */
4751
5183
  type PerpsResyncEvent = {
4752
5184
  type: 'resync';
4753
5185
  reason: 'reconnect' | 'sequence_gap';
5186
+ /** Local recovery has no attested event horizon. */
5187
+ eventTimestamp?: never;
4754
5188
  channel?: string;
4755
5189
  previousSequence?: number;
4756
5190
  sequence?: number;
4757
- };
5191
+ } | (z.infer<typeof PerpsNotificationsResyncFrameSchema> & {
5192
+ previousSequence?: never;
5193
+ });
4758
5194
  /**
4759
5195
  * @experimental This API may change in a breaking way in any release, including patch releases.
4760
5196
  */
@@ -4778,15 +5214,42 @@ declare enum RealtimeKnownErrorCode {
4778
5214
  * before a client release that enumerates them.
4779
5215
  */
4780
5216
  type RealtimeErrorCode = RealtimeKnownErrorCode | (string & {});
5217
+ /** Known sources reported by realtime price events. */
5218
+ declare enum KnownPriceSource {
5219
+ Pyth = "pyth",
5220
+ Chainlink = "chainlink",
5221
+ Massive = "massive"
5222
+ }
5223
+ /**
5224
+ * The source of a realtime price. Known values are enumerated in
5225
+ * {@link KnownPriceSource}; newly introduced sources remain available as strings.
5226
+ */
5227
+ type PriceSource = KnownPriceSource | (string & {});
5228
+ /**
5229
+ * Market state of the instrument priced by an equity provider.
5230
+ * Unknown means the provider cannot determine the state; omission means not stated.
5231
+ */
5232
+ declare enum EquityMarketStatus {
5233
+ Open = "open",
5234
+ Closed = "closed",
5235
+ Unknown = "unknown"
5236
+ }
4781
5237
  declare enum PolyboltChannel {
4782
5238
  Crypto = "price.crypto",
4783
5239
  Twap = "price.crypto.twap",
4784
- Equity = "price.equity"
5240
+ Equity = "price.equity",
5241
+ EquityTwap = "price.equity.twap"
5242
+ }
5243
+ /** A provider that can be requested for a price subscription. */
5244
+ declare enum PriceProvider {
5245
+ Chainlink = "chainlink",
5246
+ Pyth = "pyth"
4785
5247
  }
4786
5248
  /** A filter sent to a PolyBolt price channel. */
4787
5249
  type PolyboltFilter = {
4788
5250
  symbol: string;
4789
5251
  window_seconds?: 60;
5252
+ provider?: PriceProvider;
4790
5253
  } | {
4791
5254
  asset_id: string;
4792
5255
  };
@@ -4806,6 +5269,7 @@ declare const PolyboltAckSchema: z.ZodObject<{
4806
5269
  op: z.ZodEnum<typeof PolyboltAckOp>;
4807
5270
  channel: z.ZodOptional<z.ZodString>;
4808
5271
  rid: z.ZodOptional<z.ZodString>;
5272
+ provider: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>>;
4809
5273
  code: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | RealtimeKnownErrorCode, string>>>;
4810
5274
  }, z.core.$strip>;
4811
5275
  type PolyboltAck = z.infer<typeof PolyboltAckSchema>;
@@ -4827,6 +5291,7 @@ declare const CryptoPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4827
5291
  type: z.ZodLiteral<"update">;
4828
5292
  payload: z.ZodPipe<z.ZodObject<{
4829
5293
  symbol: z.ZodString;
5294
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
4830
5295
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4831
5296
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4832
5297
  full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -4834,12 +5299,14 @@ declare const CryptoPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4834
5299
  is_carried_forward: z.ZodOptional<z.ZodBoolean>;
4835
5300
  }, z.core.$strip>, z.ZodTransform<{
4836
5301
  symbol: string;
5302
+ source: (string & {}) | KnownPriceSource;
4837
5303
  timestamp: EpochMilliseconds;
4838
5304
  value: DecimalString;
4839
5305
  receivedAt: EpochMilliseconds | undefined;
4840
5306
  isCarriedForward: boolean | undefined;
4841
5307
  }, {
4842
5308
  symbol: string;
5309
+ source: (string & {}) | KnownPriceSource;
4843
5310
  timestamp: EpochMilliseconds;
4844
5311
  value: DecimalString;
4845
5312
  full_accuracy_value: DecimalString;
@@ -4854,6 +5321,7 @@ declare const CryptoPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4854
5321
  type: z.ZodLiteral<"subscribe">;
4855
5322
  payload: z.ZodObject<{
4856
5323
  symbol: z.ZodString;
5324
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
4857
5325
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
4858
5326
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4859
5327
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
@@ -4887,17 +5355,20 @@ declare const CryptoTwapPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4887
5355
  type: z.ZodLiteral<"update">;
4888
5356
  payload: z.ZodPipe<z.ZodObject<{
4889
5357
  symbol: z.ZodString;
5358
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
4890
5359
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4891
5360
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4892
5361
  full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4893
5362
  window_seconds: z.ZodLiteral<60>;
4894
5363
  }, z.core.$strip>, z.ZodTransform<{
4895
5364
  symbol: string;
5365
+ source: (string & {}) | KnownPriceSource;
4896
5366
  timestamp: EpochMilliseconds;
4897
5367
  value: DecimalString;
4898
5368
  windowSeconds: 60;
4899
5369
  }, {
4900
5370
  symbol: string;
5371
+ source: (string & {}) | KnownPriceSource;
4901
5372
  timestamp: EpochMilliseconds;
4902
5373
  value: DecimalString;
4903
5374
  full_accuracy_value: DecimalString;
@@ -4911,6 +5382,7 @@ declare const CryptoTwapPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4911
5382
  type: z.ZodLiteral<"subscribe">;
4912
5383
  payload: z.ZodPipe<z.ZodObject<{
4913
5384
  symbol: z.ZodString;
5385
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
4914
5386
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
4915
5387
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4916
5388
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
@@ -4926,6 +5398,7 @@ declare const CryptoTwapPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4926
5398
  window_seconds: z.ZodLiteral<60>;
4927
5399
  }, z.core.$strip>, z.ZodTransform<{
4928
5400
  symbol: string;
5401
+ source: (string & {}) | KnownPriceSource;
4929
5402
  data: {
4930
5403
  timestamp: EpochMilliseconds;
4931
5404
  value: DecimalString;
@@ -4933,6 +5406,7 @@ declare const CryptoTwapPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4933
5406
  windowSeconds: 60;
4934
5407
  }, {
4935
5408
  symbol: string;
5409
+ source: (string & {}) | KnownPriceSource;
4936
5410
  data: {
4937
5411
  timestamp: EpochMilliseconds;
4938
5412
  value: DecimalString;
@@ -4957,8 +5431,9 @@ declare const EquityPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4957
5431
  dropped: z.ZodOptional<z.ZodNumber>;
4958
5432
  topic: z.ZodLiteral<"prices.equity">;
4959
5433
  type: z.ZodLiteral<"update">;
4960
- payload: z.ZodPipe<z.ZodObject<{
5434
+ payload: z.ZodIntersection<z.ZodPipe<z.ZodObject<{
4961
5435
  symbol: z.ZodString;
5436
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
4962
5437
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4963
5438
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4964
5439
  full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -4966,26 +5441,35 @@ declare const EquityPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4966
5441
  is_carried_forward: z.ZodOptional<z.ZodBoolean>;
4967
5442
  }, z.core.$strip>, z.ZodTransform<{
4968
5443
  symbol: string;
5444
+ source: (string & {}) | KnownPriceSource;
4969
5445
  timestamp: EpochMilliseconds;
4970
5446
  value: DecimalString;
4971
5447
  receivedAt: EpochMilliseconds | undefined;
4972
5448
  isCarriedForward: boolean | undefined;
4973
5449
  }, {
4974
5450
  symbol: string;
5451
+ source: (string & {}) | KnownPriceSource;
4975
5452
  timestamp: EpochMilliseconds;
4976
5453
  value: DecimalString;
4977
5454
  full_accuracy_value: DecimalString;
4978
5455
  received_at?: EpochMilliseconds | undefined;
4979
5456
  is_carried_forward?: boolean | undefined;
4980
- }>>;
5457
+ }>>, z.ZodPipe<z.ZodObject<{
5458
+ market_status: z.ZodOptional<z.ZodEnum<typeof EquityMarketStatus>>;
5459
+ }, z.core.$strip>, z.ZodTransform<{
5460
+ marketStatus?: EquityMarketStatus;
5461
+ }, {
5462
+ market_status?: EquityMarketStatus | undefined;
5463
+ }>>>;
4981
5464
  }, z.core.$strip>, z.ZodObject<{
4982
5465
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4983
5466
  seq: z.ZodOptional<z.ZodNumber>;
4984
5467
  dropped: z.ZodOptional<z.ZodNumber>;
4985
5468
  topic: z.ZodLiteral<"prices.equity">;
4986
5469
  type: z.ZodLiteral<"subscribe">;
4987
- payload: z.ZodObject<{
5470
+ payload: z.ZodIntersection<z.ZodObject<{
4988
5471
  symbol: z.ZodString;
5472
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
4989
5473
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
4990
5474
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4991
5475
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
@@ -4998,17 +5482,123 @@ declare const EquityPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4998
5482
  value: DecimalString;
4999
5483
  full_accuracy_value: DecimalString;
5000
5484
  }>>>;
5001
- }, z.core.$strip>;
5485
+ }, z.core.$strip>, z.ZodPipe<z.ZodObject<{
5486
+ market_status: z.ZodOptional<z.ZodEnum<typeof EquityMarketStatus>>;
5487
+ }, z.core.$strip>, z.ZodTransform<{
5488
+ marketStatus?: EquityMarketStatus;
5489
+ }, {
5490
+ market_status?: EquityMarketStatus | undefined;
5491
+ }>>>;
5002
5492
  }, z.core.$strip>]>;
5003
5493
  /**
5004
5494
  * An equity price event.
5005
5495
  *
5496
+ * `payload.marketStatus` describes this provider's instrument. Absence means not
5497
+ * stated, never open. Status-only updates repeat the price timestamp with
5498
+ * `isCarriedForward: true`; do not deduplicate updates by timestamp alone.
5499
+ * Snapshots carry the current status beside `source`, including a closing price
5500
+ * older than two minutes while the status is closed or unknown.
5501
+ *
5006
5502
  * `seq` is scoped to one channel on one WebSocket connection and resets after
5007
5503
  * reconnecting. When an SDK subscription spans multiple connections, sequence
5008
5504
  * values from those connections may interleave.
5009
5505
  */
5010
5506
  type EquityPriceEvent = z.infer<typeof EquityPriceEventSchema>;
5011
- type PriceEvent = CryptoPriceEvent | CryptoTwapPriceEvent | EquityPriceEvent;
5507
+ declare const EquityTwapPriceEventSchema: z.ZodUnion<readonly [z.ZodObject<{
5508
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5509
+ seq: z.ZodOptional<z.ZodNumber>;
5510
+ dropped: z.ZodOptional<z.ZodNumber>;
5511
+ topic: z.ZodLiteral<"prices.equity.twap">;
5512
+ type: z.ZodLiteral<"update">;
5513
+ payload: z.ZodIntersection<z.ZodPipe<z.ZodObject<{
5514
+ symbol: z.ZodString;
5515
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
5516
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5517
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
5518
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
5519
+ window_seconds: z.ZodLiteral<60>;
5520
+ }, z.core.$strip>, z.ZodTransform<{
5521
+ symbol: string;
5522
+ source: (string & {}) | KnownPriceSource;
5523
+ timestamp: EpochMilliseconds;
5524
+ value: DecimalString;
5525
+ windowSeconds: 60;
5526
+ }, {
5527
+ symbol: string;
5528
+ source: (string & {}) | KnownPriceSource;
5529
+ timestamp: EpochMilliseconds;
5530
+ value: DecimalString;
5531
+ full_accuracy_value: DecimalString;
5532
+ window_seconds: 60;
5533
+ }>>, z.ZodPipe<z.ZodObject<{
5534
+ market_status: z.ZodOptional<z.ZodEnum<typeof EquityMarketStatus>>;
5535
+ }, z.core.$strip>, z.ZodTransform<{
5536
+ marketStatus?: EquityMarketStatus;
5537
+ }, {
5538
+ market_status?: EquityMarketStatus | undefined;
5539
+ }>>>;
5540
+ }, z.core.$strip>, z.ZodObject<{
5541
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5542
+ seq: z.ZodOptional<z.ZodNumber>;
5543
+ dropped: z.ZodOptional<z.ZodNumber>;
5544
+ topic: z.ZodLiteral<"prices.equity.twap">;
5545
+ type: z.ZodLiteral<"subscribe">;
5546
+ payload: z.ZodIntersection<z.ZodPipe<z.ZodObject<{
5547
+ symbol: z.ZodString;
5548
+ source: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | KnownPriceSource, string>>;
5549
+ data: z.ZodArray<z.ZodPipe<z.ZodObject<{
5550
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5551
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
5552
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
5553
+ }, z.core.$strip>, z.ZodTransform<{
5554
+ timestamp: EpochMilliseconds;
5555
+ value: DecimalString;
5556
+ }, {
5557
+ timestamp: EpochMilliseconds;
5558
+ value: DecimalString;
5559
+ full_accuracy_value: DecimalString;
5560
+ }>>>;
5561
+ window_seconds: z.ZodLiteral<60>;
5562
+ }, z.core.$strip>, z.ZodTransform<{
5563
+ symbol: string;
5564
+ source: (string & {}) | KnownPriceSource;
5565
+ data: {
5566
+ timestamp: EpochMilliseconds;
5567
+ value: DecimalString;
5568
+ }[];
5569
+ windowSeconds: 60;
5570
+ }, {
5571
+ symbol: string;
5572
+ source: (string & {}) | KnownPriceSource;
5573
+ data: {
5574
+ timestamp: EpochMilliseconds;
5575
+ value: DecimalString;
5576
+ }[];
5577
+ window_seconds: 60;
5578
+ }>>, z.ZodPipe<z.ZodObject<{
5579
+ market_status: z.ZodOptional<z.ZodEnum<typeof EquityMarketStatus>>;
5580
+ }, z.core.$strip>, z.ZodTransform<{
5581
+ marketStatus?: EquityMarketStatus;
5582
+ }, {
5583
+ market_status?: EquityMarketStatus | undefined;
5584
+ }>>>;
5585
+ }, z.core.$strip>]>;
5586
+ /**
5587
+ * An equity TWAP event, denominated in the symbol's quote currency.
5588
+ *
5589
+ * `payload.marketStatus` has the same meaning as on equity prices and changes
5590
+ * only with a new TWAP price. Absence means not stated. Snapshots carry the
5591
+ * current status beside `source` and may include an older closing price.
5592
+ *
5593
+ * `seq` is scoped to one channel on one WebSocket connection and resets after
5594
+ * reconnecting. When an SDK subscription spans multiple connections, sequence
5595
+ * values from those connections may interleave.
5596
+ */
5597
+ type EquityTwapPriceEvent = z.infer<typeof EquityTwapPriceEventSchema>;
5598
+ type EquityTwapPriceSnapshotEvent = Extract<EquityTwapPriceEvent, {
5599
+ type: 'subscribe';
5600
+ }>;
5601
+ type PriceEvent = CryptoPriceEvent | CryptoTwapPriceEvent | EquityPriceEvent | EquityTwapPriceEvent;
5012
5602
 
5013
5603
  declare const CommentRemovedPayloadSchema: z.ZodObject<{
5014
5604
  id: z.ZodString;
@@ -7415,4 +8005,4 @@ declare const SportsResultEventSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
7415
8005
  }>>;
7416
8006
  type SportsEvent = z.infer<typeof SportsResultEventSchema>;
7417
8007
 
7418
- export { type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPriceEvent, CryptoPriceEventSchema, type CryptoPriceSnapshotEvent, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesChainlinkTwapEvent, CryptoPricesChainlinkTwapEventSchema, type CryptoPricesChainlinkTwapSixtyEvent, CryptoPricesChainlinkTwapSixtyEventSchema, type CryptoPricesChainlinkTwapThirtyEvent, CryptoPricesChainlinkTwapThirtyEventSchema, type CryptoPricesChainlinkTwapTopic, type CryptoPricesChainlinkTwapWindowSeconds, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CryptoTwapPriceEvent, CryptoTwapPriceEventSchema, type CryptoTwapPriceSnapshotEvent, type CustomMarketEvent, CustomMarketEventSchema, type EquityPriceEvent, EquityPriceEventSchema, type EquityPriceSnapshotPoint, type EquityPriceSubscribePayload, type EquityPriceUpdatePayload, type EquityPricesEvent, EquityPricesEventSchema, type EquityPricesSubscribeEvent, EquityPricesSubscribeEventSchema, type EquityPricesTopic, type EquityPricesUpdateEvent, EquityPricesUpdateEventSchema, type MarketBestBidAskEvent, MarketBestBidAskEventSchema, type MarketBookEvent, MarketBookEventSchema, type MarketEvent, type MarketEventMessage, MarketEventSchema, type MarketLastTradePriceEvent, MarketLastTradePriceEventSchema, type MarketPriceChangeEvent, MarketPriceChangeEventSchema, type MarketResolvedEvent, MarketResolvedEventSchema, type MarketTickSizeChangeEvent, MarketTickSizeChangeEventSchema, type NewMarketEvent, NewMarketEventSchema, type OrderBookLevel, type PerpsBalanceUpdateEvent, PerpsBalanceUpdateEventSchema, type PerpsBboEvent, PerpsBboEventSchema, type PerpsBookEvent, PerpsBookEventSchema, type PerpsBuilderFillUpdateEvent, PerpsBuilderFillUpdateEventSchema, type PerpsCandleEvent, PerpsCandleEventSchema, type PerpsDepositUpdateEvent, PerpsDepositUpdateEventSchema, type PerpsFillUpdateEvent, PerpsFillUpdateEventSchema, type PerpsFundingUpdateEvent, PerpsFundingUpdateEventSchema, type PerpsMarketDataEvent, PerpsMarketDataEventSchema, type PerpsNotificationUpdateEvent, PerpsNotificationUpdateEventSchema, PerpsNotificationsResyncFrameSchema, type PerpsOrderUpdateEvent, PerpsOrderUpdateEventSchema, type PerpsPortfolioUpdateEvent, PerpsPortfolioUpdateEventSchema, type PerpsResyncEvent, type PerpsSessionEvent, type PerpsSessionUpdateEvent, PerpsSessionUpdateEventSchema, type PerpsStatisticEvent, PerpsStatisticEventSchema, type PerpsTickerEvent, PerpsTickerEventSchema, type PerpsTpSlUpdateEvent, PerpsTpSlUpdateEventSchema, type PerpsTradeEvent, PerpsTradeEventSchema, type PerpsWithdrawalUpdateEvent, PerpsWithdrawalUpdateEventSchema, type PolyboltAck, PolyboltAckOp, PolyboltAckSchema, PolyboltChannel, type PolyboltEnvelope, PolyboltEnvelopeSchema, type PolyboltFilter, type PolyboltSubscription, type PriceChange, type PriceEvent, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeErrorCode, type RealtimeEvent, RealtimeEventSchema, RealtimeKnownErrorCode, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };
8008
+ export { type CanceledWithReasonStatus, type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPriceEvent, CryptoPriceEventSchema, type CryptoPriceSnapshotEvent, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesChainlinkTwapEvent, CryptoPricesChainlinkTwapEventSchema, type CryptoPricesChainlinkTwapSixtyEvent, CryptoPricesChainlinkTwapSixtyEventSchema, type CryptoPricesChainlinkTwapThirtyEvent, CryptoPricesChainlinkTwapThirtyEventSchema, type CryptoPricesChainlinkTwapTopic, type CryptoPricesChainlinkTwapWindowSeconds, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CryptoTwapPriceEvent, CryptoTwapPriceEventSchema, type CryptoTwapPriceSnapshotEvent, type CustomMarketEvent, CustomMarketEventSchema, EquityMarketStatus, type EquityPriceEvent, EquityPriceEventSchema, type EquityPriceSnapshotPoint, type EquityPriceSubscribePayload, type EquityPriceUpdatePayload, type EquityPricesEvent, EquityPricesEventSchema, type EquityPricesSubscribeEvent, EquityPricesSubscribeEventSchema, type EquityPricesTopic, type EquityPricesUpdateEvent, EquityPricesUpdateEventSchema, type EquityTwapPriceEvent, EquityTwapPriceEventSchema, type EquityTwapPriceSnapshotEvent, KnownPriceSource, type MarketBestBidAskEvent, MarketBestBidAskEventSchema, type MarketBookEvent, MarketBookEventSchema, type MarketEvent, type MarketEventMessage, MarketEventSchema, type MarketLastTradePriceEvent, MarketLastTradePriceEventSchema, type MarketPriceChangeEvent, MarketPriceChangeEventSchema, type MarketResolvedEvent, MarketResolvedEventSchema, type MarketTickSizeChangeEvent, MarketTickSizeChangeEventSchema, type NewMarketEvent, NewMarketEventSchema, type OrderBookLevel, type PerpsBalanceUpdateEvent, PerpsBalanceUpdateEventSchema, type PerpsBboEvent, PerpsBboEventSchema, type PerpsBookEvent, PerpsBookEventSchema, type PerpsBuilderFillUpdateEvent, PerpsBuilderFillUpdateEventSchema, type PerpsCandleEvent, PerpsCandleEventSchema, type PerpsDepositUpdateEvent, PerpsDepositUpdateEventSchema, type PerpsFillUpdateEvent, PerpsFillUpdateEventSchema, type PerpsFundingUpdateEvent, PerpsFundingUpdateEventSchema, type PerpsMarketDataEvent, PerpsMarketDataEventSchema, type PerpsNotificationUpdateEvent, PerpsNotificationUpdateEventSchema, PerpsNotificationsResyncFrameSchema, type PerpsOrderUpdateEvent, PerpsOrderUpdateEventSchema, type PerpsPortfolioUpdateEvent, PerpsPortfolioUpdateEventSchema, type PerpsResyncEvent, type PerpsSessionEvent, type PerpsSessionUpdateEvent, PerpsSessionUpdateEventSchema, type PerpsStatisticEvent, PerpsStatisticEventSchema, type PerpsTickerEvent, PerpsTickerEventSchema, type PerpsTpSlUpdateEvent, PerpsTpSlUpdateEventSchema, type PerpsTradeEvent, PerpsTradeEventSchema, type PerpsWithdrawalUpdateEvent, PerpsWithdrawalUpdateEventSchema, type PolyboltAck, PolyboltAckOp, PolyboltAckSchema, PolyboltChannel, type PolyboltEnvelope, PolyboltEnvelopeSchema, type PolyboltFilter, type PolyboltSubscription, type PriceChange, type PriceEvent, PriceProvider, type PriceSource, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeErrorCode, type RealtimeEvent, RealtimeEventSchema, RealtimeKnownErrorCode, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };