perp-cli 0.14.2 → 0.15.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 (313) hide show
  1. package/README.md +152 -13
  2. package/dist/agent-wallet/store.d.ts +3 -2
  3. package/dist/agent-wallet/store.js +2 -2
  4. package/dist/api/public/hyperliquid.js +4 -0
  5. package/dist/api/public/pacifica.js +83 -13
  6. package/dist/api/public/urls.d.ts +2 -0
  7. package/dist/api/public/urls.js +3 -0
  8. package/dist/arb/utils.d.ts +1 -2
  9. package/dist/arb/utils.js +1 -2
  10. package/dist/bot/apex/pulse.js +3 -0
  11. package/dist/bot/apex/radar.js +2 -1
  12. package/dist/bot/engine.d.ts +10 -1
  13. package/dist/bot/engine.js +14 -6
  14. package/dist/bot/indicators.d.ts +7 -0
  15. package/dist/bot/indicators.js +16 -0
  16. package/dist/bot/perp-order.d.ts +4 -4
  17. package/dist/bot/perp-order.js +5 -5
  18. package/dist/bot/quarantine.d.ts +1 -1
  19. package/dist/bot/quarantine.js +1 -1
  20. package/dist/bot/strategies/apex-strategy.js +3 -2
  21. package/dist/bot/strategies/engine-mm.js +6 -5
  22. package/dist/bot/strategies/funding-arb-strategy.js +9 -9
  23. package/dist/bot/strategies/funding-arb-utils.d.ts +15 -2
  24. package/dist/bot/strategies/funding-arb-utils.js +43 -24
  25. package/dist/bot/strategies/funding-auto.js +2 -2
  26. package/dist/bot/strategies/liquidation-mm.d.ts +1 -0
  27. package/dist/bot/strategies/liquidation-mm.js +8 -2
  28. package/dist/bot/strategies/momentum-breakout.d.ts +1 -0
  29. package/dist/bot/strategies/momentum-breakout.js +11 -3
  30. package/dist/bot/strategies/spot-perp-arb-strategy.js +23 -12
  31. package/dist/bot/strategies/spot-perp-executor.d.ts +1 -1
  32. package/dist/bot/strategies/spot-perp-executor.js +1 -1
  33. package/dist/bot/strategy-types.d.ts +2 -1
  34. package/dist/bot/tui/BotDashboard.d.ts +1 -1
  35. package/dist/bot/tui/BotDashboard.js +1 -1
  36. package/dist/cache.js +12 -6
  37. package/dist/cli-program.d.ts +15 -0
  38. package/dist/cli-program.js +125 -5
  39. package/dist/commands/agent-import.d.ts +7 -0
  40. package/dist/commands/agent-import.js +30 -1
  41. package/dist/commands/agent.d.ts +6 -3
  42. package/dist/commands/agent.js +160 -12
  43. package/dist/commands/arb/index.js +4 -4
  44. package/dist/commands/arb-auto.js +21 -17
  45. package/dist/commands/arb.d.ts +12 -0
  46. package/dist/commands/arb.js +61 -143
  47. package/dist/commands/bot.js +1 -1
  48. package/dist/commands/builder.js +1 -1
  49. package/dist/commands/funds.js +113 -3
  50. package/dist/commands/init.d.ts +1 -1
  51. package/dist/commands/init.js +27 -7
  52. package/dist/commands/manage.js +23 -21
  53. package/dist/commands/market.js +168 -36
  54. package/dist/commands/options.d.ts +9 -0
  55. package/dist/commands/options.js +134 -0
  56. package/dist/commands/pacifica-earn.d.ts +5 -0
  57. package/dist/commands/pacifica-earn.js +468 -0
  58. package/dist/commands/pacifica-orders.d.ts +14 -0
  59. package/dist/commands/pacifica-orders.js +142 -0
  60. package/dist/commands/portfolio.js +32 -47
  61. package/dist/commands/rebalance.d.ts +1 -0
  62. package/dist/commands/rebalance.js +15 -0
  63. package/dist/commands/risk.d.ts +11 -2
  64. package/dist/commands/risk.js +39 -44
  65. package/dist/commands/trade.d.ts +1 -0
  66. package/dist/commands/trade.js +63 -58
  67. package/dist/commands/wallet.js +1 -1
  68. package/dist/config.d.ts +2 -2
  69. package/dist/config.js +15 -4
  70. package/dist/constants.js +6 -0
  71. package/dist/dashboard/server.js +1 -1
  72. package/dist/dashboard/ui.js +1 -1
  73. package/dist/errors.d.ts +24 -1
  74. package/dist/errors.js +25 -3
  75. package/dist/exchanges/arcus/adapter.d.ts +7 -7
  76. package/dist/exchanges/arcus/adapter.js +12 -12
  77. package/dist/exchanges/arcus/agent.d.ts +1 -1
  78. package/dist/exchanges/arcus/agent.js +1 -1
  79. package/dist/exchanges/arcus/client.js +1 -1
  80. package/dist/exchanges/arcus/signing.d.ts +2 -3
  81. package/dist/exchanges/arcus/signing.js +1 -1
  82. package/dist/exchanges/arcus/spot-chain.d.ts +1 -1
  83. package/dist/exchanges/arcus/spot-chain.js +1 -1
  84. package/dist/exchanges/arcus/spot-router.d.ts +1 -1
  85. package/dist/exchanges/arcus/spot-router.js +2 -2
  86. package/dist/exchanges/arcus/spot.d.ts +2 -3
  87. package/dist/exchanges/arcus/spot.js +2 -3
  88. package/dist/exchanges/aster-spot.d.ts +3 -3
  89. package/dist/exchanges/aster-spot.js +6 -9
  90. package/dist/exchanges/aster-typed-data.d.ts +1 -1
  91. package/dist/exchanges/aster-typed-data.js +1 -1
  92. package/dist/exchanges/aster.d.ts +9 -4
  93. package/dist/exchanges/aster.js +125 -55
  94. package/dist/exchanges/builder-fee.d.ts +1 -1
  95. package/dist/exchanges/builder-fee.js +13 -2
  96. package/dist/exchanges/canonical-symbols.d.ts +1 -2
  97. package/dist/exchanges/canonical-symbols.js +26 -2
  98. package/dist/exchanges/derive/client.d.ts +37 -0
  99. package/dist/exchanges/derive/client.js +135 -0
  100. package/dist/exchanges/derive/options.d.ts +68 -0
  101. package/dist/exchanges/derive/options.js +360 -0
  102. package/dist/exchanges/extended/adapter.d.ts +82 -0
  103. package/dist/exchanges/extended/adapter.js +179 -0
  104. package/dist/exchanges/extended/client.d.ts +38 -0
  105. package/dist/exchanges/extended/client.js +88 -0
  106. package/dist/exchanges/extended/public.d.ts +130 -0
  107. package/dist/exchanges/extended/public.js +429 -0
  108. package/dist/exchanges/grvt/adapter.d.ts +86 -0
  109. package/dist/exchanges/grvt/adapter.js +206 -0
  110. package/dist/exchanges/grvt/client.d.ts +25 -0
  111. package/dist/exchanges/grvt/client.js +86 -0
  112. package/dist/exchanges/grvt/public.d.ts +151 -0
  113. package/dist/exchanges/grvt/public.js +438 -0
  114. package/dist/exchanges/hyperliquid-spot.d.ts +1 -1
  115. package/dist/exchanges/hyperliquid-spot.js +5 -5
  116. package/dist/exchanges/hyperliquid.d.ts +22 -16
  117. package/dist/exchanges/hyperliquid.js +80 -55
  118. package/dist/exchanges/index.d.ts +1 -1
  119. package/dist/exchanges/index.js +1 -1
  120. package/dist/exchanges/interface.d.ts +97 -8
  121. package/dist/exchanges/interface.js +19 -2
  122. package/dist/exchanges/ioc-outcome.d.ts +1 -1
  123. package/dist/exchanges/ioc-outcome.js +1 -1
  124. package/dist/exchanges/legacy-trading-v2.d.ts +2 -2
  125. package/dist/exchanges/legacy-trading-v2.js +7 -2
  126. package/dist/exchanges/lighter-public.d.ts +2 -2
  127. package/dist/exchanges/lighter-public.js +2 -2
  128. package/dist/exchanges/lighter-signer.d.ts +1 -1
  129. package/dist/exchanges/lighter-signer.js +1 -1
  130. package/dist/exchanges/lighter-spot.d.ts +3 -4
  131. package/dist/exchanges/lighter-spot.js +6 -7
  132. package/dist/exchanges/lighter.d.ts +11 -11
  133. package/dist/exchanges/lighter.js +28 -14
  134. package/dist/exchanges/ondo/adapter.d.ts +5 -6
  135. package/dist/exchanges/ondo/adapter.js +16 -14
  136. package/dist/exchanges/ondo/agent.d.ts +1 -1
  137. package/dist/exchanges/ondo/agent.js +1 -1
  138. package/dist/exchanges/ondo/client.d.ts +1 -1
  139. package/dist/exchanges/ondo/client.js +2 -2
  140. package/dist/exchanges/ondo/public.d.ts +8 -1
  141. package/dist/exchanges/ondo/public.js +13 -2
  142. package/dist/exchanges/ondo/spot.d.ts +2 -2
  143. package/dist/exchanges/ondo/spot.js +3 -3
  144. package/dist/exchanges/options-interface.d.ts +158 -0
  145. package/dist/exchanges/options-interface.js +17 -0
  146. package/dist/exchanges/options-venues.d.ts +12 -0
  147. package/dist/exchanges/options-venues.js +35 -0
  148. package/dist/exchanges/pacifica-atomic.d.ts +211 -0
  149. package/dist/exchanges/pacifica-atomic.js +440 -0
  150. package/dist/exchanges/pacifica-decimal.d.ts +10 -0
  151. package/dist/exchanges/pacifica-decimal.js +51 -0
  152. package/dist/exchanges/pacifica-presigned.d.ts +53 -0
  153. package/dist/exchanges/pacifica-presigned.js +141 -0
  154. package/dist/exchanges/pacifica-print.d.ts +200 -0
  155. package/dist/exchanges/pacifica-print.js +417 -0
  156. package/dist/exchanges/pacifica-spot.d.ts +2 -2
  157. package/dist/exchanges/pacifica-spot.js +3 -3
  158. package/dist/exchanges/pacifica-typed-data.d.ts +1 -1
  159. package/dist/exchanges/pacifica-typed-data.js +1 -1
  160. package/dist/exchanges/pacifica-vaults.d.ts +121 -0
  161. package/dist/exchanges/pacifica-vaults.js +264 -0
  162. package/dist/exchanges/pacifica.d.ts +32 -5
  163. package/dist/exchanges/pacifica.js +114 -48
  164. package/dist/exchanges/precision.d.ts +3 -1
  165. package/dist/exchanges/precision.js +9 -2
  166. package/dist/exchanges/qfex/adapter.d.ts +18 -5
  167. package/dist/exchanges/qfex/adapter.js +32 -12
  168. package/dist/exchanges/qfex/agent.d.ts +1 -1
  169. package/dist/exchanges/qfex/agent.js +1 -1
  170. package/dist/exchanges/qfex/client.d.ts +1 -1
  171. package/dist/exchanges/qfex/client.js +1 -1
  172. package/dist/exchanges/qfex/errors.d.ts +1 -1
  173. package/dist/exchanges/qfex/errors.js +2 -2
  174. package/dist/exchanges/qfex/public.d.ts +3 -3
  175. package/dist/exchanges/qfex/public.js +3 -3
  176. package/dist/exchanges/qfex/signing.d.ts +2 -2
  177. package/dist/exchanges/qfex/signing.js +4 -5
  178. package/dist/exchanges/qfex/ws-transport.d.ts +2 -2
  179. package/dist/exchanges/qfex/ws-transport.js +3 -3
  180. package/dist/exchanges/rate-limiter.d.ts +1 -1
  181. package/dist/exchanges/rate-limiter.js +5 -2
  182. package/dist/exchanges/registry.d.ts +1 -1
  183. package/dist/exchanges/registry.js +1 -1
  184. package/dist/exchanges/risex/adapter.d.ts +148 -0
  185. package/dist/exchanges/risex/adapter.js +796 -0
  186. package/dist/exchanges/risex/agent.d.ts +154 -0
  187. package/dist/exchanges/risex/agent.js +384 -0
  188. package/dist/exchanges/risex/client.d.ts +47 -0
  189. package/dist/exchanges/risex/client.js +174 -0
  190. package/dist/exchanges/risex/nonce.d.ts +43 -0
  191. package/dist/exchanges/risex/nonce.js +212 -0
  192. package/dist/exchanges/risex/public.d.ts +64 -0
  193. package/dist/exchanges/risex/public.js +150 -0
  194. package/dist/exchanges/risex/session.d.ts +71 -0
  195. package/dist/exchanges/risex/session.js +171 -0
  196. package/dist/exchanges/risex/typed-data.d.ts +173 -0
  197. package/dist/exchanges/risex/typed-data.js +240 -0
  198. package/dist/exchanges/risex/units.d.ts +29 -0
  199. package/dist/exchanges/risex/units.js +104 -0
  200. package/dist/exchanges/slippage.d.ts +1 -1
  201. package/dist/exchanges/slippage.js +1 -1
  202. package/dist/exchanges/spot-factory.d.ts +3 -3
  203. package/dist/exchanges/spot-factory.js +7 -7
  204. package/dist/exchanges/spot-interface.d.ts +5 -5
  205. package/dist/exchanges/spot-interface.js +2 -2
  206. package/dist/exchanges/spot-result.d.ts +3 -3
  207. package/dist/exchanges/spot-result.js +3 -3
  208. package/dist/exchanges/trading-v2.d.ts +3 -3
  209. package/dist/exchanges/trading-v2.js +9 -6
  210. package/dist/exchanges/txflow/adapter.d.ts +54 -0
  211. package/dist/exchanges/txflow/adapter.js +118 -0
  212. package/dist/exchanges/txflow/client.d.ts +47 -0
  213. package/dist/exchanges/txflow/client.js +153 -0
  214. package/dist/exchanges/txflow/public.d.ts +76 -0
  215. package/dist/exchanges/txflow/public.js +284 -0
  216. package/dist/exchanges/unknown-symbol.d.ts +29 -0
  217. package/dist/exchanges/unknown-symbol.js +51 -0
  218. package/dist/exchanges/variational/adapter.d.ts +71 -0
  219. package/dist/exchanges/variational/adapter.js +137 -0
  220. package/dist/exchanges/variational/client.d.ts +21 -0
  221. package/dist/exchanges/variational/client.js +66 -0
  222. package/dist/exchanges/variational/public.d.ts +126 -0
  223. package/dist/exchanges/variational/public.js +430 -0
  224. package/dist/exchanges/venue-types.d.ts +6 -7
  225. package/dist/exchanges/venue-types.js +2 -2
  226. package/dist/exchanges/venue.d.ts +51 -8
  227. package/dist/exchanges/venue.js +54 -4
  228. package/dist/exchanges/venues/arcus.d.ts +1 -2
  229. package/dist/exchanges/venues/arcus.js +5 -4
  230. package/dist/exchanges/venues/aster.d.ts +2 -2
  231. package/dist/exchanges/venues/aster.js +6 -4
  232. package/dist/exchanges/venues/create-helpers.d.ts +1 -1
  233. package/dist/exchanges/venues/create-helpers.js +3 -3
  234. package/dist/exchanges/venues/extended.d.ts +21 -0
  235. package/dist/exchanges/venues/extended.js +96 -0
  236. package/dist/exchanges/venues/grvt.d.ts +30 -0
  237. package/dist/exchanges/venues/grvt.js +98 -0
  238. package/dist/exchanges/venues/hyperliquid.d.ts +2 -2
  239. package/dist/exchanges/venues/hyperliquid.js +10 -8
  240. package/dist/exchanges/venues/index.d.ts +7 -2
  241. package/dist/exchanges/venues/index.js +8 -2
  242. package/dist/exchanges/venues/lighter-family.d.ts +7 -9
  243. package/dist/exchanges/venues/lighter-family.js +9 -11
  244. package/dist/exchanges/venues/lighter-rh.d.ts +2 -2
  245. package/dist/exchanges/venues/lighter-rh.js +7 -5
  246. package/dist/exchanges/venues/lighter.d.ts +1 -1
  247. package/dist/exchanges/venues/lighter.js +5 -3
  248. package/dist/exchanges/venues/ondo.d.ts +1 -1
  249. package/dist/exchanges/venues/ondo.js +5 -3
  250. package/dist/exchanges/venues/pacifica.d.ts +2 -2
  251. package/dist/exchanges/venues/pacifica.js +6 -4
  252. package/dist/exchanges/venues/qfex.d.ts +1 -1
  253. package/dist/exchanges/venues/qfex.js +4 -2
  254. package/dist/exchanges/venues/risex-release.d.ts +14 -0
  255. package/dist/exchanges/venues/risex-release.js +14 -0
  256. package/dist/exchanges/venues/risex.d.ts +31 -0
  257. package/dist/exchanges/venues/risex.js +116 -0
  258. package/dist/exchanges/venues/txflow.d.ts +18 -0
  259. package/dist/exchanges/venues/txflow.js +77 -0
  260. package/dist/exchanges/venues/variational.d.ts +21 -0
  261. package/dist/exchanges/venues/variational.js +85 -0
  262. package/dist/execution-log.d.ts +1 -1
  263. package/dist/funding/legacy-public.d.ts +1 -1
  264. package/dist/funding/legacy-public.js +9 -4
  265. package/dist/funding/normalize.d.ts +1 -1
  266. package/dist/funding/normalize.js +1 -1
  267. package/dist/funding/rates.d.ts +44 -4
  268. package/dist/funding/rates.js +56 -12
  269. package/dist/index.js +7 -6
  270. package/dist/jobs.d.ts +1 -0
  271. package/dist/jobs.js +25 -1
  272. package/dist/landing.d.ts +2 -0
  273. package/dist/landing.js +1 -1
  274. package/dist/mcp-pacifica-earn.d.ts +9 -0
  275. package/dist/mcp-pacifica-earn.js +58 -0
  276. package/dist/mcp-server.js +113 -59
  277. package/dist/pacifica/client.d.ts +67 -4
  278. package/dist/pacifica/client.js +170 -8
  279. package/dist/pacifica/rate-limit.d.ts +144 -0
  280. package/dist/pacifica/rate-limit.js +267 -0
  281. package/dist/pacifica/types/order.d.ts +2 -1
  282. package/dist/plan-executor.js +7 -2
  283. package/dist/rebalance.js +1 -1
  284. package/dist/risk.d.ts +2 -1
  285. package/dist/risk.js +2 -4
  286. package/dist/settings.d.ts +32 -3
  287. package/dist/signer/ows-evm.d.ts +1 -1
  288. package/dist/signer/ows-evm.js +1 -1
  289. package/dist/smart-order.d.ts +1 -1
  290. package/dist/smart-order.js +1 -1
  291. package/dist/strategies/funding-arb.d.ts +1 -1
  292. package/dist/strategies/funding-arb.js +1 -1
  293. package/dist/trade-validator.d.ts +1 -1
  294. package/dist/trade-validator.js +9 -4
  295. package/dist/utils.d.ts +12 -3
  296. package/dist/utils.js +11 -3
  297. package/dist/venue-health.d.ts +40 -0
  298. package/dist/venue-health.js +75 -0
  299. package/dist/withdraw-gate.d.ts +1 -1
  300. package/dist/withdraw-gate.js +1 -1
  301. package/dist/ws/index.d.ts +959 -0
  302. package/dist/ws/index.js +4295 -0
  303. package/dist/ws/node.d.ts +975 -0
  304. package/dist/ws/node.js +4366 -0
  305. package/dist/ws/pacifica-instrument.d.ts +8 -0
  306. package/dist/ws/pacifica-instrument.js +8 -0
  307. package/dist/ws-cli/credentials.d.ts +62 -0
  308. package/dist/ws-cli/credentials.js +126 -0
  309. package/package.json +58 -10
  310. package/skills/perp-cli/SKILL.md +62 -9
  311. package/skills/perp-cli/references/agent-operations.md +7 -0
  312. package/skills/perp-cli/references/commands.md +76 -5
  313. package/skills/perp-cli/references/ws-library.md +492 -0
