@polymarket/bindings 0.1.0-beta.6 → 0.1.0-beta.7

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.
@@ -1,7 +1,8 @@
1
- import { TokenId, DecimalString, EpochMilliseconds, CtfConditionId, IsoDateTimeString, OrderSide, OrderType, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId, BaseUnits } from '../index.js';
1
+ import { TokenId, DecimalString, EpochMilliseconds, CtfConditionId, IsoDateTimeString, OrderSide, OrderType, BaseUnits, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId } from '../index.js';
2
2
  import { z } from 'zod';
3
+ import * as _polymarket_types from '@polymarket/types';
4
+ import { P as PerpsInstrumentId, A as PerpsKlineInterval, a as PerpsDepositStatus, h as PerpsTradeId, j as PerpsOrderId, i as PerpsSide, k as PerpsTimeInForce, b as PerpsWithdrawalId, c as PerpsWithdrawalStatus } from '../common-DVmtlYtD.js';
3
5
  import { R as ReactionType } from '../comment-C-jBbhp7.js';
4
- import '@polymarket/types';
5
6
 
6
7
  declare enum TradeStatus {
7
8
  Matched = "TRADE_STATUS_MATCHED",
@@ -1526,6 +1527,1831 @@ declare const UserEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<{
1526
1527
  }>>], "event_type">;
1527
1528
  type UserEvent = z.infer<typeof UserEventSchema>;
1528
1529
 
