perp-cli 0.14.3 → 0.16.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 (363) hide show
  1. package/README.ja.md +243 -0
  2. package/README.ko.md +243 -0
  3. package/README.md +138 -405
  4. package/README.zh.md +243 -0
  5. package/dist/agent-wallet/store.d.ts +3 -2
  6. package/dist/agent-wallet/store.js +2 -2
  7. package/dist/api/public/hyperliquid.js +4 -0
  8. package/dist/api/public/lighter.d.ts +5 -0
  9. package/dist/api/public/lighter.js +5 -0
  10. package/dist/api/public/pacifica.js +85 -15
  11. package/dist/api/public/urls.d.ts +2 -0
  12. package/dist/api/public/urls.js +3 -0
  13. package/dist/arb/sizing.js +4 -2
  14. package/dist/arb/state.d.ts +6 -0
  15. package/dist/arb/utils.d.ts +1 -2
  16. package/dist/arb/utils.js +1 -2
  17. package/dist/balance-by-address.d.ts +39 -0
  18. package/dist/balance-by-address.js +44 -0
  19. package/dist/bot/apex/pulse.js +3 -0
  20. package/dist/bot/apex/radar.js +2 -1
  21. package/dist/bot/engine.d.ts +10 -1
  22. package/dist/bot/engine.js +14 -6
  23. package/dist/bot/indicators.d.ts +7 -0
  24. package/dist/bot/indicators.js +16 -0
  25. package/dist/bot/perp-order.d.ts +4 -4
  26. package/dist/bot/perp-order.js +5 -5
  27. package/dist/bot/quarantine.d.ts +1 -1
  28. package/dist/bot/quarantine.js +1 -1
  29. package/dist/bot/quote-rules.js +1 -1
  30. package/dist/bot/strategies/apex-strategy.js +3 -2
  31. package/dist/bot/strategies/engine-mm.js +6 -5
  32. package/dist/bot/strategies/funding-arb-strategy.js +12 -5
  33. package/dist/bot/strategies/funding-arb-utils.d.ts +15 -3
  34. package/dist/bot/strategies/funding-arb-utils.js +53 -20
  35. package/dist/bot/strategies/funding-auto.js +2 -2
  36. package/dist/bot/strategies/liquidation-mm.d.ts +1 -0
  37. package/dist/bot/strategies/liquidation-mm.js +8 -2
  38. package/dist/bot/strategies/momentum-breakout.d.ts +1 -0
  39. package/dist/bot/strategies/momentum-breakout.js +11 -3
  40. package/dist/bot/strategies/spot-perp-arb-strategy.d.ts +1 -1
  41. package/dist/bot/strategies/spot-perp-arb-strategy.js +6 -4
  42. package/dist/bot/strategies/spot-perp-executor.d.ts +1 -1
  43. package/dist/bot/strategies/spot-perp-executor.js +3 -3
  44. package/dist/bot/strategy-types.d.ts +2 -1
  45. package/dist/bot/tui/BotDashboard.d.ts +1 -1
  46. package/dist/bot/tui/BotDashboard.js +1 -1
  47. package/dist/cache.js +12 -6
  48. package/dist/cli-program.d.ts +15 -0
  49. package/dist/cli-program.js +126 -6
  50. package/dist/commands/account.js +168 -24
  51. package/dist/commands/agent-import.d.ts +7 -0
  52. package/dist/commands/agent-import.js +30 -1
  53. package/dist/commands/agent.d.ts +6 -3
  54. package/dist/commands/agent.js +160 -12
  55. package/dist/commands/arb/index.js +23 -81
  56. package/dist/commands/arb-auto.d.ts +24 -0
  57. package/dist/commands/arb-auto.js +175 -97
  58. package/dist/commands/arb.d.ts +20 -0
  59. package/dist/commands/arb.js +107 -163
  60. package/dist/commands/backtest.js +23 -21
  61. package/dist/commands/bot.js +1 -1
  62. package/dist/commands/builder.js +1 -1
  63. package/dist/commands/funds.js +113 -3
  64. package/dist/commands/init.d.ts +1 -1
  65. package/dist/commands/init.js +27 -7
  66. package/dist/commands/manage.js +23 -21
  67. package/dist/commands/market.d.ts +48 -0
  68. package/dist/commands/market.js +395 -100
  69. package/dist/commands/options.d.ts +14 -0
  70. package/dist/commands/options.js +151 -0
  71. package/dist/commands/pacifica-earn.d.ts +5 -0
  72. package/dist/commands/pacifica-earn.js +455 -0
  73. package/dist/commands/pacifica-orders.d.ts +14 -0
  74. package/dist/commands/pacifica-orders.js +142 -0
  75. package/dist/commands/portfolio.d.ts +16 -0
  76. package/dist/commands/portfolio.js +83 -55
  77. package/dist/commands/rebalance.d.ts +1 -0
  78. package/dist/commands/rebalance.js +15 -0
  79. package/dist/commands/risk.d.ts +11 -2
  80. package/dist/commands/risk.js +39 -44
  81. package/dist/commands/trade.d.ts +1 -0
  82. package/dist/commands/trade.js +67 -62
  83. package/dist/commands/wallet.js +1 -1
  84. package/dist/config.d.ts +2 -2
  85. package/dist/config.js +15 -4
  86. package/dist/constants.js +6 -0
  87. package/dist/cross-chain-margin.d.ts +3 -1
  88. package/dist/cross-chain-margin.js +4 -2
  89. package/dist/dashboard/server.js +3 -3
  90. package/dist/dashboard/ui.js +9 -6
  91. package/dist/errors.d.ts +29 -1
  92. package/dist/errors.js +35 -3
  93. package/dist/exchanges/address.d.ts +8 -0
  94. package/dist/exchanges/address.js +47 -0
  95. package/dist/exchanges/arcus/adapter.d.ts +16 -12
  96. package/dist/exchanges/arcus/adapter.js +45 -18
  97. package/dist/exchanges/arcus/agent.d.ts +1 -1
  98. package/dist/exchanges/arcus/agent.js +1 -1
  99. package/dist/exchanges/arcus/client.js +1 -1
  100. package/dist/exchanges/arcus/public.js +3 -2
  101. package/dist/exchanges/arcus/signing.d.ts +2 -3
  102. package/dist/exchanges/arcus/signing.js +1 -1
  103. package/dist/exchanges/arcus/spot-chain.d.ts +1 -1
  104. package/dist/exchanges/arcus/spot-chain.js +1 -1
  105. package/dist/exchanges/arcus/spot-router.d.ts +1 -1
  106. package/dist/exchanges/arcus/spot-router.js +2 -2
  107. package/dist/exchanges/arcus/spot.d.ts +2 -3
  108. package/dist/exchanges/arcus/spot.js +2 -3
  109. package/dist/exchanges/aster-spot.d.ts +3 -3
  110. package/dist/exchanges/aster-spot.js +6 -9
  111. package/dist/exchanges/aster-typed-data.d.ts +1 -1
  112. package/dist/exchanges/aster-typed-data.js +1 -1
  113. package/dist/exchanges/aster.d.ts +30 -10
  114. package/dist/exchanges/aster.js +153 -53
  115. package/dist/exchanges/builder-fee.d.ts +1 -1
  116. package/dist/exchanges/builder-fee.js +13 -2
  117. package/dist/exchanges/canonical-symbols.d.ts +8 -2
  118. package/dist/exchanges/canonical-symbols.js +46 -2
  119. package/dist/exchanges/capabilities.d.ts +2 -0
  120. package/dist/exchanges/capabilities.js +2 -1
  121. package/dist/exchanges/derive/client.d.ts +37 -0
  122. package/dist/exchanges/derive/client.js +135 -0
  123. package/dist/exchanges/derive/options.d.ts +73 -0
  124. package/dist/exchanges/derive/options.js +379 -0
  125. package/dist/exchanges/extended/adapter.d.ts +96 -0
  126. package/dist/exchanges/extended/adapter.js +241 -0
  127. package/dist/exchanges/extended/client.d.ts +38 -0
  128. package/dist/exchanges/extended/client.js +88 -0
  129. package/dist/exchanges/extended/public.d.ts +133 -0
  130. package/dist/exchanges/extended/public.js +436 -0
  131. package/dist/exchanges/grvt/adapter.d.ts +100 -0
  132. package/dist/exchanges/grvt/adapter.js +283 -0
  133. package/dist/exchanges/grvt/client.d.ts +25 -0
  134. package/dist/exchanges/grvt/client.js +86 -0
  135. package/dist/exchanges/grvt/public.d.ts +151 -0
  136. package/dist/exchanges/grvt/public.js +438 -0
  137. package/dist/exchanges/hyperliquid-outcome.d.ts +2 -0
  138. package/dist/exchanges/hyperliquid-outcome.js +29 -1
  139. package/dist/exchanges/hyperliquid-spot.d.ts +9 -1
  140. package/dist/exchanges/hyperliquid-spot.js +24 -16
  141. package/dist/exchanges/hyperliquid.d.ts +199 -22
  142. package/dist/exchanges/hyperliquid.js +550 -202
  143. package/dist/exchanges/index.d.ts +1 -1
  144. package/dist/exchanges/index.js +1 -1
  145. package/dist/exchanges/interface.d.ts +157 -13
  146. package/dist/exchanges/interface.js +47 -0
  147. package/dist/exchanges/ioc-outcome.d.ts +1 -1
  148. package/dist/exchanges/ioc-outcome.js +1 -1
  149. package/dist/exchanges/legacy-trading-v2.d.ts +2 -2
  150. package/dist/exchanges/legacy-trading-v2.js +7 -2
  151. package/dist/exchanges/lighter-public.d.ts +67 -12
  152. package/dist/exchanges/lighter-public.js +250 -82
  153. package/dist/exchanges/lighter-signer.d.ts +1 -1
  154. package/dist/exchanges/lighter-signer.js +1 -1
  155. package/dist/exchanges/lighter-spot.d.ts +10 -5
  156. package/dist/exchanges/lighter-spot.js +105 -97
  157. package/dist/exchanges/lighter.d.ts +80 -21
  158. package/dist/exchanges/lighter.js +312 -105
  159. package/dist/exchanges/ondo/adapter.d.ts +38 -13
  160. package/dist/exchanges/ondo/adapter.js +86 -27
  161. package/dist/exchanges/ondo/agent.d.ts +1 -1
  162. package/dist/exchanges/ondo/agent.js +1 -1
  163. package/dist/exchanges/ondo/client.d.ts +1 -1
  164. package/dist/exchanges/ondo/client.js +2 -2
  165. package/dist/exchanges/ondo/public.d.ts +35 -3
  166. package/dist/exchanges/ondo/public.js +75 -32
  167. package/dist/exchanges/ondo/spot.d.ts +2 -2
  168. package/dist/exchanges/ondo/spot.js +3 -3
  169. package/dist/exchanges/options-interface.d.ts +158 -0
  170. package/dist/exchanges/options-interface.js +17 -0
  171. package/dist/exchanges/options-venues.d.ts +12 -0
  172. package/dist/exchanges/options-venues.js +35 -0
  173. package/dist/exchanges/outcome-interface.d.ts +4 -0
  174. package/dist/exchanges/pacifica-atomic.d.ts +211 -0
  175. package/dist/exchanges/pacifica-atomic.js +440 -0
  176. package/dist/exchanges/pacifica-decimal.d.ts +10 -0
  177. package/dist/exchanges/pacifica-decimal.js +51 -0
  178. package/dist/exchanges/pacifica-presigned.d.ts +53 -0
  179. package/dist/exchanges/pacifica-presigned.js +141 -0
  180. package/dist/exchanges/pacifica-print.d.ts +200 -0
  181. package/dist/exchanges/pacifica-print.js +417 -0
  182. package/dist/exchanges/pacifica-spot.d.ts +8 -2
  183. package/dist/exchanges/pacifica-spot.js +26 -18
  184. package/dist/exchanges/pacifica-typed-data.d.ts +1 -1
  185. package/dist/exchanges/pacifica-typed-data.js +1 -1
  186. package/dist/exchanges/pacifica-vaults.d.ts +130 -0
  187. package/dist/exchanges/pacifica-vaults.js +277 -0
  188. package/dist/exchanges/pacifica.d.ts +108 -10
  189. package/dist/exchanges/pacifica.js +428 -171
  190. package/dist/exchanges/precision.d.ts +3 -1
  191. package/dist/exchanges/precision.js +9 -2
  192. package/dist/exchanges/public-balances.d.ts +25 -0
  193. package/dist/exchanges/public-balances.js +158 -0
  194. package/dist/exchanges/public-positions.d.ts +43 -0
  195. package/dist/exchanges/public-positions.js +154 -0
  196. package/dist/exchanges/qfex/adapter.d.ts +69 -13
  197. package/dist/exchanges/qfex/adapter.js +102 -17
  198. package/dist/exchanges/qfex/agent.d.ts +1 -1
  199. package/dist/exchanges/qfex/agent.js +1 -1
  200. package/dist/exchanges/qfex/client.d.ts +1 -1
  201. package/dist/exchanges/qfex/client.js +1 -1
  202. package/dist/exchanges/qfex/errors.d.ts +1 -1
  203. package/dist/exchanges/qfex/errors.js +2 -2
  204. package/dist/exchanges/qfex/public.d.ts +65 -12
  205. package/dist/exchanges/qfex/public.js +131 -25
  206. package/dist/exchanges/qfex/signing.d.ts +2 -2
  207. package/dist/exchanges/qfex/signing.js +4 -5
  208. package/dist/exchanges/qfex/ws-transport.d.ts +3 -3
  209. package/dist/exchanges/qfex/ws-transport.js +3 -3
  210. package/dist/exchanges/rate-limiter.d.ts +1 -1
  211. package/dist/exchanges/rate-limiter.js +5 -2
  212. package/dist/exchanges/registry.d.ts +1 -1
  213. package/dist/exchanges/registry.js +1 -1
  214. package/dist/exchanges/risex/adapter.d.ts +160 -0
  215. package/dist/exchanges/risex/adapter.js +842 -0
  216. package/dist/exchanges/risex/agent.d.ts +154 -0
  217. package/dist/exchanges/risex/agent.js +384 -0
  218. package/dist/exchanges/risex/client.d.ts +47 -0
  219. package/dist/exchanges/risex/client.js +174 -0
  220. package/dist/exchanges/risex/nonce.d.ts +43 -0
  221. package/dist/exchanges/risex/nonce.js +212 -0
  222. package/dist/exchanges/risex/public.d.ts +64 -0
  223. package/dist/exchanges/risex/public.js +150 -0
  224. package/dist/exchanges/risex/session.d.ts +71 -0
  225. package/dist/exchanges/risex/session.js +171 -0
  226. package/dist/exchanges/risex/typed-data.d.ts +173 -0
  227. package/dist/exchanges/risex/typed-data.js +240 -0
  228. package/dist/exchanges/risex/units.d.ts +29 -0
  229. package/dist/exchanges/risex/units.js +104 -0
  230. package/dist/exchanges/slippage.d.ts +1 -1
  231. package/dist/exchanges/slippage.js +1 -1
  232. package/dist/exchanges/spot-factory.d.ts +3 -3
  233. package/dist/exchanges/spot-factory.js +8 -8
  234. package/dist/exchanges/spot-interface.d.ts +5 -5
  235. package/dist/exchanges/spot-interface.js +2 -2
  236. package/dist/exchanges/spot-result.d.ts +3 -3
  237. package/dist/exchanges/spot-result.js +3 -3
  238. package/dist/exchanges/trading-v2.d.ts +3 -3
  239. package/dist/exchanges/trading-v2.js +9 -6
  240. package/dist/exchanges/txflow/adapter.d.ts +61 -0
  241. package/dist/exchanges/txflow/adapter.js +150 -0
  242. package/dist/exchanges/txflow/client.d.ts +47 -0
  243. package/dist/exchanges/txflow/client.js +155 -0
  244. package/dist/exchanges/txflow/public.d.ts +87 -0
  245. package/dist/exchanges/txflow/public.js +355 -0
  246. package/dist/exchanges/unknown-symbol.d.ts +34 -0
  247. package/dist/exchanges/unknown-symbol.js +56 -0
  248. package/dist/exchanges/variational/adapter.d.ts +67 -0
  249. package/dist/exchanges/variational/adapter.js +137 -0
  250. package/dist/exchanges/variational/client.d.ts +21 -0
  251. package/dist/exchanges/variational/client.js +66 -0
  252. package/dist/exchanges/variational/public.d.ts +126 -0
  253. package/dist/exchanges/variational/public.js +430 -0
  254. package/dist/exchanges/venue-types.d.ts +52 -10
  255. package/dist/exchanges/venue-types.js +82 -11
  256. package/dist/exchanges/venue.d.ts +150 -11
  257. package/dist/exchanges/venue.js +126 -4
  258. package/dist/exchanges/venues/arcus.d.ts +1 -2
  259. package/dist/exchanges/venues/arcus.js +5 -4
  260. package/dist/exchanges/venues/aster.d.ts +2 -2
  261. package/dist/exchanges/venues/aster.js +6 -4
  262. package/dist/exchanges/venues/create-helpers.d.ts +1 -1
  263. package/dist/exchanges/venues/create-helpers.js +3 -3
  264. package/dist/exchanges/venues/extended.d.ts +21 -0
  265. package/dist/exchanges/venues/extended.js +96 -0
  266. package/dist/exchanges/venues/grvt.d.ts +30 -0
  267. package/dist/exchanges/venues/grvt.js +98 -0
  268. package/dist/exchanges/venues/hyperliquid.d.ts +2 -2
  269. package/dist/exchanges/venues/hyperliquid.js +19 -8
  270. package/dist/exchanges/venues/index.d.ts +7 -2
  271. package/dist/exchanges/venues/index.js +8 -2
  272. package/dist/exchanges/venues/lighter-family.d.ts +7 -9
  273. package/dist/exchanges/venues/lighter-family.js +9 -11
  274. package/dist/exchanges/venues/lighter-rh.d.ts +2 -2
  275. package/dist/exchanges/venues/lighter-rh.js +20 -8
  276. package/dist/exchanges/venues/lighter.d.ts +1 -1
  277. package/dist/exchanges/venues/lighter.js +18 -6
  278. package/dist/exchanges/venues/ondo.d.ts +1 -1
  279. package/dist/exchanges/venues/ondo.js +5 -3
  280. package/dist/exchanges/venues/pacifica.d.ts +2 -2
  281. package/dist/exchanges/venues/pacifica.js +15 -4
  282. package/dist/exchanges/venues/qfex.d.ts +1 -1
  283. package/dist/exchanges/venues/qfex.js +4 -2
  284. package/dist/exchanges/venues/risex-release.d.ts +14 -0
  285. package/dist/exchanges/venues/risex-release.js +14 -0
  286. package/dist/exchanges/venues/risex.d.ts +31 -0
  287. package/dist/exchanges/venues/risex.js +131 -0
  288. package/dist/exchanges/venues/txflow.d.ts +18 -0
  289. package/dist/exchanges/venues/txflow.js +77 -0
  290. package/dist/exchanges/venues/variational.d.ts +21 -0
  291. package/dist/exchanges/venues/variational.js +85 -0
  292. package/dist/execution-log.d.ts +1 -1
  293. package/dist/funding/legacy-public.d.ts +6 -4
  294. package/dist/funding/legacy-public.js +42 -41
  295. package/dist/funding/normalize.d.ts +1 -1
  296. package/dist/funding/normalize.js +1 -1
  297. package/dist/funding/rates.d.ts +95 -6
  298. package/dist/funding/rates.js +99 -19
  299. package/dist/index.js +7 -6
  300. package/dist/jobs.d.ts +1 -0
  301. package/dist/jobs.js +25 -1
  302. package/dist/landing.d.ts +2 -0
  303. package/dist/landing.js +1 -1
  304. package/dist/liquidity.d.ts +3 -1
  305. package/dist/liquidity.js +8 -4
  306. package/dist/mcp-pacifica-earn.d.ts +9 -0
  307. package/dist/mcp-pacifica-earn.js +64 -0
  308. package/dist/mcp-server.js +211 -68
  309. package/dist/pacifica/client.d.ts +69 -5
  310. package/dist/pacifica/client.js +181 -8
  311. package/dist/pacifica/rate-limit.d.ts +144 -0
  312. package/dist/pacifica/rate-limit.js +267 -0
  313. package/dist/pacifica/types/order.d.ts +2 -1
  314. package/dist/plan-executor.js +7 -2
  315. package/dist/positions-by-address.d.ts +34 -0
  316. package/dist/positions-by-address.js +46 -0
  317. package/dist/rebalance.js +1 -1
  318. package/dist/risk.d.ts +2 -1
  319. package/dist/risk.js +2 -4
  320. package/dist/settings.d.ts +32 -3
  321. package/dist/signer/ows-evm.d.ts +1 -1
  322. package/dist/signer/ows-evm.js +1 -1
  323. package/dist/smart-order.d.ts +1 -1
  324. package/dist/smart-order.js +1 -1
  325. package/dist/strategies/funding-arb.d.ts +1 -1
  326. package/dist/strategies/funding-arb.js +36 -63
  327. package/dist/trade-validator.js +2 -2
  328. package/dist/utils.d.ts +22 -3
  329. package/dist/utils.js +11 -3
  330. package/dist/venue-health.d.ts +40 -0
  331. package/dist/venue-health.js +75 -0
  332. package/dist/withdraw-gate.d.ts +1 -1
  333. package/dist/withdraw-gate.js +1 -1
  334. package/dist/ws/arcus-market.d.ts +9 -0
  335. package/dist/ws/arcus-market.js +9 -0
  336. package/dist/ws/aster-market.d.ts +33 -0
  337. package/dist/ws/aster-market.js +30 -0
  338. package/dist/ws/index.d.ts +980 -0
  339. package/dist/ws/index.js +4460 -0
  340. package/dist/ws/lighter-market.d.ts +14 -0
  341. package/dist/ws/lighter-market.js +13 -0
  342. package/dist/ws/node.d.ts +996 -0
  343. package/dist/ws/node.js +4554 -0
  344. package/dist/ws/pacifica-instrument.d.ts +8 -0
  345. package/dist/ws/pacifica-instrument.js +8 -0
  346. package/dist/ws/unclassified.d.ts +16 -0
  347. package/dist/ws/unclassified.js +43 -0
  348. package/dist/ws-cli/credentials.d.ts +62 -0
  349. package/dist/ws-cli/credentials.js +126 -0
  350. package/package.json +71 -10
  351. package/skills/perp-cli/SKILL.md +153 -36
  352. package/skills/perp-cli/package.json +15 -2
  353. package/skills/perp-cli/references/agent-operations.md +22 -12
  354. package/skills/perp-cli/references/commands.md +143 -17
  355. package/skills/perp-cli/references/strategies.md +38 -3
  356. package/skills/perp-cli/references/ws-library.md +523 -0
  357. package/skills/perp-cli/scripts/arb-monitor.sh +13 -10
  358. package/skills/perp-cli/scripts/funding-analysis.sh +57 -29
  359. package/skills/perp-cli/scripts/preflight.sh +27 -19
  360. package/skills/perp-cli/scripts/spot-perp-scan.sh +58 -38
  361. package/skills/perp-cli/scripts/validate-arb.sh +56 -39
  362. package/dist/cli-spec.d.ts +0 -46
  363. package/dist/cli-spec.js +0 -81
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Lighter (main) venue definition (design §10.1, §10.8, §10.13 #4).
2
+ * Lighter (main) venue definition.
3
3
  * Shares LighterAdapter and constants with lighter-rh (./lighter-family.ts).
4
4
  */
5
5
  import { LIGHTER_CAPABILITIES, LIGHTER_NETWORKS, LIGHTER_RATE_LIMIT } from "./lighter-family.js";
@@ -8,8 +8,17 @@ const publicData = {
8
8
  async fetchFundingRates(net) {
9
9
  return (await import("../lighter-public.js")).lighterPublicData("lighter").fetchFundingRates(net);
10
10
  },
11
- async fetchMarkets(net) {
12
- return (await import("../lighter-public.js")).lighterPublicData("lighter").fetchMarkets(net);
11
+ async fetchMarkets(net, opts) {
12
+ return (await import("../lighter-public.js")).lighterPublicData("lighter").fetchMarkets(net, opts);
13
+ },
14
+ // Keyless positions of any account by public address (account positions --address).
15
+ addressKind: "evm",
16
+ async fetchPositionsByAddress(net, address, opts) {
17
+ return (await import("../public-positions.js")).lighterPositionsByAddress("lighter", net, address, opts);
18
+ },
19
+ // Keyless balances of any account by public address (account balance --address).
20
+ async fetchBalanceByAddress(net, address, opts) {
21
+ return (await import("../public-balances.js")).lighterBalanceByAddress("lighter", net, address, opts);
13
22
  },
14
23
  };
15
24
  export const lighterVenue = {
@@ -21,17 +30,19 @@ export const lighterVenue = {
21
30
  agentKeyKind: "lighter-l2",
22
31
  secretStorage: { kind: "perp-keystore", dir: "lighter-agents" },
23
32
  networks: LIGHTER_NETWORKS,
24
- fundingRateBasis: { kind: "perHours", hours: 8 },
33
+ // The market rows' fundingRate is the settled hourly rate (WS market_stats, lighter-public.ts).
34
+ fundingRateBasis: { kind: "perHours", hours: 1 },
25
35
  settlementIntervalHours: 1,
26
36
  fundingVerified: true,
27
37
  roles: ["marketData", "account", "trading"],
38
+ gatedRoles: null,
28
39
  capabilities: LIGHTER_CAPABILITIES,
29
- // Declared only — per §10.9 the limiter is applied to new venues + lighter-rh, not lighter.
40
+ // Declared only — per the limiter is applied to new venues + lighter-rh, not lighter.
30
41
  rateLimit: LIGHTER_RATE_LIMIT,
31
42
  restrictedRegions: [],
32
43
  symbolIdentity: "baseTicker",
33
44
  publicData,
34
- // §12: per account (account_trading_mode, read by LighterSpotAdapter.init): Unified (1) shares
45
+ // per account (account_trading_mode, read by LighterSpotAdapter.init): Unified (1) shares
35
46
  // the collateral between spot and perp (no transfer); Classic (0) = separate spot balance +
36
47
  // self-transfer of the venue collateral.
37
48
  spot: {
@@ -51,5 +62,6 @@ export const lighterVenue = {
51
62
  },
52
63
  maxSlippageBps: 5000,
53
64
  builderFee: BUILDER_FEE_CAPABILITIES["lighter"],
65
+ apiStatus: { kind: "official" },
54
66
  create: async (ctx) => (await import("./create-helpers.js")).createLighterFamily("lighter", ctx),
55
67
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Ondo Perps venue definition (design §4, §10).
2
+ * Ondo Perps venue definition.
3
3
  *
4
4
  * Off-chain matching engine; collateral is USDC plus eligible Ondo Global
5
5
  * Markets tokenized stocks (docs collateral-assets). Hot-path key = HMAC API
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Ondo Perps venue definition (design §4, §10).
2
+ * Ondo Perps venue definition.
3
3
  *
4
4
  * Off-chain matching engine; collateral is USDC plus eligible Ondo Global
5
5
  * Markets tokenized stocks (docs collateral-assets). Hot-path key = HMAC API
@@ -81,10 +81,11 @@ export const ondoVenue = {
81
81
  settlementIntervalHours: 1,
82
82
  fundingVerified: true,
83
83
  roles: ["marketData", "account", "trading"],
84
+ gatedRoles: null,
84
85
  capabilities: {
85
86
  // The venue offers native market orders; the adapter sends every market order
86
87
  // as an IOC LIMIT at the tick-aligned protection price (mark ± resolved
87
- // slippage, design §13.2).
88
+ // slippage).
88
89
  marketOrder: "native",
89
90
  timeInForce: ["GTC", "IOC", "ALO"],
90
91
  // A reduce-only limit order must be IOC: the venue refuses a resting one with HTTP 400
@@ -107,7 +108,7 @@ export const ondoVenue = {
107
108
  restrictedRegions: ["US", "PA"],
108
109
  symbolIdentity: "baseTicker",
109
110
  publicData,
110
- // §12: separate spot wallet + POST /v1/spot/transfers (spot ↔ margin).
111
+ // separate spot wallet + POST /v1/spot/transfers (spot ↔ margin).
111
112
  spot: {
112
113
  accountModel: "separate",
113
114
  quoteAssets: { mainnet: ["USDC"], testnet: ["USDC"] },
@@ -125,6 +126,7 @@ export const ondoVenue = {
125
126
  },
126
127
  maxSlippageBps: 5000,
127
128
  builderFee: BUILDER_FEE_CAPABILITIES["ondo"],
129
+ apiStatus: { kind: "official" },
128
130
  create: async (ctx) => {
129
131
  const adapter = new (await import("../ondo/adapter.js")).OndoAdapter(ondoVenue, ctx);
130
132
  // Builder code: only settings builder.ondo (off by default). Ondo has no approval step.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Pacifica venue definition (design §10.1, §10.8, §10.13 #4).
3
- * Adapter + public-data code are loaded lazily (§10.10).
2
+ * Pacifica venue definition.
3
+ * Adapter + public-data code are loaded lazily.
4
4
  */
5
5
  import type { VenueDefinition } from "../venue.js";
6
6
  /** Pacifica `client_order_id` format: "Full UUID string" (docs.pacifica.fi rest-api orders/create-limit-order). */
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Pacifica venue definition (design §10.1, §10.8, §10.13 #4).
3
- * Adapter + public-data code are loaded lazily (§10.10).
2
+ * Pacifica venue definition.
3
+ * Adapter + public-data code are loaded lazily.
4
4
  */
5
5
  import { BUILDER_FEE_CAPABILITIES } from "../builder-fee.js";
6
6
  const publicData = {
@@ -10,6 +10,15 @@ const publicData = {
10
10
  async fetchMarkets(net) {
11
11
  return (await import("../../funding/legacy-public.js")).legacyPublicData("pacifica").fetchMarkets(net);
12
12
  },
13
+ // Keyless positions of any account by public address (account positions --address).
14
+ addressKind: "solana",
15
+ async fetchPositionsByAddress(net, address) {
16
+ return (await import("../public-positions.js")).pacificaPositionsByAddress(net, address);
17
+ },
18
+ // Keyless balances of any account by public address (account balance --address).
19
+ async fetchBalanceByAddress(net, address) {
20
+ return (await import("../public-balances.js")).pacificaBalanceByAddress(net, address);
21
+ },
13
22
  };
14
23
  /** Pacifica `client_order_id` format: "Full UUID string" (docs.pacifica.fi rest-api orders/create-limit-order). */
15
24
  export const PACIFICA_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -50,6 +59,7 @@ export const pacificaVenue = {
50
59
  settlementIntervalHours: 1,
51
60
  fundingVerified: true,
52
61
  roles: ["marketData", "account", "trading"],
62
+ gatedRoles: null,
53
63
  capabilities: {
54
64
  marketOrder: "slippageBounded",
55
65
  timeInForce: ["GTC", "IOC", "ALO", "TOB"],
@@ -68,12 +78,12 @@ export const pacificaVenue = {
68
78
  // docs.pacifica.fi "Rate limits": "Pacifica uses a credit-based rate limiting system with a
69
79
  // 60-second rolling window." Tier "Unidentified IP | 125" base credits/60s (valid API Config
70
80
  // Key: 300); "Standard request/action | 1" credit.
71
- // Declared only — per §10.9 the limiter is applied to new venues + lighter-rh.
81
+ // Declared only — per the limiter is applied to new venues + lighter-rh.
72
82
  rateLimit: { capacity: 125, refillPerSec: 125 / 60, weights: null },
73
83
  restrictedRegions: [],
74
84
  symbolIdentity: "baseTicker",
75
85
  publicData,
76
- // §12: spot (SOL-USDC) shares the perp account — USDC is perp margin, no transfer.
86
+ // spot (SOL-USDC) shares the perp account — USDC is perp margin, no transfer.
77
87
  spot: {
78
88
  accountModel: "unified",
79
89
  quoteAssets: { mainnet: ["USDC"], testnet: ["USDC"] },
@@ -91,5 +101,6 @@ export const pacificaVenue = {
91
101
  },
92
102
  maxSlippageBps: 5000,
93
103
  builderFee: BUILDER_FEE_CAPABILITIES["pacifica"],
104
+ apiStatus: { kind: "official" },
94
105
  create: async (ctx) => (await import("./create-helpers.js")).createPacifica(ctx),
95
106
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QFEX venue definition (design §14.1 as amended by §14.12).
2
+ * QFEX venue definition.
3
3
  *
4
4
  * TradFi perpetuals (equities, indices, commodities; no spot) on a custodial, off-chain
5
5
  * matching engine. All markets are cross-margin, margin asset USDC. Orders go over the Trade
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QFEX venue definition (design §14.1 as amended by §14.12).
2
+ * QFEX venue definition.
3
3
  *
4
4
  * TradFi perpetuals (equities, indices, commodities; no spot) on a custodial, off-chain
5
5
  * matching engine. All markets are cross-margin, margin asset USDC. Orders go over the Trade
@@ -71,12 +71,13 @@ export const qfexVenue = {
71
71
  // hourly × 8760 overstates it. Until both are settled QFEX is not a funding-arb venue.
72
72
  fundingVerified: false,
73
73
  roles: ["marketData", "account", "trading"],
74
+ gatedRoles: null,
74
75
  capabilities: {
75
76
  // The venue offers a native MARKET order (bounded only by the price band — docs /qfex/risk-limits
76
77
  // "Dynamic price bands": 1.65%–10% by product preset and session; "integrations should use
77
78
  // that live value rather than hardcoding a percentage"); the
78
79
  // adapter sends every market order as an IOC LIMIT at the tick-aligned protection price
79
- // (mark ± resolved slippage, design §13.2) — the same declaration as Ondo.
80
+ // (mark ± resolved slippage) — the same declaration as Ondo.
80
81
  marketOrder: "native",
81
82
  // ALO = order_type "ALO" + GTC.
82
83
  timeInForce: ["GTC", "IOC", "FOK", "ALO"],
@@ -123,6 +124,7 @@ export const qfexVenue = {
123
124
  // Widest documented price band (equities at the open: 10%). The order's own band is checked before sending.
124
125
  maxSlippageBps: 1000,
125
126
  builderFee: BUILDER_FEE_CAPABILITIES["qfex"],
127
+ apiStatus: { kind: "official" },
126
128
  create: async (ctx) => {
127
129
  const { QfexAdapter } = await import("../qfex/adapter.js");
128
130
  const adapter = new QfexAdapter(qfexVenue, ctx);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * RISEx release switch (owner decision 2026-10-19: new venues ship in phases).
3
+ *
4
+ * Phase 1 (0.15.0): RISEx is read-only — market data and public-by-address account reads.
5
+ * Phase 2 (a later release): trading. Flip this to `true`; nothing else needs to change.
6
+ *
7
+ * false removes the "trading" role from the RISEx venue definition (risex.ts), so every trading /
8
+ * signer / agent / bot / MCP-write path refuses with CAPABILITY_UNSUPPORTED through the role
9
+ * mechanism (venue.ts roleUnsupported()), and the adapter refuses writes itself as well.
10
+ * The trading code and its tests stay; those tests enable the switch with
11
+ * `vi.mock(".../venues/risex-release.js", () => ({ RISEX_TRADING_ENABLED: true }))`.
12
+ * Kept in its own module so tests can mock it without replacing the venue definition.
13
+ */
14
+ export declare const RISEX_TRADING_ENABLED: boolean;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * RISEx release switch (owner decision 2026-10-19: new venues ship in phases).
3
+ *
4
+ * Phase 1 (0.15.0): RISEx is read-only — market data and public-by-address account reads.
5
+ * Phase 2 (a later release): trading. Flip this to `true`; nothing else needs to change.
6
+ *
7
+ * false removes the "trading" role from the RISEx venue definition (risex.ts), so every trading /
8
+ * signer / agent / bot / MCP-write path refuses with CAPABILITY_UNSUPPORTED through the role
9
+ * mechanism (venue.ts roleUnsupported()), and the adapter refuses writes itself as well.
10
+ * The trading code and its tests stay; those tests enable the switch with
11
+ * `vi.mock(".../venues/risex-release.js", () => ({ RISEX_TRADING_ENABLED: true }))`.
12
+ * Kept in its own module so tests can mock it without replacing the venue definition.
13
+ */
14
+ export const RISEX_TRADING_ENABLED = false;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * RISEx — fully on-chain perps order book on RISE chain (chainId 4153), USDC collateral.
3
+ *
4
+ * Two keys (developer.rise.trade "Integration"): the account (master EVM wallet) signs setup only;
5
+ * a registered session SIGNER signs every order / cancel / leverage / margin action with an EIP-712
6
+ * VerifyWitness permit (the server submits it and pays gas). perp-cli registers the signer with the
7
+ * master and then restricts it ON-CHAIN to the trading permission (no fund movement), and keeps its
8
+ * key in OWS wallet `agent-risex-<master>[-testnet]` (SSOT Rule #3).
9
+ *
10
+ * RELEASE PHASE: trading is implemented but switched OFF in this release (risex-release.ts
11
+ * RISEX_TRADING_ENABLED). RISEx is read-only here — market data and public-by-address account
12
+ * reads; every trading / signer path refuses with CAPABILITY_UNSUPPORTED (RISEX_TRADING_GATE).
13
+ *
14
+ * Deposits and withdrawals are app-only (owner decision 2026-10-13): `funds deposit|withdraw risex`
15
+ * refuse with CAPABILITY_UNSUPPORTED and point to app.rise.trade. Account reads are public by
16
+ * address. TP/SL and builder fees are not implemented yet.
17
+ * Not registered here; the registry module owns registerVenue().
18
+ */
19
+ import type { VenueDefinition } from "../venue.js";
20
+ export declare const RISEX_APP_URL = "https://app.rise.trade";
21
+ /** The uniform deposit / withdraw refusal (owner decision: funds move through the RISEx app only). */
22
+ export declare const RISEX_FUNDS_APP_ONLY: {
23
+ readonly reason: "RISEx deposits and withdrawals are done in the RISEx app; perp-cli does not move RISEx funds";
24
+ readonly remediation: "Deposit / withdraw at https://app.rise.trade (Portfolio → Deposit / Withdraw). perp-cli reads RISEx market data and your account (read-only in this release)";
25
+ };
26
+ /** The uniform refusal for every RISEx trading / signer path while RISEX_TRADING_ENABLED is false. */
27
+ export declare const RISEX_TRADING_GATE: {
28
+ readonly reason: "RISEx trading is planned for a later perp-cli release; in this version RISEx is read-only (market data and account reads)";
29
+ readonly remediation: "Trade RISEx in the RISEx app (https://app.rise.trade). perp-cli shows RISEx market data (perp -e risex market list|prices|funding|book) and account reads (perp -e risex portfolio, perp -e risex account positions)";
30
+ };
31
+ export declare const risexVenue: VenueDefinition;
@@ -0,0 +1,131 @@
1
+ /**
2
+ * RISEx — fully on-chain perps order book on RISE chain (chainId 4153), USDC collateral.
3
+ *
4
+ * Two keys (developer.rise.trade "Integration"): the account (master EVM wallet) signs setup only;
5
+ * a registered session SIGNER signs every order / cancel / leverage / margin action with an EIP-712
6
+ * VerifyWitness permit (the server submits it and pays gas). perp-cli registers the signer with the
7
+ * master and then restricts it ON-CHAIN to the trading permission (no fund movement), and keeps its
8
+ * key in OWS wallet `agent-risex-<master>[-testnet]` (SSOT Rule #3).
9
+ *
10
+ * RELEASE PHASE: trading is implemented but switched OFF in this release (risex-release.ts
11
+ * RISEX_TRADING_ENABLED). RISEx is read-only here — market data and public-by-address account
12
+ * reads; every trading / signer path refuses with CAPABILITY_UNSUPPORTED (RISEX_TRADING_GATE).
13
+ *
14
+ * Deposits and withdrawals are app-only (owner decision 2026-10-13): `funds deposit|withdraw risex`
15
+ * refuse with CAPABILITY_UNSUPPORTED and point to app.rise.trade. Account reads are public by
16
+ * address. TP/SL and builder fees are not implemented yet.
17
+ * Not registered here; the registry module owns registerVenue().
18
+ */
19
+ import { RISEX_TRADING_ENABLED } from "./risex-release.js";
20
+ export const RISEX_APP_URL = "https://app.rise.trade";
21
+ /** The uniform deposit / withdraw refusal (owner decision: funds move through the RISEx app only). */
22
+ export const RISEX_FUNDS_APP_ONLY = {
23
+ reason: "RISEx deposits and withdrawals are done in the RISEx app; perp-cli does not move RISEx funds",
24
+ remediation: `Deposit / withdraw at ${RISEX_APP_URL} (Portfolio → Deposit / Withdraw). perp-cli reads RISEx market data and your account (read-only in this release)`,
25
+ };
26
+ /** The uniform refusal for every RISEx trading / signer path while RISEX_TRADING_ENABLED is false. */
27
+ export const RISEX_TRADING_GATE = {
28
+ reason: "RISEx trading is planned for a later perp-cli release; in this version RISEx is read-only (market data and account reads)",
29
+ remediation: `Trade RISEx in the RISEx app (${RISEX_APP_URL}). perp-cli shows RISEx market data (perp -e risex market list|prices|funding|book) and account reads (perp -e risex portfolio, perp -e risex account positions)`,
30
+ };
31
+ const publicData = {
32
+ async fetchFundingRates(net) {
33
+ return (await import("../risex/public.js")).risexPublicData.fetchFundingRates(net);
34
+ },
35
+ async fetchMarkets(net) {
36
+ return (await import("../risex/public.js")).risexPublicData.fetchMarkets(net);
37
+ },
38
+ // Keyless positions of any account by public address (account positions --address): the
39
+ // adapter's own public-by-address read (/v1/portfolio/details), no signer.
40
+ addressKind: "evm",
41
+ async fetchPositionsByAddress(net, address) {
42
+ const { RisexAdapter } = await import("../risex/adapter.js");
43
+ const adapter = new RisexAdapter(risexVenue, net, { account: address, signer: null, meta: null, noSignerReason: null });
44
+ return { positions: await adapter.getPositions(), errors: {}, notes: [] };
45
+ },
46
+ // Keyless balance (account balance --address): the same signer-less adapter's getBalance. RISEx
47
+ // has no spot market: spot null.
48
+ async fetchBalanceByAddress(net, address) {
49
+ const { RisexAdapter } = await import("../risex/adapter.js");
50
+ const adapter = new RisexAdapter(risexVenue, net, { account: address, signer: null, meta: null, noSignerReason: null });
51
+ return { balance: await adapter.getBalance(), spot: null, accounts: null, dexes: null, accountMode: null, errors: {}, notes: [] };
52
+ },
53
+ };
54
+ export const risexVenue = {
55
+ id: "risex",
56
+ aliases: ["rise"],
57
+ displayName: "RISEx",
58
+ family: "risex",
59
+ masterKeyKind: "evm",
60
+ agentKeyKind: "evm",
61
+ secretStorage: { kind: "ows-wallet", dir: null },
62
+ networks: {
63
+ mainnet: {
64
+ restUrl: "https://api.rise.trade",
65
+ wsUrl: "wss://ws.rise.trade/ws",
66
+ explorerUrl: "https://explorer.risechain.com",
67
+ signingChainId: 4153,
68
+ settlementChain: "rise",
69
+ collateral: ["USDC"],
70
+ collateralAssetIndex: null,
71
+ rpcUrl: "https://rpc.risechain.com",
72
+ depositPins: null,
73
+ },
74
+ testnet: {
75
+ restUrl: "https://api.testnet.rise.trade",
76
+ // ws.testnet.rise.trade answered 525 on 2026-10-13; the API host serves the socket.
77
+ wsUrl: "wss://api.testnet.rise.trade/ws/",
78
+ explorerUrl: null,
79
+ signingChainId: 11155931,
80
+ settlementChain: "rise",
81
+ collateral: ["USDC"],
82
+ collateralAssetIndex: null,
83
+ rpcUrl: "https://testnet.riselabs.xyz",
84
+ depositPins: null,
85
+ },
86
+ },
87
+ // funding_interval = 3600e9 ns on every market; current_funding_rate is a fraction per hour.
88
+ fundingRateBasis: { kind: "perHours", hours: 1 },
89
+ settlementIntervalHours: 1,
90
+ // Verified 2026-10-14: current_funding_rate equals the last settled print in
91
+ // /funding-rate-history, and public /v1/account/funding-payments satisfy
92
+ // payment = position size × index price × rate for that hour, positive = paid. Evidence: raw
93
+ // records of 6 mainnet accounts / 23 markets / 31 hours in
94
+ // src/__tests__/fixtures/risex/funding-payments-evidence.json, checked by risex-evidence.test.ts.
95
+ fundingVerified: true,
96
+ // Phase 1 (0.15.0): read-only. The trading role comes back with RISEX_TRADING_ENABLED (phase 2).
97
+ roles: RISEX_TRADING_ENABLED ? ["marketData", "account", "trading"] : ["marketData", "account"],
98
+ gatedRoles: RISEX_TRADING_ENABLED ? null : { roles: ["trading"], ...RISEX_TRADING_GATE },
99
+ // Describes the implemented trading path; unreachable while the trading role is gated
100
+ // (requireCapabilities() checks the role first).
101
+ capabilities: {
102
+ // Market = order_type Market + IOC with a price_ticks bound (the venue requires FOK/IOC).
103
+ marketOrder: "slippageBounded",
104
+ // ALO = GTC + post_only. GTT is not offered (the ttl_units unit is undocumented).
105
+ timeInForce: ["GTC", "IOC", "FOK", "ALO"],
106
+ reduceOnlyTif: null,
107
+ clientOrderId: true,
108
+ // The response carries block_number (on-chain inclusion); IOC also carries filled_quantity.
109
+ orderAck: "sync",
110
+ tpsl: null,
111
+ amend: null,
112
+ batchPlaceMax: null,
113
+ marginModes: ["cross", "isolated"],
114
+ withdrawAssets: null,
115
+ },
116
+ // Documented 500 requests / 10 s per IP; Cloudflare 200 / 10 s observed — the stricter one.
117
+ rateLimit: { capacity: 200, refillPerSec: 20, weights: null },
118
+ // Not yet reviewed (open question Q-R5).
119
+ restrictedRegions: [],
120
+ symbolIdentity: "baseTicker",
121
+ publicData,
122
+ spot: null,
123
+ // The venue's own match_price_band (2% today) is checked per market before sending.
124
+ maxSlippageBps: 1000,
125
+ builderFee: null,
126
+ apiStatus: { kind: "official" },
127
+ async create(ctx) {
128
+ const { RisexAdapter } = await import("../risex/adapter.js");
129
+ return RisexAdapter.create(risexVenue, ctx);
130
+ },
131
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * TxFlow venue definition — MARKET DATA ONLY, through an UNOFFICIAL API.
3
+ *
4
+ * TxFlow publishes no official trading / data API yet (its "Platform API" is "Coming Soon").
5
+ * perp-cli reads the undocumented Hyperliquid-style `POST /info` endpoint and the WebSocket the
6
+ * TxFlow web app itself uses. It may change or be blocked without notice, so:
7
+ * - apiStatus is "unofficial" and every user-facing surface labels it;
8
+ * - funding is unverified (fundingVerified false): the rate is quoted in PERCENT per hour and is a
9
+ * live, moving estimate — kept out of arb ranking unless --include-unverified;
10
+ * - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path
11
+ * refuses with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported()).
12
+ * There is no TxFlow order, transfer or account code at all.
13
+ * Not registered here; the registry module owns registerVenue().
14
+ */
15
+ import type { VenueDefinition } from "../venue.js";
16
+ export declare const TXFLOW_REST_URL = "https://api.txflow.com";
17
+ export declare const TXFLOW_WS_URL = "wss://api.txflow.com/ws";
18
+ export declare const txflowVenue: VenueDefinition;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * TxFlow venue definition — MARKET DATA ONLY, through an UNOFFICIAL API.
3
+ *
4
+ * TxFlow publishes no official trading / data API yet (its "Platform API" is "Coming Soon").
5
+ * perp-cli reads the undocumented Hyperliquid-style `POST /info` endpoint and the WebSocket the
6
+ * TxFlow web app itself uses. It may change or be blocked without notice, so:
7
+ * - apiStatus is "unofficial" and every user-facing surface labels it;
8
+ * - funding is unverified (fundingVerified false): the rate is quoted in PERCENT per hour and is a
9
+ * live, moving estimate — kept out of arb ranking unless --include-unverified;
10
+ * - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path
11
+ * refuses with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported()).
12
+ * There is no TxFlow order, transfer or account code at all.
13
+ * Not registered here; the registry module owns registerVenue().
14
+ */
15
+ export const TXFLOW_REST_URL = "https://api.txflow.com";
16
+ export const TXFLOW_WS_URL = "wss://api.txflow.com/ws";
17
+ /** Lazy: public.ts (and `ws`) is only loaded when market data is actually requested. */
18
+ const publicData = {
19
+ async fetchFundingRates(net) {
20
+ return (await import("../txflow/public.js")).txflowPublicData.fetchFundingRates(net);
21
+ },
22
+ async fetchMarkets(net) {
23
+ return (await import("../txflow/public.js")).txflowPublicData.fetchMarkets(net);
24
+ },
25
+ };
26
+ export const txflowVenue = {
27
+ id: "txflow",
28
+ aliases: ["txf"],
29
+ displayName: "TxFlow",
30
+ family: "txflow",
31
+ masterKeyKind: "none",
32
+ agentKeyKind: "none",
33
+ secretStorage: { kind: "none", dir: null },
34
+ networks: {
35
+ mainnet: {
36
+ restUrl: TXFLOW_REST_URL,
37
+ wsUrl: TXFLOW_WS_URL,
38
+ explorerUrl: null,
39
+ signingChainId: null,
40
+ settlementChain: "offchain",
41
+ collateral: ["USDC"],
42
+ collateralAssetIndex: null,
43
+ rpcUrl: null,
44
+ depositPins: null,
45
+ },
46
+ // No public testnet.
47
+ testnet: null,
48
+ },
49
+ // settlementIntervalMs = 3600000 on every market (marketTicker); the rate is percent per hour.
50
+ fundingRateBasis: { kind: "perHours", hours: 1 },
51
+ settlementIntervalHours: 1,
52
+ // Unofficial API; the percent unit is inferred (HL-style 0.00125 %/h baseline on most markets);
53
+ // the published value moves every tick (a live estimate, not a settled print).
54
+ fundingVerified: false,
55
+ roles: ["marketData"],
56
+ gatedRoles: null,
57
+ capabilities: null,
58
+ // No rate-limit headers are published; conservative.
59
+ rateLimit: { capacity: 20, refillPerSec: 2, weights: null },
60
+ restrictedRegions: [],
61
+ symbolIdentity: "baseTicker",
62
+ publicData,
63
+ spot: null,
64
+ // Unused (no trading role); the field is required by the definition shape.
65
+ maxSlippageBps: 1,
66
+ builderFee: null,
67
+ apiStatus: {
68
+ kind: "unofficial",
69
+ note: "undocumented HL-style API used by the app.txflow.com web app; read-only in perp-cli and may change or be blocked without notice",
70
+ docs: "https://docs.txflow.com",
71
+ },
72
+ // A public-only adapter: market data works, every account / trading method refuses.
73
+ async create(ctx) {
74
+ const { TxflowPublicAdapter } = await import("../txflow/adapter.js");
75
+ return new TxflowPublicAdapter(txflowVenue, ctx.network);
76
+ },
77
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Variational (Omni) venue definition — MARKET DATA ONLY, through the OFFICIAL read-only API.
3
+ *
4
+ * Variational Omni is an RFQ venue: the Omni Liquidity Provider (OLP) is the only maker and quotes
5
+ * every trade — there is no order book (docs.variational.io/variational-protocol/key-concepts/trading-via-rfq).
6
+ * Its documented public API (docs.variational.io/technical-documentation/api) is one endpoint,
7
+ * `GET /metadata/v2/stats`, serving every market at once. The trading API "is still in
8
+ * development, and is not yet available to any users", so:
9
+ * - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path refuses
10
+ * with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported());
11
+ * - `market book` shows the OLP's indicative RFQ quotes at fixed notionals, labelled as such
12
+ * (never as order-book levels).
13
+ * No WebSocket is documented, so there is no ws codec.
14
+ * Not registered here; the registry module owns registerVenue().
15
+ */
16
+ import type { VenueDefinition } from "../venue.js";
17
+ export declare const VARIATIONAL_REST_URL = "https://omni-client-api.prod.ap-northeast-1.variational.io";
18
+ export declare const VARIATIONAL_API_DOCS = "https://docs.variational.io/technical-documentation/api";
19
+ /** Every role refusal's remediation (VenueDefinition.readOnlyRemediation, read by roleUnsupported). */
20
+ export declare const VARIATIONAL_READ_ONLY_REMEDIATION = "Variational is read-only (market data) in perp-cli; Variational has no public trading API yet. Trade on omni.variational.io; perp-cli shows Variational market data (perp -e variational market list|prices|info|funding|book, perp arb scan --rates --include-unverified)";
21
+ export declare const variationalVenue: VenueDefinition;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Variational (Omni) venue definition — MARKET DATA ONLY, through the OFFICIAL read-only API.
3
+ *
4
+ * Variational Omni is an RFQ venue: the Omni Liquidity Provider (OLP) is the only maker and quotes
5
+ * every trade — there is no order book (docs.variational.io/variational-protocol/key-concepts/trading-via-rfq).
6
+ * Its documented public API (docs.variational.io/technical-documentation/api) is one endpoint,
7
+ * `GET /metadata/v2/stats`, serving every market at once. The trading API "is still in
8
+ * development, and is not yet available to any users", so:
9
+ * - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path refuses
10
+ * with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported());
11
+ * - `market book` shows the OLP's indicative RFQ quotes at fixed notionals, labelled as such
12
+ * (never as order-book levels).
13
+ * No WebSocket is documented, so there is no ws codec.
14
+ * Not registered here; the registry module owns registerVenue().
15
+ */
16
+ export const VARIATIONAL_REST_URL = "https://omni-client-api.prod.ap-northeast-1.variational.io";
17
+ export const VARIATIONAL_API_DOCS = "https://docs.variational.io/technical-documentation/api";
18
+ /** Every role refusal's remediation (VenueDefinition.readOnlyRemediation, read by roleUnsupported). */
19
+ export const VARIATIONAL_READ_ONLY_REMEDIATION = "Variational is read-only (market data) in perp-cli; Variational has no public trading API yet. Trade on omni.variational.io; perp-cli shows Variational market data (perp -e variational market list|prices|info|funding|book, perp arb scan --rates --include-unverified)";
20
+ /** Lazy: public.ts is only loaded when market data is actually requested. */
21
+ const publicData = {
22
+ async fetchFundingRates(net) {
23
+ return (await import("../variational/public.js")).variationalPublicData.fetchFundingRates(net);
24
+ },
25
+ async fetchMarkets(net) {
26
+ return (await import("../variational/public.js")).variationalPublicData.fetchMarkets(net);
27
+ },
28
+ };
29
+ export const variationalVenue = {
30
+ id: "variational",
31
+ aliases: ["var", "omni"],
32
+ displayName: "Variational",
33
+ family: "variational",
34
+ masterKeyKind: "none",
35
+ agentKeyKind: "none",
36
+ secretStorage: { kind: "none", dir: null },
37
+ networks: {
38
+ mainnet: {
39
+ restUrl: VARIATIONAL_REST_URL,
40
+ // No WebSocket is documented.
41
+ wsUrl: null,
42
+ explorerUrl: null,
43
+ signingChainId: null,
44
+ // Settlement pools live on Arbitrum; perp-cli never touches them (read-only).
45
+ settlementChain: "offchain",
46
+ collateral: ["USDC"],
47
+ collateralAssetIndex: null,
48
+ rpcUrl: null,
49
+ depositPins: null,
50
+ },
51
+ // No public testnet API.
52
+ testnet: null,
53
+ },
54
+ // funding.interval_seconds is per market (1h / 4h / 8h perps; 24h swaps).
55
+ fundingRateBasis: "perMarket",
56
+ settlementIntervalHours: "perMarket",
57
+ // UNVERIFIED (design §14.12 #6: verified = checked against settled payments). The unit is
58
+ // documented (funding.last.interval_rate = fraction per interval_seconds, positive = longs pay)
59
+ // and interval_rate = annualized_rate × interval / 365 d holds on every live perp (2026-10-19),
60
+ // but that only shows the published fields agree: the rate is a moving prediction, there is no
61
+ // public account API to check settled payments, and the accrual hours of equity / ETF perps are
62
+ // not documented. Shown only on request (arb scan --rates --include-unverified).
63
+ fundingVerified: false,
64
+ roles: ["marketData"],
65
+ gatedRoles: null,
66
+ capabilities: null,
67
+ // Documented: 10 requests / 10 s per IP (shared with the legacy v1 endpoint). One call serves
68
+ // every market and is cached briefly (variational/public.ts), so commands rarely hit this.
69
+ rateLimit: { capacity: 10, refillPerSec: 1, weights: null },
70
+ // docs.variational.io/legal/restricted-persons (last updated 2026-04-20). Warn-only (never enforced).
71
+ restrictedRegions: ["US", "CA", "CU", "IR", "KP", "SD", "SY", "TW", "PR", "GU", "VI", "AS", "MP", "UM", "FM", "MH", "PW"],
72
+ symbolIdentity: "baseTicker",
73
+ publicData,
74
+ spot: null,
75
+ // Unused (no trading role); the field is required by the definition shape.
76
+ maxSlippageBps: 1,
77
+ builderFee: null,
78
+ apiStatus: { kind: "official" },
79
+ readOnlyRemediation: VARIATIONAL_READ_ONLY_REMEDIATION,
80
+ // A public-only adapter: market data works, every account / trading method refuses.
81
+ async create(ctx) {
82
+ const { VariationalPublicAdapter } = await import("../variational/adapter.js");
83
+ return new VariationalPublicAdapter(variationalVenue, ctx.network);
84
+ },
85
+ };
@@ -1,7 +1,7 @@
1
1
  export interface ExecutionRecord {
2
2
  id: string;
3
3
  timestamp: string;
4
- type: "market_order" | "limit_order" | "cancel" | "stop_order" | "edit_order" | "rebalance" | "arb_entry" | "arb_close" | "bridge" | "multi_leg" | "multi_leg_rollback" | "split_order";
4
+ type: "market_order" | "limit_order" | "cancel" | "stop_order" | "edit_order" | "rebalance" | "arb_entry" | "arb_close" | "bridge" | "multi_leg" | "multi_leg_rollback" | "split_order" | "print_deposit" | "print_end" | "vault_deposit" | "vault_withdraw";
5
5
  exchange: string;
6
6
  symbol: string;
7
7
  side: string;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Public market data for the legacy venues without a native `getVenueMarkets`
3
- * (pacifica, hyperliquid core, aster) — design §10.6. Lighter uses
3
+ * (pacifica, hyperliquid core, aster). Lighter uses
4
4
  * exchanges/lighter-public.ts.
5
5
  *
6
6
  * Network-aware: the REST base comes from `legacyPublicBaseUrl(venue, net)`,
@@ -19,13 +19,15 @@
19
19
  * pacifica: crypto-centric; PACIFICA_NON_CRYPTO lists every non-crypto perp
20
20
  * listed on 2026-09-30.
21
21
  * aster: exchangeInfo `underlyingSubType` (STOCK / ETF / Commodities / pre-launch).
22
- * AMBIGUOUS tickers are excluded with a warning so they cannot produce a false
23
- * cross-venue match (SPX = the SPX6900 token, whose ticker equals the S&P 500
24
- * canonical key).
22
+ * Ambiguous tickers (UNCLASSIFIED_TICKERS, src/ws/unclassified.ts — SPX = the SPX6900
23
+ * token, whose ticker equals the S&P 500 canonical key) are listed as "unclassified"
24
+ * (canonical null) so they cannot produce a false cross-venue match.
25
25
  *
26
26
  * Fields a venue does not publish on this path are null (HL has no fixed tick
27
27
  * size; Aster leverage brackets need a signed call; Aster OI is per-symbol only).
28
28
  */
29
29
  import type { VenuePublicData } from "../exchanges/venue.js";
30
30
  export type LegacyPublicVenue = "pacifica" | "hyperliquid" | "aster";
31
+ /** One public JSON read with the venue error mapping (rate limits, HTTP status, invalid JSON). */
32
+ export declare function legacyPublicJson(venue: LegacyPublicVenue, url: string, label: string, init?: RequestInit): Promise<unknown>;
31
33
  export declare function legacyPublicData(venue: LegacyPublicVenue): VenuePublicData;