@@ -0,0 +1,429 @@
1
+ /**
2
+ * Extended public market data — GET /api/v1/info/markets (one call serves markets and funding).
3
+ * Docs: https://api.docs.extended.exchange/ ("Get markets").
4
+ *
5
+ * Mapping:
6
+ * - Only `type: "PERPETUAL"` rows with `status` ACTIVE or REDUCE_ONLY are markets here. The
7
+ * `active` flag is NOT a listing state (live 2026-10-19: 54 DELISTED and 12 PRELISTED rows have
8
+ * `active: true`); SPOT rows carry perp fields as 0 (docs) and are excluded.
9
+ * - venueSymbol = `name` ("BTC-USD", "TSLA_24_5-USD", "SPX500m-USD"), the wire id of every
10
+ * per-market endpoint. symbol = `assetName` upper-cased with the `_24_5` naming suffix removed
11
+ * ("TSLA_24_5" → "TSLA", "SPX500m" → "SPX500M"). Two listed markets with one symbol: the single
12
+ * ACTIVE one is kept, else both are skipped (warned).
13
+ * - tradable = status ACTIVE && !isOffHours (docs "Trading hours": while isOffHours, order
14
+ * placement and execution are unavailable). REDUCE_ONLY rows are listed, not tradable.
15
+ * - tick = tradingConfig.minPriceChange, step = minOrderSizeChange, min size = minOrderSize,
16
+ * maxLeverage = tradingConfig.maxLeverage; marginTiers from riskFactorConfig (rows available to
17
+ * users; leverage = 1 / riskFactor — the first tier equals maxLeverage on every live market).
18
+ * - open interest = marketStats.openInterestBase (base units); 24h volume = dailyVolume (USD).
19
+ *
20
+ * Asset class (`category` / `subCategory`): Crypto → crypto; RWA → Equity: equity, Commodity:
21
+ * commodity, FX: fx, Pre-market: preIpo, ETF/Index: etf for the ETFs in EXTENDED_ETFS, else index.
22
+ * Any other category / subCategory is skipped with a warning (never guessed).
23
+ *
24
+ * Canonical (cross-venue key, canonical-symbols.ts): crypto and equity / ETF by ticker identity;
25
+ * index / commodity / fx / preIpo only through EXPLICIT_CANONICAL. An RWA ticker that is also a
26
+ * crypto ticker is NEVER matched (canonical null): EXTENDED_RWA_CRYPTO_COLLISIONS (PURR =
27
+ * Hyperliquid Strategies Inc. vs the PURR token; QNT = Quantinuum vs Quant; BB = BlackBerry vs
28
+ * BounceBit; ON = ON Semiconductor vs the ON token; ADI = Analog Devices vs the ADI token). An RWA
29
+ * ticker equal to one of Extended's own crypto symbols is never matched either: symbols are unique per
30
+ * listing (dedupeSymbols). The crypto SPX market (SPX6900) is ambiguous with the S&P 500 index
31
+ * canonical "SPX" and is never matched (EXTENDED_AMBIGUOUS_CRYPTO, as Hyperliquid's SPX). XIAOMI is
32
+ * not matched (EXTENDED_UNMATCHED_EQUITIES): ~7.8× the Lighter / Aster XIAOMI price on 2026-10-19,
33
+ * i.e. a different unit (HKD-per-share vs a USD-quoted product), not the same contract.
34
+ *
35
+ * Funding (docs "Get funding rates history" + docs.extended.exchange funding-payments):
36
+ * - applied once per hour ("While the funding rate is calculated every minute, it is only applied
37
+ * once per hour"); payment = position size × mark price × (−rate).
38
+ * - marketStats.fundingRate is a FRACTION per hour (crypto interest component 0.01 % / 8 h =
39
+ * 0.0000125 / h, published as "0.000013"; RWA 0.0035 % / 8 h → "0.000004").
40
+ * - it is the CURRENT hour's rate, recomputed every minute (accruing): it can differ from the last
41
+ * applied print in /info/<market>/funding mid-hour, and becomes that print at the hour.
42
+ * - marketStats.nextFundingRate is (despite its name) the timestamp (ms) of the next application.
43
+ * - rates are published ROUNDED TO 6 DECIMALS (resolution 0.000001 / h ≈ 0.876 % APR): the
44
+ * 0.0000125 baseline reads "0.000013", and a rate below 0.0000005 / h reads "0.000000".
45
+ * - `_24_5` RWA equities print 0 while their underlying is closed (TSLA_24_5-USD: 34 of 43
46
+ * weekend prints were 0), so an hourly rate × 8760 overstates them — the venue is
47
+ * fundingVerified false (venues/extended.ts).
48
+ */
49
+ import { PerpError } from "../../errors.js";
50
+ import { canonicalFor } from "../canonical-symbols.js";
51
+ import { networkConfig } from "../venue.js";
52
+ import { extendedVenue } from "../venues/extended.js";
53
+ import { symbolNotFound } from "../unknown-symbol.js";
54
+ import { EXTENDED_MARKET_NOT_FOUND, ExtendedClient, extendedShapeError } from "./client.js";
55
+ export const EXTENDED_FUNDING_BASIS = { kind: "perHours", hours: 1 };
56
+ /** RWA "ETF/Index" markets that are ETFs (the rest of that subCategory are indices). */
57
+ export const EXTENDED_ETFS = new Set(["DRAM", "SOXL", "EWY", "KORU"]);
58
+ /**
59
+ * RWA tickers that are also crypto tickers on other venues (live 2026-10-19) — never matched.
60
+ * ADI: Analog Devices vs Lighter's ADI token. BOT: RoboStrategy (PRELISTED on 2026-10-19) vs the BOT
61
+ * token (Lighter LIGHTER_AMBIGUOUS). WEN (also Lighter-ambiguous) is not listed on Extended.
62
+ */
63
+ export const EXTENDED_RWA_CRYPTO_COLLISIONS = new Set(["PURR", "QNT", "BB", "ON", "ADI", "BOT"]);
64
+ /** RWA markets whose product differs from the same ticker elsewhere (XIAOMI: ~7.8× Lighter / Aster). */
65
+ export const EXTENDED_UNMATCHED_EQUITIES = new Set(["XIAOMI"]);
66
+ /** Crypto tickers that name an index elsewhere — never matched (SPX-USD = SPX6900, not the S&P 500). */
67
+ export const EXTENDED_AMBIGUOUS_CRYPTO = new Set(["SPX"]);
68
+ const LISTED_STATUSES = new Set(["ACTIVE", "REDUCE_ONLY"]);
69
+ const DEC = /^-?\d+(\.\d+)?$/;
70
+ function str(o, key, where) {
71
+ const v = o[key];
72
+ if (typeof v !== "string" || v === "")
73
+ throw extendedShapeError(`${where}.${key} is not a string`);
74
+ return v;
75
+ }
76
+ function decStr(o, key, where) {
77
+ const v = str(o, key, where);
78
+ if (!DEC.test(v))
79
+ throw extendedShapeError(`${where}.${key} "${v}" is not a decimal string`);
80
+ return v;
81
+ }
82
+ /** A published decimal string, or null when absent / not a decimal. */
83
+ function decOrNull(v) {
84
+ return typeof v === "string" && DEC.test(v) ? v : null;
85
+ }
86
+ function positiveOrNull(v) {
87
+ const d = decOrNull(v);
88
+ return d !== null && Number(d) > 0 ? d : null;
89
+ }
90
+ function obj(v, where) {
91
+ if (v === null || typeof v !== "object" || Array.isArray(v))
92
+ throw extendedShapeError(`${where} is not an object`);
93
+ return v;
94
+ }
95
+ /** "TSLA_24_5" → "TSLA"; "SPX500m" → "SPX500M". */
96
+ export function extendedSymbolOf(assetName) {
97
+ return assetName.replace(/_24_5$/, "").toUpperCase();
98
+ }
99
+ /** Asset class from category / subCategory; null = unknown (the row is skipped with a warning). */
100
+ export function extendedAssetClass(category, subCategory, symbol) {
101
+ if (category === "Crypto")
102
+ return "crypto";
103
+ if (category !== "RWA")
104
+ return null;
105
+ switch (subCategory) {
106
+ case "Equity": return "equity";
107
+ case "Commodity": return "commodity";
108
+ case "FX": return "fx";
109
+ case "Pre-market": return "preIpo";
110
+ case "ETF/Index": return EXTENDED_ETFS.has(symbol) ? "etf" : "index";
111
+ default: return null;
112
+ }
113
+ }
114
+ /** Canonical key, or null when the market must not be matched across venues. */
115
+ export function extendedCanonical(symbol, assetClass) {
116
+ if (assetClass === "crypto" && EXTENDED_AMBIGUOUS_CRYPTO.has(symbol))
117
+ return null;
118
+ if (assetClass !== "crypto" && (EXTENDED_RWA_CRYPTO_COLLISIONS.has(symbol) || EXTENDED_UNMATCHED_EQUITIES.has(symbol)))
119
+ return null;
120
+ return canonicalFor("extended", symbol, assetClass);
121
+ }
122
+ function marginTiersOf(tc, where) {
123
+ const raw = tc.riskFactorConfig;
124
+ if (!Array.isArray(raw) || raw.length === 0)
125
+ throw extendedShapeError(`${where}.riskFactorConfig is not a list`);
126
+ const tiers = [];
127
+ let lower = 0;
128
+ for (const t of raw) {
129
+ const r = obj(t, `${where}.riskFactorConfig[]`);
130
+ const upper = Number(decStr(r, "upperBound", `${where}.riskFactorConfig[]`));
131
+ const rf = Number(decStr(r, "riskFactor", `${where}.riskFactorConfig[]`));
132
+ if (typeof r.isAvailableForUsers !== "boolean")
133
+ throw extendedShapeError(`${where}.riskFactorConfig[].isAvailableForUsers is not a boolean`);
134
+ if (!(rf > 0))
135
+ throw extendedShapeError(`${where}.riskFactorConfig[].riskFactor ${rf} is not positive`);
136
+ if (r.isAvailableForUsers)
137
+ tiers.push({ lowerBound: lower, maxLeverage: 1 / rf });
138
+ lower = upper;
139
+ }
140
+ if (tiers.length === 0)
141
+ throw extendedShapeError(`${where} has no risk tier available to users`);
142
+ return tiers;
143
+ }
144
+ function describe(e) {
145
+ return e instanceof Error ? e.message : String(e);
146
+ }
147
+ /** Classify one /info/markets row: a listed perpetual, or null (not a listed perp). Shape drift throws. */
148
+ function classifyRow(item, unclassified) {
149
+ const r = obj(item, "/info/markets data[]");
150
+ const name = str(r, "name", "market");
151
+ const where = `market ${name}`;
152
+ if (str(r, "type", where) !== "PERPETUAL")
153
+ return null;
154
+ const status = str(r, "status", where);
155
+ if (!LISTED_STATUSES.has(status))
156
+ return null;
157
+ const symbol = extendedSymbolOf(str(r, "assetName", where));
158
+ const sub = r.subCategory;
159
+ const assetClass = extendedAssetClass(str(r, "category", where), typeof sub === "string" ? sub : null, symbol);
160
+ if (assetClass === null) {
161
+ unclassified.push(`${name} (${String(r.category)}/${String(sub)})`);
162
+ return null;
163
+ }
164
+ return { raw: r, name, symbol, assetClass, status: status };
165
+ }
166
+ /**
167
+ * One symbol per market: when several listed rows map to one symbol (a ticker migration such as
168
+ * NOW_24_5-USD → NOW-USD), the single ACTIVE row is kept and the others dropped; with no single
169
+ * ACTIVE row, every row of that symbol is skipped. Both cases are warned, never silent.
170
+ */
171
+ function dedupeSymbols(listed, warn) {
172
+ const groups = new Map();
173
+ for (const l of listed) {
174
+ const g = groups.get(l.symbol);
175
+ if (g === undefined)
176
+ groups.set(l.symbol, [l]);
177
+ else
178
+ g.push(l);
179
+ }
180
+ const out = [];
181
+ for (const [symbol, g] of groups) {
182
+ if (g.length === 1) {
183
+ out.push(g[0]);
184
+ continue;
185
+ }
186
+ const active = g.filter(l => l.status === "ACTIVE");
187
+ const names = g.map(l => `${l.name} (${l.status})`).join(", ");
188
+ if (active.length === 1) {
189
+ out.push(active[0]);
190
+ warn(`[extended] ${g.length} listed markets map to symbol ${symbol}: ${names} — kept the ACTIVE ${active[0].name}`);
191
+ }
192
+ else {
193
+ warn(`[extended] ${g.length} listed markets map to symbol ${symbol}: ${names} — no single ACTIVE row, all skipped`);
194
+ }
195
+ }
196
+ return out;
197
+ }
198
+ function buildRow(l) {
199
+ const { raw: r, name, symbol, assetClass, status } = l;
200
+ const where = `market ${name}`;
201
+ const stats = obj(r.marketStats, `${where}.marketStats`);
202
+ const tc = obj(r.tradingConfig, `${where}.tradingConfig`);
203
+ const mark = positiveOrNull(stats.markPrice);
204
+ if (mark === null)
205
+ return "unpriced";
206
+ if (typeof r.isRfq !== "boolean" || typeof r.isOffHours !== "boolean")
207
+ throw extendedShapeError(`${where} has no isRfq / isOffHours flags`);
208
+ const maxLeverage = Number(decStr(tc, "maxLeverage", `${where}.tradingConfig`));
209
+ if (!(maxLeverage > 0))
210
+ throw extendedShapeError(`${where}.tradingConfig.maxLeverage is not positive`);
211
+ const next = stats.nextFundingRate;
212
+ const nextFundingTime = typeof next === "number" && Number.isInteger(next) && next > 0 ? next : null;
213
+ const canonical = extendedCanonical(symbol, assetClass);
214
+ const meta = {
215
+ name, symbol, assetClass, canonical, status,
216
+ isRfq: r.isRfq, isOffHours: r.isOffHours, tradingHours: str(r, "tradingHours", where),
217
+ };
218
+ return {
219
+ meta,
220
+ nextFundingTime,
221
+ market: {
222
+ venue: "extended",
223
+ venueSymbol: name,
224
+ symbol,
225
+ canonical,
226
+ assetClass,
227
+ settle: "USD",
228
+ quoteAsset: str(r, "collateralAssetName", where),
229
+ markPrice: mark,
230
+ indexPrice: positiveOrNull(stats.indexPrice),
231
+ fundingRate: decOrNull(stats.fundingRate),
232
+ fundingRateBasis: EXTENDED_FUNDING_BASIS,
233
+ settlementIntervalHours: 1,
234
+ openInterest: decOrNull(stats.openInterestBase),
235
+ volume24h: decOrNull(stats.dailyVolume),
236
+ tickSize: decStr(tc, "minPriceChange", `${where}.tradingConfig`),
237
+ stepSize: decStr(tc, "minOrderSizeChange", `${where}.tradingConfig`),
238
+ minSize: decStr(tc, "minOrderSize", `${where}.tradingConfig`),
239
+ minNotional: null,
240
+ maxLeverage,
241
+ marginTiers: marginTiersOf(tc, `${where}.tradingConfig`),
242
+ session: null,
243
+ tradable: status === "ACTIVE" && !r.isOffHours,
244
+ },
245
+ };
246
+ }
247
+ /**
248
+ * Parse /info/markets `data` into listed perpetual markets. A row that does not match the
249
+ * documented shape is skipped with a warning naming it (one drifted row never hides the others);
250
+ * rows of an unknown category, without a mark price, or sharing a symbol (dedupeSymbols) are
251
+ * skipped with a warning too. EXCHANGE_ERROR only for envelope drift (`data` not a list) or when
252
+ * malformed rows leave no market at all.
253
+ */
254
+ export function parseExtendedMarkets(data, warn) {
255
+ if (!Array.isArray(data))
256
+ throw extendedShapeError("/info/markets data is not a list");
257
+ const malformed = [];
258
+ const unclassified = [];
259
+ const listed = [];
260
+ for (const item of data) {
261
+ try {
262
+ const l = classifyRow(item, unclassified);
263
+ if (l !== null)
264
+ listed.push(l);
265
+ }
266
+ catch (e) {
267
+ malformed.push(describe(e));
268
+ }
269
+ }
270
+ if (unclassified.length > 0)
271
+ warn(`[extended] skipped ${unclassified.length} market(s) of an unknown category: ${unclassified.join(", ")}`);
272
+ const out = [];
273
+ const unpriced = [];
274
+ for (const l of dedupeSymbols(listed, warn)) {
275
+ try {
276
+ const row = buildRow(l);
277
+ if (row === "unpriced")
278
+ unpriced.push(l.name);
279
+ else
280
+ out.push(row);
281
+ }
282
+ catch (e) {
283
+ malformed.push(describe(e));
284
+ }
285
+ }
286
+ if (unpriced.length > 0)
287
+ warn(`[extended] dropped ${unpriced.length} listed market(s) without a mark price: ${unpriced.join(", ")}`);
288
+ if (malformed.length > 0) {
289
+ if (out.length === 0)
290
+ throw extendedShapeError(`no market parsed (${malformed.length} malformed row(s); first: ${malformed[0]})`);
291
+ warn(`[extended] skipped ${malformed.length} malformed market row(s): ${malformed.slice(0, 5).join("; ")}${malformed.length > 5 ? "; …" : ""}`);
292
+ }
293
+ return out;
294
+ }
295
+ export function extendedClient(net) {
296
+ return new ExtendedClient(networkConfig(extendedVenue, net).restUrl, extendedVenue.rateLimit, `extended:${net}`);
297
+ }
298
+ const DEFAULT_DEPS = { warn: msg => process.stderr.write(`${msg}\n`) };
299
+ export async function fetchExtendedMarketRows(client, deps = DEFAULT_DEPS) {
300
+ const body = await client.get("/info/markets");
301
+ return parseExtendedMarkets(body.data, deps.warn);
302
+ }
303
+ export async function fetchExtendedMarkets(net, deps = DEFAULT_DEPS) {
304
+ return (await fetchExtendedMarketRows(extendedClient(net), deps)).map(r => r.market);
305
+ }
306
+ /** Funding rows: the current hour's accruing rate (fraction per hour); a market without one has no row. */
307
+ export function toExtendedFundingRates(rows) {
308
+ const out = [];
309
+ for (const { market, nextFundingTime } of rows) {
310
+ if (market.fundingRate === null)
311
+ continue;
312
+ out.push({
313
+ venue: "extended",
314
+ venueSymbol: market.venueSymbol,
315
+ symbol: market.symbol,
316
+ canonical: market.canonical,
317
+ rate: market.fundingRate,
318
+ basis: EXTENDED_FUNDING_BASIS,
319
+ markPrice: market.markPrice,
320
+ nextFundingTime,
321
+ });
322
+ }
323
+ return out;
324
+ }
325
+ export async function fetchExtendedFundingRates(net, deps = DEFAULT_DEPS) {
326
+ return toExtendedFundingRates(await fetchExtendedMarketRows(extendedClient(net), deps));
327
+ }
328
+ export const extendedPublicData = {
329
+ fetchMarkets: net => fetchExtendedMarkets(net),
330
+ fetchFundingRates: net => fetchExtendedFundingRates(net),
331
+ };
332
+ /**
333
+ * Resolve a CLI symbol against the listed markets: the wire name ("BTC-USD", "TSLA_24_5-USD")
334
+ * first, then the display symbol ("tsla", "BTC-PERP"), then "<symbol>-USD" ("TSLA-USD").
335
+ * Unlisted → SYMBOL_NOT_FOUND.
336
+ */
337
+ export function resolveExtendedMarket(markets, input) {
338
+ const up = input.trim().toUpperCase().replace(/-PERP$/, "");
339
+ const matchers = [
340
+ m => m.name.toUpperCase() === up,
341
+ m => m.symbol === up,
342
+ m => `${m.symbol}-USD` === up,
343
+ ];
344
+ for (const match of matchers) {
345
+ const hit = markets.find(match);
346
+ if (hit !== undefined)
347
+ return hit;
348
+ }
349
+ throw symbolNotFound("extended", input);
350
+ }
351
+ function isMarketNotFound(e) {
352
+ return e instanceof PerpError && e.structured.details?.venueCode === EXTENDED_MARKET_NOT_FOUND;
353
+ }
354
+ /** Wire names a bare CLI symbol may be ("btc" → BTC-USD, BTC_24_5-USD): every name whose row maps to that symbol. */
355
+ export function extendedWireCandidates(symbol) {
356
+ const up = extendedSymbolOf(symbol.trim().replace(/-PERP$/i, ""));
357
+ return [`${up}-USD`, `${up}_24_5-USD`];
358
+ }
359
+ /** Rows of `GET /info/markets?market=<name>`; [] when the venue answers code 1001 (unknown name). */
360
+ async function rowsByName(client, name) {
361
+ let body;
362
+ try {
363
+ body = await client.get("/info/markets", [["market", name]]);
364
+ }
365
+ catch (e) {
366
+ if (isMarketNotFound(e))
367
+ return [];
368
+ throw e;
369
+ }
370
+ if (!Array.isArray(body.data))
371
+ throw extendedShapeError(`/info/markets?market=${name} data is not a list`);
372
+ return body.data;
373
+ }
374
+ /** The symbol a raw row maps to, or null when the row has no assetName (parseExtendedMarkets reports it). */
375
+ function rawSymbolOf(row) {
376
+ const a = row !== null && typeof row === "object" ? row.assetName : undefined;
377
+ return typeof a === "string" && a !== "" ? extendedSymbolOf(a) : null;
378
+ }
379
+ /**
380
+ * Resolve a CLI symbol for a per-market read without the ~1 MB full listing, by the SAME rules as
381
+ * the listing (parseExtendedMarkets → dedupeSymbols, with its warning):
382
+ * 1. The symbol's wire names are read with `GET /info/markets?market=<name>` (2–3 KB each;
383
+ * case-sensitive; unknown = HTTP 400 code 1001): for a bare symbol `<S>-USD` and
384
+ * `<S>_24_5-USD`; for a wire name ("NOW-USD") that name first, then the other names of the
385
+ * symbol its row maps to — so a ticker migration (NOW-USD + NOW_24_5-USD) is deduplicated here
386
+ * exactly as in `market list`.
387
+ * 2. Every returned row goes through parseExtendedMarkets: not a listed perpetual, unpriced, or
388
+ * losing the duplicate-symbol rule → not a market. resolveExtendedMarket then decides;
389
+ * nothing left → SYMBOL_NOT_FOUND.
390
+ * 3. Only when EVERY name answered 1001 (no row at all — e.g. "spx500m" for SPX500m-USD) does the
391
+ * full listing decide.
392
+ * A malformed row in a `?market=` reply is EXCHANGE_ERROR when it leaves no row to parse (the
393
+ * market asked for is unreadable — no fallback to the listing); next to a valid row it is skipped
394
+ * with a warning, as in the listing. Any error other than 1001 is thrown as is.
395
+ */
396
+ export async function resolveExtendedMarketRemote(client, input, deps = DEFAULT_DEPS) {
397
+ const raw = input.trim().replace(/-PERP$/i, "");
398
+ const up = raw.toUpperCase();
399
+ const rows = new Map();
400
+ const queried = new Set();
401
+ const read = async (name) => {
402
+ if (queried.has(name))
403
+ return [];
404
+ queried.add(name);
405
+ const got = await rowsByName(client, name);
406
+ for (const r of got) {
407
+ const n = r !== null && typeof r === "object" ? r.name : undefined;
408
+ rows.set(typeof n === "string" ? n : `#${rows.size}`, r);
409
+ }
410
+ return got;
411
+ };
412
+ let names;
413
+ if (up.endsWith("-USD")) {
414
+ let first = await read(raw);
415
+ if (first.length === 0 && up !== raw)
416
+ first = await read(up);
417
+ const symbols = [...new Set(first.map(rawSymbolOf).filter((x) => x !== null))];
418
+ names = symbols.flatMap(extendedWireCandidates);
419
+ }
420
+ else {
421
+ names = extendedWireCandidates(up);
422
+ }
423
+ for (const name of names)
424
+ await read(name);
425
+ if (rows.size === 0)
426
+ return resolveExtendedMarket((await fetchExtendedMarketRows(client, deps)).map(r => r.meta), input);
427
+ const metas = parseExtendedMarkets([...rows.values()], deps.warn).map(r => r.meta);
428
+ return resolveExtendedMarket(metas, input);
429
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ * GRVT public-only adapter — official Market Data API, read-only in this version (venues/grvt.ts).
3
+ *
4
+ * Market data (markets, orderbook, trades, funding history, klines) is implemented. Every account /
5
+ * trading method refuses with CAPABILITY_UNSUPPORTED before any request — there is no GRVT account,
6
+ * signing or order code. Unknown symbols are SYMBOL_NOT_FOUND from the instrument directory (GRVT
7
+ * answers an unknown instrument with HTTP 400 "malformed syntax", so it is never asked).
8
+ */
9
+ import type { ExchangeAdapter, ExchangeBalance, ExchangeFundingPayment, ExchangeKline, ExchangeMarketInfo, ExchangeOrder, ExchangePosition, ExchangeTrade, ExchangePublicTrade } from "../interface.js";
10
+ import { type VenueDefinition } from "../venue.js";
11
+ import type { Network } from "../venue-types.js";
12
+ import { type GrvtVenueMarket } from "./public.js";
13
+ /** perp-cli interval → GRVT CandlestickInterval (api-docs.grvt.io/schemas/candlestick_interval). */
14
+ export declare const GRVT_KLINE_INTERVALS: Readonly<Record<string, string>>;
15
+ /** Bars per kline page (the documented max) and pages read before stopping with a warning. */
16
+ export declare const GRVT_KLINE_PAGE = 1000;
17
+ export declare const GRVT_KLINE_MAX_PAGES = 10;
18
+ /** Order book depths GRVT serves (api_orderbook_levels_request). */
19
+ export declare const GRVT_BOOK_DEPTHS: readonly [10, 50, 100, 500];
20
+ /**
21
+ * Legacy market row plus GRVT's extra fields: last / best bid / best ask, minimum size / notional,
22
+ * tick, next funding time, the funding interval, and the funding labels (`fundingRateKind`
23
+ * "predicted" = the indicative rate of the active interval; fundingVerified false).
24
+ */
25
+ export type GrvtMarketInfo = ExchangeMarketInfo & {
26
+ venueSymbol: string;
27
+ lastPrice: string | null;
28
+ bestBid: string | null;
29
+ bestAsk: string | null;
30
+ tickSize: string;
31
+ /** When maxLeverage / marginTiers were read (ISO, possibly from the 6 h cache); null = not read. */
32
+ leverageAsOf: string | null;
33
+ minSize: string | null;
34
+ minNotional: string | null;
35
+ nextFundingTime: number | null;
36
+ fundingRateKind: "predicted";
37
+ fundingVerified: false;
38
+ };
39
+ /** A funding-history row: the SETTLED rate (fraction per `intervalHours`) at `time`. */
40
+ export type GrvtFundingHistoryRow = {
41
+ time: number;
42
+ rate: string;
43
+ price: string | null;
44
+ intervalHours: number;
45
+ rateKind: "lastSettled";
46
+ };
47
+ export declare function toGrvtMarketInfo(m: GrvtVenueMarket): GrvtMarketInfo;
48
+ export declare class GrvtPublicAdapter implements ExchangeAdapter {
49
+ readonly venue: VenueDefinition;
50
+ readonly network: Network;
51
+ readonly name: "grvt";
52
+ readonly aliases: readonly ["grv"];
53
+ private readonly client;
54
+ constructor(venue: VenueDefinition, network: Network);
55
+ private market;
56
+ /** Every market with leverage (`market list`): margin_rules come from the 6 h file cache. */
57
+ getVenueMarkets(): Promise<GrvtVenueMarket[]>;
58
+ getMarkets(): Promise<GrvtMarketInfo[]>;
59
+ /** One market (`market info`): the directory, its ticker and its margin rules — no fan-out. */
60
+ getMarketInfo(symbol: string): Promise<GrvtMarketInfo>;
61
+ getOrderbook(symbol: string, depth?: number): Promise<{
62
+ bids: [string, string][];
63
+ asks: [string, string][];
64
+ }>;
65
+ getRecentTrades(symbol: string, limit?: number): Promise<ExchangePublicTrade[]>;
66
+ /**
67
+ * Settled funding (/full/v1/funding, one record per funding interval, newest first). `rate` is a
68
+ * fraction per the record's `intervalHours` (published in percentage points, converted exactly).
69
+ */
70
+ getFundingHistory(symbol: string, limit?: number): Promise<GrvtFundingHistoryRow[]>;
71
+ getKlines(symbol: string, interval: string, startTime: number, endTime: number): Promise<ExchangeKline[]>;
72
+ private refuse;
73
+ getBalance(): Promise<ExchangeBalance>;
74
+ getPositions(): Promise<ExchangePosition[]>;
75
+ getOpenOrders(): Promise<ExchangeOrder[]>;
76
+ getOrderHistory(): Promise<ExchangeOrder[]>;
77
+ getTradeHistory(): Promise<ExchangeTrade[]>;
78
+ getFundingPayments(): Promise<ExchangeFundingPayment[]>;
79
+ marketOrder(): Promise<unknown>;
80
+ limitOrder(): Promise<unknown>;
81
+ editOrder(): Promise<unknown>;
82
+ cancelOrder(): Promise<unknown>;
83
+ cancelAllOrders(): Promise<unknown>;
84
+ setLeverage(): Promise<unknown>;
85
+ stopOrder(): Promise<unknown>;
86
+ }