1530
+ declare const PerpsTradeEventSchema: z.ZodPipe<z.ZodObject<{
1531
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1532
+ sq: z.ZodNumber;
1533
+ ch: z.ZodString;
1534
+ data: z.ZodPipe<z.ZodObject<{
1535
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
1536
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1537
+ side: z.ZodEnum<typeof PerpsSide>;
1538
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1539
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1540
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1541
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1542
+ }, z.core.$strip>, z.ZodTransform<{
1543
+ tradeId: PerpsTradeId;
1544
+ instrumentId: PerpsInstrumentId;
1545
+ side: PerpsSide;
1546
+ price: DecimalString;
1547
+ quantity: DecimalString;
1548
+ timestamp: EpochMilliseconds;
1549
+ hash: _polymarket_types.TxHash | undefined;
1550
+ }, {
1551
+ tid: PerpsTradeId;
1552
+ iid: PerpsInstrumentId;
1553
+ side: PerpsSide;
1554
+ p: DecimalString;
1555
+ qty: DecimalString;
1556
+ ts: EpochMilliseconds;
1557
+ hash?: _polymarket_types.TxHash | undefined;
1558
+ }>>;
1559
+ }, z.core.$strip>, z.ZodTransform<{
1560
+ topic: "perps.trades";
1561
+ type: "trade";
1562
+ channel: string;
1563
+ timestamp: EpochMilliseconds;
1564
+ sequence: number;
1565
+ payload: {
1566
+ tradeId: PerpsTradeId;
1567
+ instrumentId: PerpsInstrumentId;
1568
+ side: PerpsSide;
1569
+ price: DecimalString;
1570
+ quantity: DecimalString;
1571
+ timestamp: EpochMilliseconds;
1572
+ hash: _polymarket_types.TxHash | undefined;
1573
+ };
1574
+ }, {
1575
+ ts: EpochMilliseconds;
1576
+ sq: number;
1577
+ ch: string;
1578
+ data: {
1579
+ tradeId: PerpsTradeId;
1580
+ instrumentId: PerpsInstrumentId;
1581
+ side: PerpsSide;
1582
+ price: DecimalString;
1583
+ quantity: DecimalString;
1584
+ timestamp: EpochMilliseconds;
1585
+ hash: _polymarket_types.TxHash | undefined;
1586
+ };
1587
+ }>>;
1588
+ type PerpsTradeEvent = z.infer<typeof PerpsTradeEventSchema>;
1589
+ declare const PerpsBboEventSchema: z.ZodPipe<z.ZodObject<{
1590
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1591
+ sq: z.ZodNumber;
1592
+ ch: z.ZodString;
1593
+ data: z.ZodPipe<z.ZodObject<{
1594
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1595
+ bp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1596
+ bq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1597
+ ap: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1598
+ aq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1599
+ }, z.core.$strip>, z.ZodTransform<{
1600
+ instrumentId: PerpsInstrumentId;
1601
+ bidPrice: DecimalString;
1602
+ bidQuantity: DecimalString;
1603
+ askPrice: DecimalString;
1604
+ askQuantity: DecimalString;
1605
+ }, {
1606
+ iid: PerpsInstrumentId;
1607
+ bp: DecimalString;
1608
+ bq: DecimalString;
1609
+ ap: DecimalString;
1610
+ aq: DecimalString;
1611
+ }>>;
1612
+ }, z.core.$strip>, z.ZodTransform<{
1613
+ topic: "perps.bbo";
1614
+ type: "bbo";
1615
+ channel: string;
1616
+ timestamp: EpochMilliseconds;
1617
+ sequence: number;
1618
+ payload: {
1619
+ instrumentId: PerpsInstrumentId;
1620
+ bidPrice: DecimalString;
1621
+ bidQuantity: DecimalString;
1622
+ askPrice: DecimalString;
1623
+ askQuantity: DecimalString;
1624
+ };
1625
+ }, {
1626
+ ts: EpochMilliseconds;
1627
+ sq: number;
1628
+ ch: string;
1629
+ data: {
1630
+ instrumentId: PerpsInstrumentId;
1631
+ bidPrice: DecimalString;
1632
+ bidQuantity: DecimalString;
1633
+ askPrice: DecimalString;
1634
+ askQuantity: DecimalString;
1635
+ };
1636
+ }>>;
1637
+ type PerpsBboEvent = z.infer<typeof PerpsBboEventSchema>;
1638
+ declare const PerpsBookEventSchema: z.ZodPipe<z.ZodObject<{
1639
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1640
+ sq: z.ZodNumber;
1641
+ ch: z.ZodString;
1642
+ data: z.ZodPipe<z.ZodObject<{
1643
+ b: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
1644
+ price: DecimalString;
1645
+ quantity: DecimalString;
1646
+ }, [DecimalString, DecimalString]>>>;
1647
+ a: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
1648
+ price: DecimalString;
1649
+ quantity: DecimalString;
1650
+ }, [DecimalString, DecimalString]>>>;
1651
+ }, z.core.$strip>, z.ZodTransform<{
1652
+ bids: {
1653
+ price: DecimalString;
1654
+ quantity: DecimalString;
1655
+ }[];
1656
+ asks: {
1657
+ price: DecimalString;
1658
+ quantity: DecimalString;
1659
+ }[];
1660
+ }, {
1661
+ b: {
1662
+ price: DecimalString;
1663
+ quantity: DecimalString;
1664
+ }[];
1665
+ a: {
1666
+ price: DecimalString;
1667
+ quantity: DecimalString;
1668
+ }[];
1669
+ }>>;
1670
+ }, z.core.$strip>, z.ZodTransform<{
1671
+ topic: "perps.book";
1672
+ type: "book";
1673
+ channel: string;
1674
+ timestamp: EpochMilliseconds;
1675
+ sequence: number;
1676
+ payload: {
1677
+ bids: {
1678
+ price: DecimalString;
1679
+ quantity: DecimalString;
1680
+ }[];
1681
+ asks: {
1682
+ price: DecimalString;
1683
+ quantity: DecimalString;
1684
+ }[];
1685
+ instrumentId: PerpsInstrumentId;
1686
+ };
1687
+ }, {
1688
+ ts: EpochMilliseconds;
1689
+ sq: number;
1690
+ ch: string;
1691
+ data: {
1692
+ bids: {
1693
+ price: DecimalString;
1694
+ quantity: DecimalString;
1695
+ }[];
1696
+ asks: {
1697
+ price: DecimalString;
1698
+ quantity: DecimalString;
1699
+ }[];
1700
+ };
1701
+ }>>;
1702
+ type PerpsBookEvent = z.infer<typeof PerpsBookEventSchema>;
1703
+ declare const PerpsTickerEventSchema: z.ZodPipe<z.ZodObject<{
1704
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1705
+ sq: z.ZodNumber;
1706
+ ch: z.ZodString;
1707
+ data: z.ZodPipe<z.ZodObject<{
1708
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1709
+ idx: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1710
+ mark: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1711
+ last: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1712
+ mid: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1713
+ oi: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1714
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1715
+ nxf: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1716
+ }, z.core.$strip>, z.ZodTransform<{
1717
+ instrumentId: PerpsInstrumentId;
1718
+ indexPrice: DecimalString;
1719
+ markPrice: DecimalString;
1720
+ lastPrice: DecimalString;
1721
+ midPrice: DecimalString;
1722
+ openInterest: DecimalString;
1723
+ fundingRate: DecimalString;
1724
+ nextFunding: EpochMilliseconds;
1725
+ }, {
1726
+ iid: PerpsInstrumentId;
1727
+ idx: DecimalString;
1728
+ mark: DecimalString;
1729
+ last: DecimalString;
1730
+ mid: DecimalString;
1731
+ oi: DecimalString;
1732
+ fr: DecimalString;
1733
+ nxf: EpochMilliseconds;
1734
+ }>>;
1735
+ }, z.core.$strip>, z.ZodTransform<{
1736
+ topic: "perps.tickers";
1737
+ type: "ticker";
1738
+ channel: string;
1739
+ timestamp: EpochMilliseconds;
1740
+ sequence: number;
1741
+ payload: {
1742
+ instrumentId: PerpsInstrumentId;
1743
+ indexPrice: DecimalString;
1744
+ markPrice: DecimalString;
1745
+ lastPrice: DecimalString;
1746
+ midPrice: DecimalString;
1747
+ openInterest: DecimalString;
1748
+ fundingRate: DecimalString;
1749
+ nextFunding: EpochMilliseconds;
1750
+ };
1751
+ }, {
1752
+ ts: EpochMilliseconds;
1753
+ sq: number;
1754
+ ch: string;
1755
+ data: {
1756
+ instrumentId: PerpsInstrumentId;
1757
+ indexPrice: DecimalString;
1758
+ markPrice: DecimalString;
1759
+ lastPrice: DecimalString;
1760
+ midPrice: DecimalString;
1761
+ openInterest: DecimalString;
1762
+ fundingRate: DecimalString;
1763
+ nextFunding: EpochMilliseconds;
1764
+ };
1765
+ }>>;
1766
+ type PerpsTickerEvent = z.infer<typeof PerpsTickerEventSchema>;
1767
+ declare const PerpsStatisticEventSchema: z.ZodPipe<z.ZodObject<{
1768
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1769
+ sq: z.ZodNumber;
1770
+ ch: z.ZodString;
1771
+ data: z.ZodPipe<z.ZodObject<{
1772
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1773
+ vol: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1774
+ open: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1775
+ klines: 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<{
1776
+ timestamp: EpochMilliseconds;
1777
+ open: DecimalString;
1778
+ high: DecimalString;
1779
+ low: DecimalString;
1780
+ close: DecimalString;
1781
+ volume: DecimalString;
1782
+ trades: number;
1783
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
1784
+ }, z.core.$strip>, z.ZodTransform<{
1785
+ instrumentId: PerpsInstrumentId;
1786
+ volume: DecimalString;
1787
+ openPrice: DecimalString;
1788
+ klines: {
1789
+ timestamp: EpochMilliseconds;
1790
+ open: DecimalString;
1791
+ high: DecimalString;
1792
+ low: DecimalString;
1793
+ close: DecimalString;
1794
+ volume: DecimalString;
1795
+ trades: number;
1796
+ }[];
1797
+ }, {
1798
+ iid: PerpsInstrumentId;
1799
+ vol: DecimalString;
1800
+ open: DecimalString;
1801
+ klines: {
1802
+ timestamp: EpochMilliseconds;
1803
+ open: DecimalString;
1804
+ high: DecimalString;
1805
+ low: DecimalString;
1806
+ close: DecimalString;
1807
+ volume: DecimalString;
1808
+ trades: number;
1809
+ }[];
1810
+ }>>;
1811
+ }, z.core.$strip>, z.ZodTransform<{
1812
+ topic: "perps.statistics";
1813
+ type: "statistic";
1814
+ channel: string;
1815
+ timestamp: EpochMilliseconds;
1816
+ sequence: number;
1817
+ payload: {
1818
+ instrumentId: PerpsInstrumentId;
1819
+ volume: DecimalString;
1820
+ openPrice: DecimalString;
1821
+ klines: {
1822
+ timestamp: EpochMilliseconds;
1823
+ open: DecimalString;
1824
+ high: DecimalString;
1825
+ low: DecimalString;
1826
+ close: DecimalString;
1827
+ volume: DecimalString;
1828
+ trades: number;
1829
+ }[];
1830
+ };
1831
+ }, {
1832
+ ts: EpochMilliseconds;
1833
+ sq: number;
1834
+ ch: string;
1835
+ data: {
1836
+ instrumentId: PerpsInstrumentId;
1837
+ volume: DecimalString;
1838
+ openPrice: DecimalString;
1839
+ klines: {
1840
+ timestamp: EpochMilliseconds;
1841
+ open: DecimalString;
1842
+ high: DecimalString;
1843
+ low: DecimalString;
1844
+ close: DecimalString;
1845
+ volume: DecimalString;
1846
+ trades: number;
1847
+ }[];
1848
+ };
1849
+ }>>;
1850
+ type PerpsStatisticEvent = z.infer<typeof PerpsStatisticEventSchema>;
1851
+ declare const PerpsCandleEventSchema: z.ZodPipe<z.ZodObject<{
1852
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1853
+ sq: z.ZodNumber;
1854
+ ch: z.ZodString;
1855
+ 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<{
1856
+ timestamp: EpochMilliseconds;
1857
+ open: DecimalString;
1858
+ high: DecimalString;
1859
+ low: DecimalString;
1860
+ close: DecimalString;
1861
+ volume: DecimalString;
1862
+ trades: number;
1863
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
1864
+ }, z.core.$strip>, z.ZodTransform<{
1865
+ topic: "perps.candles";
1866
+ type: "candle";
1867
+ channel: string;
1868
+ timestamp: EpochMilliseconds;
1869
+ sequence: number;
1870
+ payload: {
1871
+ instrumentId: PerpsInstrumentId;
1872
+ interval: PerpsKlineInterval.OneMinute | PerpsKlineInterval.FiveMinutes | PerpsKlineInterval.FifteenMinutes | PerpsKlineInterval.OneHour | PerpsKlineInterval.FourHours | PerpsKlineInterval.OneDay | PerpsKlineInterval.OneWeek;
1873
+ candles: {
1874
+ timestamp: EpochMilliseconds;
1875
+ open: DecimalString;
1876
+ high: DecimalString;
1877
+ low: DecimalString;
1878
+ close: DecimalString;
1879
+ volume: DecimalString;
1880
+ trades: number;
1881
+ }[];
1882
+ };
1883
+ }, {
1884
+ ts: EpochMilliseconds;
1885
+ sq: number;
1886
+ ch: string;
1887
+ data: {
1888
+ timestamp: EpochMilliseconds;
1889
+ open: DecimalString;
1890
+ high: DecimalString;
1891
+ low: DecimalString;
1892
+ close: DecimalString;
1893
+ volume: DecimalString;
1894
+ trades: number;
1895
+ }[];
1896
+ }>>;
1897
+ type PerpsCandleEvent = z.infer<typeof PerpsCandleEventSchema>;
1898
+ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
1899
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1900
+ sq: z.ZodNumber;
1901
+ ch: z.ZodString;
1902
+ data: z.ZodPipe<z.ZodObject<{
1903
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
1904
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1905
+ side: z.ZodEnum<typeof PerpsSide>;
1906
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1907
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1908
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1909
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1910
+ }, z.core.$strip>, z.ZodTransform<{
1911
+ tradeId: PerpsTradeId;
1912
+ instrumentId: PerpsInstrumentId;
1913
+ side: PerpsSide;
1914
+ price: DecimalString;
1915
+ quantity: DecimalString;
1916
+ timestamp: EpochMilliseconds;
1917
+ hash: _polymarket_types.TxHash | undefined;
1918
+ }, {
1919
+ tid: PerpsTradeId;
1920
+ iid: PerpsInstrumentId;
1921
+ side: PerpsSide;
1922
+ p: DecimalString;
1923
+ qty: DecimalString;
1924
+ ts: EpochMilliseconds;
1925
+ hash?: _polymarket_types.TxHash | undefined;
1926
+ }>>;
1927
+ }, z.core.$strip>, z.ZodTransform<{
1928
+ topic: "perps.trades";
1929
+ type: "trade";
1930
+ channel: string;
1931
+ timestamp: EpochMilliseconds;
1932
+ sequence: number;
1933
+ payload: {
1934
+ tradeId: PerpsTradeId;
1935
+ instrumentId: PerpsInstrumentId;
1936
+ side: PerpsSide;
1937
+ price: DecimalString;
1938
+ quantity: DecimalString;
1939
+ timestamp: EpochMilliseconds;
1940
+ hash: _polymarket_types.TxHash | undefined;
1941
+ };
1942
+ }, {
1943
+ ts: EpochMilliseconds;
1944
+ sq: number;
1945
+ ch: string;
1946
+ data: {
1947
+ tradeId: PerpsTradeId;
1948
+ instrumentId: PerpsInstrumentId;
1949
+ side: PerpsSide;
1950
+ price: DecimalString;
1951
+ quantity: DecimalString;
1952
+ timestamp: EpochMilliseconds;
1953
+ hash: _polymarket_types.TxHash | undefined;
1954
+ };
1955
+ }>>, z.ZodPipe<z.ZodObject<{
1956
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1957
+ sq: z.ZodNumber;
1958
+ ch: z.ZodString;
1959
+ data: z.ZodPipe<z.ZodObject<{
1960
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1961
+ bp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1962
+ bq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1963
+ ap: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1964
+ aq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1965
+ }, z.core.$strip>, z.ZodTransform<{
1966
+ instrumentId: PerpsInstrumentId;
1967
+ bidPrice: DecimalString;
1968
+ bidQuantity: DecimalString;
1969
+ askPrice: DecimalString;
1970
+ askQuantity: DecimalString;
1971
+ }, {
1972
+ iid: PerpsInstrumentId;
1973
+ bp: DecimalString;
1974
+ bq: DecimalString;
1975
+ ap: DecimalString;
1976
+ aq: DecimalString;
1977
+ }>>;
1978
+ }, z.core.$strip>, z.ZodTransform<{
1979
+ topic: "perps.bbo";
1980
+ type: "bbo";
1981
+ channel: string;
1982
+ timestamp: EpochMilliseconds;
1983
+ sequence: number;
1984
+ payload: {
1985
+ instrumentId: PerpsInstrumentId;
1986
+ bidPrice: DecimalString;
1987
+ bidQuantity: DecimalString;
1988
+ askPrice: DecimalString;
1989
+ askQuantity: DecimalString;
1990
+ };
1991
+ }, {
1992
+ ts: EpochMilliseconds;
1993
+ sq: number;
1994
+ ch: string;
1995
+ data: {
1996
+ instrumentId: PerpsInstrumentId;
1997
+ bidPrice: DecimalString;
1998
+ bidQuantity: DecimalString;
1999
+ askPrice: DecimalString;
2000
+ askQuantity: DecimalString;
2001
+ };
2002
+ }>>, z.ZodPipe<z.ZodObject<{
2003
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2004
+ sq: z.ZodNumber;
2005
+ ch: z.ZodString;
2006
+ data: z.ZodPipe<z.ZodObject<{
2007
+ b: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
2008
+ price: DecimalString;
2009
+ quantity: DecimalString;
2010
+ }, [DecimalString, DecimalString]>>>;
2011
+ a: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
2012
+ price: DecimalString;
2013
+ quantity: DecimalString;
2014
+ }, [DecimalString, DecimalString]>>>;
2015
+ }, z.core.$strip>, z.ZodTransform<{
2016
+ bids: {
2017
+ price: DecimalString;
2018
+ quantity: DecimalString;
2019
+ }[];
2020
+ asks: {
2021
+ price: DecimalString;
2022
+ quantity: DecimalString;
2023
+ }[];
2024
+ }, {
2025
+ b: {
2026
+ price: DecimalString;
2027
+ quantity: DecimalString;
2028
+ }[];
2029
+ a: {
2030
+ price: DecimalString;
2031
+ quantity: DecimalString;
2032
+ }[];
2033
+ }>>;
2034
+ }, z.core.$strip>, z.ZodTransform<{
2035
+ topic: "perps.book";
2036
+ type: "book";
2037
+ channel: string;
2038
+ timestamp: EpochMilliseconds;
2039
+ sequence: number;
2040
+ payload: {
2041
+ bids: {
2042
+ price: DecimalString;
2043
+ quantity: DecimalString;
2044
+ }[];
2045
+ asks: {
2046
+ price: DecimalString;
2047
+ quantity: DecimalString;
2048
+ }[];
2049
+ instrumentId: PerpsInstrumentId;
2050
+ };
2051
+ }, {
2052
+ ts: EpochMilliseconds;
2053
+ sq: number;
2054
+ ch: string;
2055
+ data: {
2056
+ bids: {
2057
+ price: DecimalString;
2058
+ quantity: DecimalString;
2059
+ }[];
2060
+ asks: {
2061
+ price: DecimalString;
2062
+ quantity: DecimalString;
2063
+ }[];
2064
+ };
2065
+ }>>, z.ZodPipe<z.ZodObject<{
2066
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2067
+ sq: z.ZodNumber;
2068
+ ch: z.ZodString;
2069
+ data: z.ZodPipe<z.ZodObject<{
2070
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2071
+ idx: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2072
+ mark: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2073
+ last: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2074
+ mid: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2075
+ oi: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2076
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2077
+ nxf: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2078
+ }, z.core.$strip>, z.ZodTransform<{
2079
+ instrumentId: PerpsInstrumentId;
2080
+ indexPrice: DecimalString;
2081
+ markPrice: DecimalString;
2082
+ lastPrice: DecimalString;
2083
+ midPrice: DecimalString;
2084
+ openInterest: DecimalString;
2085
+ fundingRate: DecimalString;
2086
+ nextFunding: EpochMilliseconds;
2087
+ }, {
2088
+ iid: PerpsInstrumentId;
2089
+ idx: DecimalString;
2090
+ mark: DecimalString;
2091
+ last: DecimalString;
2092
+ mid: DecimalString;
2093
+ oi: DecimalString;
2094
+ fr: DecimalString;
2095
+ nxf: EpochMilliseconds;
2096
+ }>>;
2097
+ }, z.core.$strip>, z.ZodTransform<{
2098
+ topic: "perps.tickers";
2099
+ type: "ticker";
2100
+ channel: string;
2101
+ timestamp: EpochMilliseconds;
2102
+ sequence: number;
2103
+ payload: {
2104
+ instrumentId: PerpsInstrumentId;
2105
+ indexPrice: DecimalString;
2106
+ markPrice: DecimalString;
2107
+ lastPrice: DecimalString;
2108
+ midPrice: DecimalString;
2109
+ openInterest: DecimalString;
2110
+ fundingRate: DecimalString;
2111
+ nextFunding: EpochMilliseconds;
2112
+ };
2113
+ }, {
2114
+ ts: EpochMilliseconds;
2115
+ sq: number;
2116
+ ch: string;
2117
+ data: {
2118
+ instrumentId: PerpsInstrumentId;
2119
+ indexPrice: DecimalString;
2120
+ markPrice: DecimalString;
2121
+ lastPrice: DecimalString;
2122
+ midPrice: DecimalString;
2123
+ openInterest: DecimalString;
2124
+ fundingRate: DecimalString;
2125
+ nextFunding: EpochMilliseconds;
2126
+ };
2127
+ }>>, z.ZodPipe<z.ZodObject<{
2128
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2129
+ sq: z.ZodNumber;
2130
+ ch: z.ZodString;
2131
+ data: z.ZodPipe<z.ZodObject<{
2132
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2133
+ vol: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2134
+ open: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2135
+ klines: 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<{
2136
+ timestamp: EpochMilliseconds;
2137
+ open: DecimalString;
2138
+ high: DecimalString;
2139
+ low: DecimalString;
2140
+ close: DecimalString;
2141
+ volume: DecimalString;
2142
+ trades: number;
2143
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
2144
+ }, z.core.$strip>, z.ZodTransform<{
2145
+ instrumentId: PerpsInstrumentId;
2146
+ volume: DecimalString;
2147
+ openPrice: DecimalString;
2148
+ klines: {
2149
+ timestamp: EpochMilliseconds;
2150
+ open: DecimalString;
2151
+ high: DecimalString;
2152
+ low: DecimalString;
2153
+ close: DecimalString;
2154
+ volume: DecimalString;
2155
+ trades: number;
2156
+ }[];
2157
+ }, {
2158
+ iid: PerpsInstrumentId;
2159
+ vol: DecimalString;
2160
+ open: DecimalString;
2161
+ klines: {
2162
+ timestamp: EpochMilliseconds;
2163
+ open: DecimalString;
2164
+ high: DecimalString;
2165
+ low: DecimalString;
2166
+ close: DecimalString;
2167
+ volume: DecimalString;
2168
+ trades: number;
2169
+ }[];
2170
+ }>>;
2171
+ }, z.core.$strip>, z.ZodTransform<{
2172
+ topic: "perps.statistics";
2173
+ type: "statistic";
2174
+ channel: string;
2175
+ timestamp: EpochMilliseconds;
2176
+ sequence: number;
2177
+ payload: {
2178
+ instrumentId: PerpsInstrumentId;
2179
+ volume: DecimalString;
2180
+ openPrice: DecimalString;
2181
+ klines: {
2182
+ timestamp: EpochMilliseconds;
2183
+ open: DecimalString;
2184
+ high: DecimalString;
2185
+ low: DecimalString;
2186
+ close: DecimalString;
2187
+ volume: DecimalString;
2188
+ trades: number;
2189
+ }[];
2190
+ };
2191
+ }, {
2192
+ ts: EpochMilliseconds;
2193
+ sq: number;
2194
+ ch: string;
2195
+ data: {
2196
+ instrumentId: PerpsInstrumentId;
2197
+ volume: DecimalString;
2198
+ openPrice: DecimalString;
2199
+ klines: {
2200
+ timestamp: EpochMilliseconds;
2201
+ open: DecimalString;
2202
+ high: DecimalString;
2203
+ low: DecimalString;
2204
+ close: DecimalString;
2205
+ volume: DecimalString;
2206
+ trades: number;
2207
+ }[];
2208
+ };
2209
+ }>>, z.ZodPipe<z.ZodObject<{
2210
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2211
+ sq: z.ZodNumber;
2212
+ ch: z.ZodString;
2213
+ 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<{
2214
+ timestamp: EpochMilliseconds;
2215
+ open: DecimalString;
2216
+ high: DecimalString;
2217
+ low: DecimalString;
2218
+ close: DecimalString;
2219
+ volume: DecimalString;
2220
+ trades: number;
2221
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
2222
+ }, z.core.$strip>, z.ZodTransform<{
2223
+ topic: "perps.candles";
2224
+ type: "candle";
2225
+ channel: string;
2226
+ timestamp: EpochMilliseconds;
2227
+ sequence: number;
2228
+ payload: {
2229
+ instrumentId: PerpsInstrumentId;
2230
+ interval: PerpsKlineInterval.OneMinute | PerpsKlineInterval.FiveMinutes | PerpsKlineInterval.FifteenMinutes | PerpsKlineInterval.OneHour | PerpsKlineInterval.FourHours | PerpsKlineInterval.OneDay | PerpsKlineInterval.OneWeek;
2231
+ candles: {
2232
+ timestamp: EpochMilliseconds;
2233
+ open: DecimalString;
2234
+ high: DecimalString;
2235
+ low: DecimalString;
2236
+ close: DecimalString;
2237
+ volume: DecimalString;
2238
+ trades: number;
2239
+ }[];
2240
+ };
2241
+ }, {
2242
+ ts: EpochMilliseconds;
2243
+ sq: number;
2244
+ ch: string;
2245
+ data: {
2246
+ timestamp: EpochMilliseconds;
2247
+ open: DecimalString;
2248
+ high: DecimalString;
2249
+ low: DecimalString;
2250
+ close: DecimalString;
2251
+ volume: DecimalString;
2252
+ trades: number;
2253
+ }[];
2254
+ }>>]>;
2255
+ type PerpsMarketDataEvent = z.infer<typeof PerpsMarketDataEventSchema>;
2256
+ declare const PerpsBalanceUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2257
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2258
+ sq: z.ZodNumber;
2259
+ ch: z.ZodLiteral<"balances">;
2260
+ data: z.ZodObject<{
2261
+ asset: z.ZodString;
2262
+ balance: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2263
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2264
+ }, z.core.$strip>;
2265
+ }, z.core.$strip>, z.ZodTransform<{
2266
+ type: "balance";
2267
+ channel: "balances";
2268
+ timestamp: number;
2269
+ sequence: number;
2270
+ payload: {
2271
+ asset: string;
2272
+ balance: DecimalString;
2273
+ value: DecimalString;
2274
+ };
2275
+ }, {
2276
+ ts: EpochMilliseconds;
2277
+ sq: number;
2278
+ ch: "balances";
2279
+ data: {
2280
+ asset: string;
2281
+ balance: DecimalString;
2282
+ value: DecimalString;
2283
+ };
2284
+ }>>;
2285
+ type PerpsBalanceUpdateEvent = z.infer<typeof PerpsBalanceUpdateEventSchema>;
2286
+ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2287
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2288
+ sq: z.ZodNumber;
2289
+ ch: z.ZodLiteral<"portfolio">;
2290
+ data: z.ZodPipe<z.ZodObject<{
2291
+ positions: z.ZodArray<z.ZodPipe<z.ZodObject<{
2292
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2293
+ symbol: z.ZodString;
2294
+ size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2295
+ entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2296
+ leverage: z.ZodNumber;
2297
+ cross: z.ZodBoolean;
2298
+ initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2299
+ maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2300
+ position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2301
+ liquidation_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2302
+ unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2303
+ return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2304
+ cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2305
+ }, z.core.$strip>, z.ZodTransform<{
2306
+ instrumentId: PerpsInstrumentId;
2307
+ symbol: string;
2308
+ size: DecimalString;
2309
+ entryPrice: DecimalString;
2310
+ leverage: number;
2311
+ cross: boolean;
2312
+ initialMargin: DecimalString;
2313
+ maintenanceMargin: DecimalString;
2314
+ positionValue: DecimalString;
2315
+ liquidationPrice: DecimalString;
2316
+ unrealizedPnl: DecimalString;
2317
+ returnOnEquity: DecimalString;
2318
+ cumulativeFunding: DecimalString;
2319
+ }, {
2320
+ instrument_id: PerpsInstrumentId;
2321
+ symbol: string;
2322
+ size: DecimalString;
2323
+ entry_price: DecimalString;
2324
+ leverage: number;
2325
+ cross: boolean;
2326
+ initial_margin: DecimalString;
2327
+ maintenance_margin: DecimalString;
2328
+ position_value: DecimalString;
2329
+ liquidation_price: DecimalString;
2330
+ unrealized_pnl: DecimalString;
2331
+ return_on_equity: DecimalString;
2332
+ cumulative_funding: DecimalString;
2333
+ }>>>;
2334
+ margin: z.ZodPipe<z.ZodObject<{
2335
+ total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2336
+ total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2337
+ total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2338
+ total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2339
+ }, z.core.$strip>, z.ZodTransform<{
2340
+ totalAccountValue: DecimalString;
2341
+ totalInitialMargin: DecimalString;
2342
+ totalMaintenanceMargin: DecimalString;
2343
+ totalPositionValue: DecimalString;
2344
+ }, {
2345
+ total_account_value: DecimalString;
2346
+ total_initial_margin: DecimalString;
2347
+ total_maintenance_margin: DecimalString;
2348
+ total_position_value: DecimalString;
2349
+ }>>;
2350
+ withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2351
+ in_liquidation: z.ZodBoolean;
2352
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2353
+ }, z.core.$strip>, z.ZodTransform<{
2354
+ positions: {
2355
+ instrumentId: PerpsInstrumentId;
2356
+ symbol: string;
2357
+ size: DecimalString;
2358
+ entryPrice: DecimalString;
2359
+ leverage: number;
2360
+ cross: boolean;
2361
+ initialMargin: DecimalString;
2362
+ maintenanceMargin: DecimalString;
2363
+ positionValue: DecimalString;
2364
+ liquidationPrice: DecimalString;
2365
+ unrealizedPnl: DecimalString;
2366
+ returnOnEquity: DecimalString;
2367
+ cumulativeFunding: DecimalString;
2368
+ }[];
2369
+ margin: {
2370
+ totalAccountValue: DecimalString;
2371
+ totalInitialMargin: DecimalString;
2372
+ totalMaintenanceMargin: DecimalString;
2373
+ totalPositionValue: DecimalString;
2374
+ };
2375
+ withdrawable: DecimalString;
2376
+ inLiquidation: boolean;
2377
+ timestamp: EpochMilliseconds;
2378
+ }, {
2379
+ positions: {
2380
+ instrumentId: PerpsInstrumentId;
2381
+ symbol: string;
2382
+ size: DecimalString;
2383
+ entryPrice: DecimalString;
2384
+ leverage: number;
2385
+ cross: boolean;
2386
+ initialMargin: DecimalString;
2387
+ maintenanceMargin: DecimalString;
2388
+ positionValue: DecimalString;
2389
+ liquidationPrice: DecimalString;
2390
+ unrealizedPnl: DecimalString;
2391
+ returnOnEquity: DecimalString;
2392
+ cumulativeFunding: DecimalString;
2393
+ }[];
2394
+ margin: {
2395
+ totalAccountValue: DecimalString;
2396
+ totalInitialMargin: DecimalString;
2397
+ totalMaintenanceMargin: DecimalString;
2398
+ totalPositionValue: DecimalString;
2399
+ };
2400
+ withdrawable: DecimalString;
2401
+ in_liquidation: boolean;
2402
+ timestamp: EpochMilliseconds;
2403
+ }>>;
2404
+ }, z.core.$strip>, z.ZodTransform<{
2405
+ type: "portfolio";
2406
+ channel: "portfolio";
2407
+ timestamp: number;
2408
+ sequence: number;
2409
+ payload: {
2410
+ positions: {
2411
+ instrumentId: PerpsInstrumentId;
2412
+ symbol: string;
2413
+ size: DecimalString;
2414
+ entryPrice: DecimalString;
2415
+ leverage: number;
2416
+ cross: boolean;
2417
+ initialMargin: DecimalString;
2418
+ maintenanceMargin: DecimalString;
2419
+ positionValue: DecimalString;
2420
+ liquidationPrice: DecimalString;
2421
+ unrealizedPnl: DecimalString;
2422
+ returnOnEquity: DecimalString;
2423
+ cumulativeFunding: DecimalString;
2424
+ }[];
2425
+ margin: {
2426
+ totalAccountValue: DecimalString;
2427
+ totalInitialMargin: DecimalString;
2428
+ totalMaintenanceMargin: DecimalString;
2429
+ totalPositionValue: DecimalString;
2430
+ };
2431
+ withdrawable: DecimalString;
2432
+ inLiquidation: boolean;
2433
+ timestamp: EpochMilliseconds;
2434
+ };
2435
+ }, {
2436
+ ts: EpochMilliseconds;
2437
+ sq: number;
2438
+ ch: "portfolio";
2439
+ data: {
2440
+ positions: {
2441
+ instrumentId: PerpsInstrumentId;
2442
+ symbol: string;
2443
+ size: DecimalString;
2444
+ entryPrice: DecimalString;
2445
+ leverage: number;
2446
+ cross: boolean;
2447
+ initialMargin: DecimalString;
2448
+ maintenanceMargin: DecimalString;
2449
+ positionValue: DecimalString;
2450
+ liquidationPrice: DecimalString;
2451
+ unrealizedPnl: DecimalString;
2452
+ returnOnEquity: DecimalString;
2453
+ cumulativeFunding: DecimalString;
2454
+ }[];
2455
+ margin: {
2456
+ totalAccountValue: DecimalString;
2457
+ totalInitialMargin: DecimalString;
2458
+ totalMaintenanceMargin: DecimalString;
2459
+ totalPositionValue: DecimalString;
2460
+ };
2461
+ withdrawable: DecimalString;
2462
+ inLiquidation: boolean;
2463
+ timestamp: EpochMilliseconds;
2464
+ };
2465
+ }>>;
2466
+ type PerpsPortfolioUpdateEvent = z.infer<typeof PerpsPortfolioUpdateEventSchema>;
2467
+ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2468
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2469
+ sq: z.ZodNumber;
2470
+ ch: z.ZodLiteral<"orders">;
2471
+ data: z.ZodPipe<z.ZodObject<{
2472
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
2473
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2474
+ buy: z.ZodBoolean;
2475
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2476
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2477
+ tif: z.ZodEnum<typeof PerpsTimeInForce>;
2478
+ po: z.ZodBoolean;
2479
+ status: z.ZodString;
2480
+ rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2481
+ fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2482
+ cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2483
+ uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2484
+ coid: z.ZodOptional<z.ZodString>;
2485
+ }, z.core.$strip>, z.ZodTransform<{
2486
+ orderId: PerpsOrderId;
2487
+ instrumentId: PerpsInstrumentId;
2488
+ buy: boolean;
2489
+ price: DecimalString;
2490
+ quantity: DecimalString;
2491
+ timeInForce: PerpsTimeInForce;
2492
+ postOnly: boolean;
2493
+ status: string;
2494
+ restingQuantity: DecimalString;
2495
+ filledQuantity: DecimalString;
2496
+ createdTimestamp: EpochMilliseconds;
2497
+ updatedTimestamp: EpochMilliseconds;
2498
+ clientOrderId: string | undefined;
2499
+ }, {
2500
+ oid: PerpsOrderId;
2501
+ iid: PerpsInstrumentId;
2502
+ buy: boolean;
2503
+ p: DecimalString;
2504
+ qty: DecimalString;
2505
+ tif: PerpsTimeInForce;
2506
+ po: boolean;
2507
+ status: string;
2508
+ rest: DecimalString;
2509
+ fill: DecimalString;
2510
+ cts: EpochMilliseconds;
2511
+ uts: EpochMilliseconds;
2512
+ coid?: string | undefined;
2513
+ }>>;
2514
+ }, z.core.$strip>, z.ZodTransform<{
2515
+ type: "order";
2516
+ channel: "orders";
2517
+ timestamp: number;
2518
+ sequence: number;
2519
+ payload: {
2520
+ orderId: PerpsOrderId;
2521
+ instrumentId: PerpsInstrumentId;
2522
+ buy: boolean;
2523
+ price: DecimalString;
2524
+ quantity: DecimalString;
2525
+ timeInForce: PerpsTimeInForce;
2526
+ postOnly: boolean;
2527
+ status: string;
2528
+ restingQuantity: DecimalString;
2529
+ filledQuantity: DecimalString;
2530
+ createdTimestamp: EpochMilliseconds;
2531
+ updatedTimestamp: EpochMilliseconds;
2532
+ clientOrderId: string | undefined;
2533
+ };
2534
+ }, {
2535
+ ts: EpochMilliseconds;
2536
+ sq: number;
2537
+ ch: "orders";
2538
+ data: {
2539
+ orderId: PerpsOrderId;
2540
+ instrumentId: PerpsInstrumentId;
2541
+ buy: boolean;
2542
+ price: DecimalString;
2543
+ quantity: DecimalString;
2544
+ timeInForce: PerpsTimeInForce;
2545
+ postOnly: boolean;
2546
+ status: string;
2547
+ restingQuantity: DecimalString;
2548
+ filledQuantity: DecimalString;
2549
+ createdTimestamp: EpochMilliseconds;
2550
+ updatedTimestamp: EpochMilliseconds;
2551
+ clientOrderId: string | undefined;
2552
+ };
2553
+ }>>;
2554
+ type PerpsOrderUpdateEvent = z.infer<typeof PerpsOrderUpdateEventSchema>;
2555
+ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2556
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2557
+ sq: z.ZodNumber;
2558
+ ch: z.ZodLiteral<"fills">;
2559
+ data: z.ZodPipe<z.ZodObject<{
2560
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
2561
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
2562
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2563
+ side: z.ZodEnum<typeof PerpsSide>;
2564
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2565
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2566
+ taker: z.ZodBoolean;
2567
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2568
+ fea: z.ZodString;
2569
+ psz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2570
+ pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2571
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2572
+ liq: z.ZodBoolean;
2573
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2574
+ coid: z.ZodOptional<z.ZodString>;
2575
+ }, z.core.$strip>, z.ZodTransform<{
2576
+ tradeId: PerpsTradeId;
2577
+ orderId: PerpsOrderId;
2578
+ instrumentId: PerpsInstrumentId;
2579
+ side: PerpsSide;
2580
+ price: DecimalString;
2581
+ quantity: DecimalString;
2582
+ taker: boolean;
2583
+ fee: DecimalString;
2584
+ feeAsset: string;
2585
+ previousSize: DecimalString;
2586
+ previousEntryPrice: DecimalString;
2587
+ pnl: DecimalString;
2588
+ liquidation: boolean;
2589
+ timestamp: EpochMilliseconds;
2590
+ clientOrderId: string | undefined;
2591
+ }, {
2592
+ tid: PerpsTradeId;
2593
+ oid: PerpsOrderId;
2594
+ iid: PerpsInstrumentId;
2595
+ side: PerpsSide;
2596
+ p: DecimalString;
2597
+ qty: DecimalString;
2598
+ taker: boolean;
2599
+ fee: DecimalString;
2600
+ fea: string;
2601
+ psz: DecimalString;
2602
+ pep: DecimalString;
2603
+ pnl: DecimalString;
2604
+ liq: boolean;
2605
+ ts: EpochMilliseconds;
2606
+ coid?: string | undefined;
2607
+ }>>;
2608
+ }, z.core.$strip>, z.ZodTransform<{
2609
+ type: "fill";
2610
+ channel: "fills";
2611
+ timestamp: number;
2612
+ sequence: number;
2613
+ payload: {
2614
+ tradeId: PerpsTradeId;
2615
+ orderId: PerpsOrderId;
2616
+ instrumentId: PerpsInstrumentId;
2617
+ side: PerpsSide;
2618
+ price: DecimalString;
2619
+ quantity: DecimalString;
2620
+ taker: boolean;
2621
+ fee: DecimalString;
2622
+ feeAsset: string;
2623
+ previousSize: DecimalString;
2624
+ previousEntryPrice: DecimalString;
2625
+ pnl: DecimalString;
2626
+ liquidation: boolean;
2627
+ timestamp: EpochMilliseconds;
2628
+ clientOrderId: string | undefined;
2629
+ };
2630
+ }, {
2631
+ ts: EpochMilliseconds;
2632
+ sq: number;
2633
+ ch: "fills";
2634
+ data: {
2635
+ tradeId: PerpsTradeId;
2636
+ orderId: PerpsOrderId;
2637
+ instrumentId: PerpsInstrumentId;
2638
+ side: PerpsSide;
2639
+ price: DecimalString;
2640
+ quantity: DecimalString;
2641
+ taker: boolean;
2642
+ fee: DecimalString;
2643
+ feeAsset: string;
2644
+ previousSize: DecimalString;
2645
+ previousEntryPrice: DecimalString;
2646
+ pnl: DecimalString;
2647
+ liquidation: boolean;
2648
+ timestamp: EpochMilliseconds;
2649
+ clientOrderId: string | undefined;
2650
+ };
2651
+ }>>;
2652
+ type PerpsFillUpdateEvent = z.infer<typeof PerpsFillUpdateEventSchema>;
2653
+ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2654
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2655
+ sq: z.ZodNumber;
2656
+ ch: z.ZodLiteral<"funding">;
2657
+ data: z.ZodPipe<z.ZodObject<{
2658
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2659
+ sz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2660
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2661
+ fund: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2662
+ fua: z.ZodString;
2663
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2664
+ }, z.core.$strip>, z.ZodTransform<{
2665
+ instrumentId: PerpsInstrumentId;
2666
+ size: DecimalString;
2667
+ fundingRate: DecimalString;
2668
+ fundingAsset: string;
2669
+ funding: DecimalString;
2670
+ timestamp: EpochMilliseconds;
2671
+ }, {
2672
+ iid: PerpsInstrumentId;
2673
+ sz: DecimalString;
2674
+ fr: DecimalString;
2675
+ fund: DecimalString;
2676
+ fua: string;
2677
+ ts: EpochMilliseconds;
2678
+ }>>;
2679
+ }, z.core.$strip>, z.ZodTransform<{
2680
+ type: "funding";
2681
+ channel: "funding";
2682
+ timestamp: number;
2683
+ sequence: number;
2684
+ payload: {
2685
+ instrumentId: PerpsInstrumentId;
2686
+ size: DecimalString;
2687
+ fundingRate: DecimalString;
2688
+ fundingAsset: string;
2689
+ funding: DecimalString;
2690
+ timestamp: EpochMilliseconds;
2691
+ };
2692
+ }, {
2693
+ ts: EpochMilliseconds;
2694
+ sq: number;
2695
+ ch: "funding";
2696
+ data: {
2697
+ instrumentId: PerpsInstrumentId;
2698
+ size: DecimalString;
2699
+ fundingRate: DecimalString;
2700
+ fundingAsset: string;
2701
+ funding: DecimalString;
2702
+ timestamp: EpochMilliseconds;
2703
+ };
2704
+ }>>;
2705
+ type PerpsFundingUpdateEvent = z.infer<typeof PerpsFundingUpdateEventSchema>;
2706
+ declare const PerpsDepositUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2707
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2708
+ sq: z.ZodNumber;
2709
+ ch: z.ZodLiteral<"deposits">;
2710
+ data: z.ZodPipe<z.ZodObject<{
2711
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
2712
+ asset: z.ZodString;
2713
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
2714
+ status: z.ZodEnum<typeof PerpsDepositStatus>;
2715
+ }, z.core.$strip>, z.ZodTransform<{
2716
+ hash: _polymarket_types.TxHash | undefined;
2717
+ asset: string;
2718
+ amount: BaseUnits;
2719
+ status: PerpsDepositStatus;
2720
+ }, {
2721
+ asset: string;
2722
+ amount: BaseUnits;
2723
+ status: PerpsDepositStatus;
2724
+ hash?: _polymarket_types.TxHash | undefined;
2725
+ }>>;
2726
+ }, z.core.$strip>, z.ZodTransform<{
2727
+ type: "deposit";
2728
+ channel: "deposits";
2729
+ timestamp: number;
2730
+ sequence: number;
2731
+ payload: {
2732
+ hash: _polymarket_types.TxHash | undefined;
2733
+ asset: string;
2734
+ amount: BaseUnits;
2735
+ status: PerpsDepositStatus;
2736
+ };
2737
+ }, {
2738
+ ts: EpochMilliseconds;
2739
+ sq: number;
2740
+ ch: "deposits";
2741
+ data: {
2742
+ hash: _polymarket_types.TxHash | undefined;
2743
+ asset: string;
2744
+ amount: BaseUnits;
2745
+ status: PerpsDepositStatus;
2746
+ };
2747
+ }>>;
2748
+ type PerpsDepositUpdateEvent = z.infer<typeof PerpsDepositUpdateEventSchema>;
2749
+ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2750
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2751
+ sq: z.ZodNumber;
2752
+ ch: z.ZodLiteral<"withdrawals">;
2753
+ data: z.ZodPipe<z.ZodObject<{
2754
+ withdraw_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsWithdrawalId, number>>;
2755
+ asset: z.ZodString;
2756
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
2757
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2758
+ status: z.ZodEnum<typeof PerpsWithdrawalStatus>;
2759
+ to: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2760
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
2761
+ }, z.core.$strip>, z.ZodTransform<{
2762
+ withdrawalId: PerpsWithdrawalId;
2763
+ asset: string;
2764
+ amount: BaseUnits;
2765
+ fee: DecimalString;
2766
+ status: PerpsWithdrawalStatus;
2767
+ to: _polymarket_types.EvmAddress;
2768
+ hash: _polymarket_types.TxHash | undefined;
2769
+ }, {
2770
+ withdraw_id: PerpsWithdrawalId;
2771
+ asset: string;
2772
+ amount: BaseUnits;
2773
+ fee: DecimalString;
2774
+ status: PerpsWithdrawalStatus;
2775
+ to: _polymarket_types.EvmAddress;
2776
+ hash?: _polymarket_types.TxHash | undefined;
2777
+ }>>;
2778
+ }, z.core.$strip>, z.ZodTransform<{
2779
+ type: "withdrawal";
2780
+ channel: "withdrawals";
2781
+ timestamp: number;
2782
+ sequence: number;
2783
+ payload: {
2784
+ withdrawalId: PerpsWithdrawalId;
2785
+ asset: string;
2786
+ amount: BaseUnits;
2787
+ fee: DecimalString;
2788
+ status: PerpsWithdrawalStatus;
2789
+ to: _polymarket_types.EvmAddress;
2790
+ hash: _polymarket_types.TxHash | undefined;
2791
+ };
2792
+ }, {
2793
+ ts: EpochMilliseconds;
2794
+ sq: number;
2795
+ ch: "withdrawals";
2796
+ data: {
2797
+ withdrawalId: PerpsWithdrawalId;
2798
+ asset: string;
2799
+ amount: BaseUnits;
2800
+ fee: DecimalString;
2801
+ status: PerpsWithdrawalStatus;
2802
+ to: _polymarket_types.EvmAddress;
2803
+ hash: _polymarket_types.TxHash | undefined;
2804
+ };
2805
+ }>>;
2806
+ type PerpsWithdrawalUpdateEvent = z.infer<typeof PerpsWithdrawalUpdateEventSchema>;
2807
+ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
2808
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2809
+ sq: z.ZodNumber;
2810
+ ch: z.ZodLiteral<"balances">;
2811
+ data: z.ZodObject<{
2812
+ asset: z.ZodString;
2813
+ balance: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2814
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2815
+ }, z.core.$strip>;
2816
+ }, z.core.$strip>, z.ZodTransform<{
2817
+ type: "balance";
2818
+ channel: "balances";
2819
+ timestamp: number;
2820
+ sequence: number;
2821
+ payload: {
2822
+ asset: string;
2823
+ balance: DecimalString;
2824
+ value: DecimalString;
2825
+ };
2826
+ }, {
2827
+ ts: EpochMilliseconds;
2828
+ sq: number;
2829
+ ch: "balances";
2830
+ data: {
2831
+ asset: string;
2832
+ balance: DecimalString;
2833
+ value: DecimalString;
2834
+ };
2835
+ }>>, z.ZodPipe<z.ZodObject<{
2836
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2837
+ sq: z.ZodNumber;
2838
+ ch: z.ZodLiteral<"portfolio">;
2839
+ data: z.ZodPipe<z.ZodObject<{
2840
+ positions: z.ZodArray<z.ZodPipe<z.ZodObject<{
2841
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2842
+ symbol: z.ZodString;
2843
+ size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2844
+ entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2845
+ leverage: z.ZodNumber;
2846
+ cross: z.ZodBoolean;
2847
+ initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2848
+ maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2849
+ position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2850
+ liquidation_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2851
+ unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2852
+ return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2853
+ cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2854
+ }, z.core.$strip>, z.ZodTransform<{
2855
+ instrumentId: PerpsInstrumentId;
2856
+ symbol: string;
2857
+ size: DecimalString;
2858
+ entryPrice: DecimalString;
2859
+ leverage: number;
2860
+ cross: boolean;
2861
+ initialMargin: DecimalString;
2862
+ maintenanceMargin: DecimalString;
2863
+ positionValue: DecimalString;
2864
+ liquidationPrice: DecimalString;
2865
+ unrealizedPnl: DecimalString;
2866
+ returnOnEquity: DecimalString;
2867
+ cumulativeFunding: DecimalString;
2868
+ }, {
2869
+ instrument_id: PerpsInstrumentId;
2870
+ symbol: string;
2871
+ size: DecimalString;
2872
+ entry_price: DecimalString;
2873
+ leverage: number;
2874
+ cross: boolean;
2875
+ initial_margin: DecimalString;
2876
+ maintenance_margin: DecimalString;
2877
+ position_value: DecimalString;
2878
+ liquidation_price: DecimalString;
2879
+ unrealized_pnl: DecimalString;
2880
+ return_on_equity: DecimalString;
2881
+ cumulative_funding: DecimalString;
2882
+ }>>>;
2883
+ margin: z.ZodPipe<z.ZodObject<{
2884
+ total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2885
+ total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2886
+ total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2887
+ total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2888
+ }, z.core.$strip>, z.ZodTransform<{
2889
+ totalAccountValue: DecimalString;
2890
+ totalInitialMargin: DecimalString;
2891
+ totalMaintenanceMargin: DecimalString;
2892
+ totalPositionValue: DecimalString;
2893
+ }, {
2894
+ total_account_value: DecimalString;
2895
+ total_initial_margin: DecimalString;
2896
+ total_maintenance_margin: DecimalString;
2897
+ total_position_value: DecimalString;
2898
+ }>>;
2899
+ withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2900
+ in_liquidation: z.ZodBoolean;
2901
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2902
+ }, z.core.$strip>, z.ZodTransform<{
2903
+ positions: {
2904
+ instrumentId: PerpsInstrumentId;
2905
+ symbol: string;
2906
+ size: DecimalString;
2907
+ entryPrice: DecimalString;
2908
+ leverage: number;
2909
+ cross: boolean;
2910
+ initialMargin: DecimalString;
2911
+ maintenanceMargin: DecimalString;
2912
+ positionValue: DecimalString;
2913
+ liquidationPrice: DecimalString;
2914
+ unrealizedPnl: DecimalString;
2915
+ returnOnEquity: DecimalString;
2916
+ cumulativeFunding: DecimalString;
2917
+ }[];
2918
+ margin: {
2919
+ totalAccountValue: DecimalString;
2920
+ totalInitialMargin: DecimalString;
2921
+ totalMaintenanceMargin: DecimalString;
2922
+ totalPositionValue: DecimalString;
2923
+ };
2924
+ withdrawable: DecimalString;
2925
+ inLiquidation: boolean;
2926
+ timestamp: EpochMilliseconds;
2927
+ }, {
2928
+ positions: {
2929
+ instrumentId: PerpsInstrumentId;
2930
+ symbol: string;
2931
+ size: DecimalString;
2932
+ entryPrice: DecimalString;
2933
+ leverage: number;
2934
+ cross: boolean;
2935
+ initialMargin: DecimalString;
2936
+ maintenanceMargin: DecimalString;
2937
+ positionValue: DecimalString;
2938
+ liquidationPrice: DecimalString;
2939
+ unrealizedPnl: DecimalString;
2940
+ returnOnEquity: DecimalString;
2941
+ cumulativeFunding: DecimalString;
2942
+ }[];
2943
+ margin: {
2944
+ totalAccountValue: DecimalString;
2945
+ totalInitialMargin: DecimalString;
2946
+ totalMaintenanceMargin: DecimalString;
2947
+ totalPositionValue: DecimalString;
2948
+ };
2949
+ withdrawable: DecimalString;
2950
+ in_liquidation: boolean;
2951
+ timestamp: EpochMilliseconds;
2952
+ }>>;
2953
+ }, z.core.$strip>, z.ZodTransform<{
2954
+ type: "portfolio";
2955
+ channel: "portfolio";
2956
+ timestamp: number;
2957
+ sequence: number;
2958
+ payload: {
2959
+ positions: {
2960
+ instrumentId: PerpsInstrumentId;
2961
+ symbol: string;
2962
+ size: DecimalString;
2963
+ entryPrice: DecimalString;
2964
+ leverage: number;
2965
+ cross: boolean;
2966
+ initialMargin: DecimalString;
2967
+ maintenanceMargin: DecimalString;
2968
+ positionValue: DecimalString;
2969
+ liquidationPrice: DecimalString;
2970
+ unrealizedPnl: DecimalString;
2971
+ returnOnEquity: DecimalString;
2972
+ cumulativeFunding: DecimalString;
2973
+ }[];
2974
+ margin: {
2975
+ totalAccountValue: DecimalString;
2976
+ totalInitialMargin: DecimalString;
2977
+ totalMaintenanceMargin: DecimalString;
2978
+ totalPositionValue: DecimalString;
2979
+ };
2980
+ withdrawable: DecimalString;
2981
+ inLiquidation: boolean;
2982
+ timestamp: EpochMilliseconds;
2983
+ };
2984
+ }, {
2985
+ ts: EpochMilliseconds;
2986
+ sq: number;
2987
+ ch: "portfolio";
2988
+ data: {
2989
+ positions: {
2990
+ instrumentId: PerpsInstrumentId;
2991
+ symbol: string;
2992
+ size: DecimalString;
2993
+ entryPrice: DecimalString;
2994
+ leverage: number;
2995
+ cross: boolean;
2996
+ initialMargin: DecimalString;
2997
+ maintenanceMargin: DecimalString;
2998
+ positionValue: DecimalString;
2999
+ liquidationPrice: DecimalString;
3000
+ unrealizedPnl: DecimalString;
3001
+ returnOnEquity: DecimalString;
3002
+ cumulativeFunding: DecimalString;
3003
+ }[];
3004
+ margin: {
3005
+ totalAccountValue: DecimalString;
3006
+ totalInitialMargin: DecimalString;
3007
+ totalMaintenanceMargin: DecimalString;
3008
+ totalPositionValue: DecimalString;
3009
+ };
3010
+ withdrawable: DecimalString;
3011
+ inLiquidation: boolean;
3012
+ timestamp: EpochMilliseconds;
3013
+ };
3014
+ }>>, z.ZodPipe<z.ZodObject<{
3015
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3016
+ sq: z.ZodNumber;
3017
+ ch: z.ZodLiteral<"orders">;
3018
+ data: z.ZodPipe<z.ZodObject<{
3019
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
3020
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3021
+ buy: z.ZodBoolean;
3022
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3023
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3024
+ tif: z.ZodEnum<typeof PerpsTimeInForce>;
3025
+ po: z.ZodBoolean;
3026
+ status: z.ZodString;
3027
+ rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3028
+ fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3029
+ cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3030
+ uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3031
+ coid: z.ZodOptional<z.ZodString>;
3032
+ }, z.core.$strip>, z.ZodTransform<{
3033
+ orderId: PerpsOrderId;
3034
+ instrumentId: PerpsInstrumentId;
3035
+ buy: boolean;
3036
+ price: DecimalString;
3037
+ quantity: DecimalString;
3038
+ timeInForce: PerpsTimeInForce;
3039
+ postOnly: boolean;
3040
+ status: string;
3041
+ restingQuantity: DecimalString;
3042
+ filledQuantity: DecimalString;
3043
+ createdTimestamp: EpochMilliseconds;
3044
+ updatedTimestamp: EpochMilliseconds;
3045
+ clientOrderId: string | undefined;
3046
+ }, {
3047
+ oid: PerpsOrderId;
3048
+ iid: PerpsInstrumentId;
3049
+ buy: boolean;
3050
+ p: DecimalString;
3051
+ qty: DecimalString;
3052
+ tif: PerpsTimeInForce;
3053
+ po: boolean;
3054
+ status: string;
3055
+ rest: DecimalString;
3056
+ fill: DecimalString;
3057
+ cts: EpochMilliseconds;
3058
+ uts: EpochMilliseconds;
3059
+ coid?: string | undefined;
3060
+ }>>;
3061
+ }, z.core.$strip>, z.ZodTransform<{
3062
+ type: "order";
3063
+ channel: "orders";
3064
+ timestamp: number;
3065
+ sequence: number;
3066
+ payload: {
3067
+ orderId: PerpsOrderId;
3068
+ instrumentId: PerpsInstrumentId;
3069
+ buy: boolean;
3070
+ price: DecimalString;
3071
+ quantity: DecimalString;
3072
+ timeInForce: PerpsTimeInForce;
3073
+ postOnly: boolean;
3074
+ status: string;
3075
+ restingQuantity: DecimalString;
3076
+ filledQuantity: DecimalString;
3077
+ createdTimestamp: EpochMilliseconds;
3078
+ updatedTimestamp: EpochMilliseconds;
3079
+ clientOrderId: string | undefined;
3080
+ };
3081
+ }, {
3082
+ ts: EpochMilliseconds;
3083
+ sq: number;
3084
+ ch: "orders";
3085
+ data: {
3086
+ orderId: PerpsOrderId;
3087
+ instrumentId: PerpsInstrumentId;
3088
+ buy: boolean;
3089
+ price: DecimalString;
3090
+ quantity: DecimalString;
3091
+ timeInForce: PerpsTimeInForce;
3092
+ postOnly: boolean;
3093
+ status: string;
3094
+ restingQuantity: DecimalString;
3095
+ filledQuantity: DecimalString;
3096
+ createdTimestamp: EpochMilliseconds;
3097
+ updatedTimestamp: EpochMilliseconds;
3098
+ clientOrderId: string | undefined;
3099
+ };
3100
+ }>>, z.ZodPipe<z.ZodObject<{
3101
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3102
+ sq: z.ZodNumber;
3103
+ ch: z.ZodLiteral<"fills">;
3104
+ data: z.ZodPipe<z.ZodObject<{
3105
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
3106
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
3107
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3108
+ side: z.ZodEnum<typeof PerpsSide>;
3109
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3110
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3111
+ taker: z.ZodBoolean;
3112
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3113
+ fea: z.ZodString;
3114
+ psz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3115
+ pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3116
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3117
+ liq: z.ZodBoolean;
3118
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3119
+ coid: z.ZodOptional<z.ZodString>;
3120
+ }, z.core.$strip>, z.ZodTransform<{
3121
+ tradeId: PerpsTradeId;
3122
+ orderId: PerpsOrderId;
3123
+ instrumentId: PerpsInstrumentId;
3124
+ side: PerpsSide;
3125
+ price: DecimalString;
3126
+ quantity: DecimalString;
3127
+ taker: boolean;
3128
+ fee: DecimalString;
3129
+ feeAsset: string;
3130
+ previousSize: DecimalString;
3131
+ previousEntryPrice: DecimalString;
3132
+ pnl: DecimalString;
3133
+ liquidation: boolean;
3134
+ timestamp: EpochMilliseconds;
3135
+ clientOrderId: string | undefined;
3136
+ }, {
3137
+ tid: PerpsTradeId;
3138
+ oid: PerpsOrderId;
3139
+ iid: PerpsInstrumentId;
3140
+ side: PerpsSide;
3141
+ p: DecimalString;
3142
+ qty: DecimalString;
3143
+ taker: boolean;
3144
+ fee: DecimalString;
3145
+ fea: string;
3146
+ psz: DecimalString;
3147
+ pep: DecimalString;
3148
+ pnl: DecimalString;
3149
+ liq: boolean;
3150
+ ts: EpochMilliseconds;
3151
+ coid?: string | undefined;
3152
+ }>>;
3153
+ }, z.core.$strip>, z.ZodTransform<{
3154
+ type: "fill";
3155
+ channel: "fills";
3156
+ timestamp: number;
3157
+ sequence: number;
3158
+ payload: {
3159
+ tradeId: PerpsTradeId;
3160
+ orderId: PerpsOrderId;
3161
+ instrumentId: PerpsInstrumentId;
3162
+ side: PerpsSide;
3163
+ price: DecimalString;
3164
+ quantity: DecimalString;
3165
+ taker: boolean;
3166
+ fee: DecimalString;
3167
+ feeAsset: string;
3168
+ previousSize: DecimalString;
3169
+ previousEntryPrice: DecimalString;
3170
+ pnl: DecimalString;
3171
+ liquidation: boolean;
3172
+ timestamp: EpochMilliseconds;
3173
+ clientOrderId: string | undefined;
3174
+ };
3175
+ }, {
3176
+ ts: EpochMilliseconds;
3177
+ sq: number;
3178
+ ch: "fills";
3179
+ data: {
3180
+ tradeId: PerpsTradeId;
3181
+ orderId: PerpsOrderId;
3182
+ instrumentId: PerpsInstrumentId;
3183
+ side: PerpsSide;
3184
+ price: DecimalString;
3185
+ quantity: DecimalString;
3186
+ taker: boolean;
3187
+ fee: DecimalString;
3188
+ feeAsset: string;
3189
+ previousSize: DecimalString;
3190
+ previousEntryPrice: DecimalString;
3191
+ pnl: DecimalString;
3192
+ liquidation: boolean;
3193
+ timestamp: EpochMilliseconds;
3194
+ clientOrderId: string | undefined;
3195
+ };
3196
+ }>>, z.ZodPipe<z.ZodObject<{
3197
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3198
+ sq: z.ZodNumber;
3199
+ ch: z.ZodLiteral<"funding">;
3200
+ data: z.ZodPipe<z.ZodObject<{
3201
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3202
+ sz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3203
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3204
+ fund: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3205
+ fua: z.ZodString;
3206
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3207
+ }, z.core.$strip>, z.ZodTransform<{
3208
+ instrumentId: PerpsInstrumentId;
3209
+ size: DecimalString;
3210
+ fundingRate: DecimalString;
3211
+ fundingAsset: string;
3212
+ funding: DecimalString;
3213
+ timestamp: EpochMilliseconds;
3214
+ }, {
3215
+ iid: PerpsInstrumentId;
3216
+ sz: DecimalString;
3217
+ fr: DecimalString;
3218
+ fund: DecimalString;
3219
+ fua: string;
3220
+ ts: EpochMilliseconds;
3221
+ }>>;
3222
+ }, z.core.$strip>, z.ZodTransform<{
3223
+ type: "funding";
3224
+ channel: "funding";
3225
+ timestamp: number;
3226
+ sequence: number;
3227
+ payload: {
3228
+ instrumentId: PerpsInstrumentId;
3229
+ size: DecimalString;
3230
+ fundingRate: DecimalString;
3231
+ fundingAsset: string;
3232
+ funding: DecimalString;
3233
+ timestamp: EpochMilliseconds;
3234
+ };
3235
+ }, {
3236
+ ts: EpochMilliseconds;
3237
+ sq: number;
3238
+ ch: "funding";
3239
+ data: {
3240
+ instrumentId: PerpsInstrumentId;
3241
+ size: DecimalString;
3242
+ fundingRate: DecimalString;
3243
+ fundingAsset: string;
3244
+ funding: DecimalString;
3245
+ timestamp: EpochMilliseconds;
3246
+ };
3247
+ }>>, z.ZodPipe<z.ZodObject<{
3248
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3249
+ sq: z.ZodNumber;
3250
+ ch: z.ZodLiteral<"deposits">;
3251
+ data: z.ZodPipe<z.ZodObject<{
3252
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
3253
+ asset: z.ZodString;
3254
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
3255
+ status: z.ZodEnum<typeof PerpsDepositStatus>;
3256
+ }, z.core.$strip>, z.ZodTransform<{
3257
+ hash: _polymarket_types.TxHash | undefined;
3258
+ asset: string;
3259
+ amount: BaseUnits;
3260
+ status: PerpsDepositStatus;
3261
+ }, {
3262
+ asset: string;
3263
+ amount: BaseUnits;
3264
+ status: PerpsDepositStatus;
3265
+ hash?: _polymarket_types.TxHash | undefined;
3266
+ }>>;
3267
+ }, z.core.$strip>, z.ZodTransform<{
3268
+ type: "deposit";
3269
+ channel: "deposits";
3270
+ timestamp: number;
3271
+ sequence: number;
3272
+ payload: {
3273
+ hash: _polymarket_types.TxHash | undefined;
3274
+ asset: string;
3275
+ amount: BaseUnits;
3276
+ status: PerpsDepositStatus;
3277
+ };
3278
+ }, {
3279
+ ts: EpochMilliseconds;
3280
+ sq: number;
3281
+ ch: "deposits";
3282
+ data: {
3283
+ hash: _polymarket_types.TxHash | undefined;
3284
+ asset: string;
3285
+ amount: BaseUnits;
3286
+ status: PerpsDepositStatus;
3287
+ };
3288
+ }>>, z.ZodPipe<z.ZodObject<{
3289
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3290
+ sq: z.ZodNumber;
3291
+ ch: z.ZodLiteral<"withdrawals">;
3292
+ data: z.ZodPipe<z.ZodObject<{
3293
+ withdraw_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsWithdrawalId, number>>;
3294
+ asset: z.ZodString;
3295
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
3296
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3297
+ status: z.ZodEnum<typeof PerpsWithdrawalStatus>;
3298
+ to: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
3299
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
3300
+ }, z.core.$strip>, z.ZodTransform<{
3301
+ withdrawalId: PerpsWithdrawalId;
3302
+ asset: string;
3303
+ amount: BaseUnits;
3304
+ fee: DecimalString;
3305
+ status: PerpsWithdrawalStatus;
3306
+ to: _polymarket_types.EvmAddress;
3307
+ hash: _polymarket_types.TxHash | undefined;
3308
+ }, {
3309
+ withdraw_id: PerpsWithdrawalId;
3310
+ asset: string;
3311
+ amount: BaseUnits;
3312
+ fee: DecimalString;
3313
+ status: PerpsWithdrawalStatus;
3314
+ to: _polymarket_types.EvmAddress;
3315
+ hash?: _polymarket_types.TxHash | undefined;
3316
+ }>>;
3317
+ }, z.core.$strip>, z.ZodTransform<{
3318
+ type: "withdrawal";
3319
+ channel: "withdrawals";
3320
+ timestamp: number;
3321
+ sequence: number;
3322
+ payload: {
3323
+ withdrawalId: PerpsWithdrawalId;
3324
+ asset: string;
3325
+ amount: BaseUnits;
3326
+ fee: DecimalString;
3327
+ status: PerpsWithdrawalStatus;
3328
+ to: _polymarket_types.EvmAddress;
3329
+ hash: _polymarket_types.TxHash | undefined;
3330
+ };
3331
+ }, {
3332
+ ts: EpochMilliseconds;
3333
+ sq: number;
3334
+ ch: "withdrawals";
3335
+ data: {
3336
+ withdrawalId: PerpsWithdrawalId;
3337
+ asset: string;
3338
+ amount: BaseUnits;
3339
+ fee: DecimalString;
3340
+ status: PerpsWithdrawalStatus;
3341
+ to: _polymarket_types.EvmAddress;
3342
+ hash: _polymarket_types.TxHash | undefined;
3343
+ };
3344
+ }>>]>;
3345
+ type PerpsSessionUpdateEvent = z.infer<typeof PerpsSessionUpdateEventSchema>;
3346
+ type PerpsResyncEvent = {
3347
+ type: 'resync';
3348
+ reason: 'reconnect' | 'sequence_gap';
3349
+ channel?: string;
3350
+ previousSequence?: number;
3351
+ sequence?: number;
3352
+ };
3353
+ type PerpsSessionEvent = PerpsSessionUpdateEvent | PerpsResyncEvent;
3354
+
1529
3355
  declare const CommentRemovedPayloadSchema: z.ZodObject<{
1530
3356
  id: z.ZodString;
1531
3357
  body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -3746,4 +5572,4 @@ declare const SportsResultEventSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
3746
5572
  }>>;
3747
5573
  type SportsEvent = z.infer<typeof SportsResultEventSchema>;
3748
5574
 
3749
- export { type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CustomMarketEvent, CustomMarketEventSchema, 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 PriceChange, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeEvent, RealtimeEventSchema, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };
5575
+ export { type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CustomMarketEvent, CustomMarketEventSchema, 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 PerpsCandleEvent, PerpsCandleEventSchema, type PerpsDepositUpdateEvent, PerpsDepositUpdateEventSchema, type PerpsFillUpdateEvent, PerpsFillUpdateEventSchema, type PerpsFundingUpdateEvent, PerpsFundingUpdateEventSchema, type PerpsMarketDataEvent, PerpsMarketDataEventSchema, type PerpsOrderUpdateEvent, PerpsOrderUpdateEventSchema, type PerpsPortfolioUpdateEvent, PerpsPortfolioUpdateEventSchema, type PerpsResyncEvent, type PerpsSessionEvent, type PerpsSessionUpdateEvent, PerpsSessionUpdateEventSchema, type PerpsStatisticEvent, PerpsStatisticEventSchema, type PerpsTickerEvent, PerpsTickerEventSchema, type PerpsTradeEvent, PerpsTradeEventSchema, type PerpsWithdrawalUpdateEvent, PerpsWithdrawalUpdateEventSchema, type PriceChange, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeEvent, RealtimeEventSchema, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };