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.
- package/README.ja.md +243 -0
- package/README.ko.md +243 -0
- package/README.md +138 -405
- package/README.zh.md +243 -0
- package/dist/agent-wallet/store.d.ts +3 -2
- package/dist/agent-wallet/store.js +2 -2
- package/dist/api/public/hyperliquid.js +4 -0
- package/dist/api/public/lighter.d.ts +5 -0
- package/dist/api/public/lighter.js +5 -0
- package/dist/api/public/pacifica.js +85 -15
- package/dist/api/public/urls.d.ts +2 -0
- package/dist/api/public/urls.js +3 -0
- package/dist/arb/sizing.js +4 -2
- package/dist/arb/state.d.ts +6 -0
- package/dist/arb/utils.d.ts +1 -2
- package/dist/arb/utils.js +1 -2
- package/dist/balance-by-address.d.ts +39 -0
- package/dist/balance-by-address.js +44 -0
- package/dist/bot/apex/pulse.js +3 -0
- package/dist/bot/apex/radar.js +2 -1
- package/dist/bot/engine.d.ts +10 -1
- package/dist/bot/engine.js +14 -6
- package/dist/bot/indicators.d.ts +7 -0
- package/dist/bot/indicators.js +16 -0
- package/dist/bot/perp-order.d.ts +4 -4
- package/dist/bot/perp-order.js +5 -5
- package/dist/bot/quarantine.d.ts +1 -1
- package/dist/bot/quarantine.js +1 -1
- package/dist/bot/quote-rules.js +1 -1
- package/dist/bot/strategies/apex-strategy.js +3 -2
- package/dist/bot/strategies/engine-mm.js +6 -5
- package/dist/bot/strategies/funding-arb-strategy.js +12 -5
- package/dist/bot/strategies/funding-arb-utils.d.ts +15 -3
- package/dist/bot/strategies/funding-arb-utils.js +53 -20
- package/dist/bot/strategies/funding-auto.js +2 -2
- package/dist/bot/strategies/liquidation-mm.d.ts +1 -0
- package/dist/bot/strategies/liquidation-mm.js +8 -2
- package/dist/bot/strategies/momentum-breakout.d.ts +1 -0
- package/dist/bot/strategies/momentum-breakout.js +11 -3
- package/dist/bot/strategies/spot-perp-arb-strategy.d.ts +1 -1
- package/dist/bot/strategies/spot-perp-arb-strategy.js +6 -4
- package/dist/bot/strategies/spot-perp-executor.d.ts +1 -1
- package/dist/bot/strategies/spot-perp-executor.js +3 -3
- package/dist/bot/strategy-types.d.ts +2 -1
- package/dist/bot/tui/BotDashboard.d.ts +1 -1
- package/dist/bot/tui/BotDashboard.js +1 -1
- package/dist/cache.js +12 -6
- package/dist/cli-program.d.ts +15 -0
- package/dist/cli-program.js +126 -6
- package/dist/commands/account.js +168 -24
- package/dist/commands/agent-import.d.ts +7 -0
- package/dist/commands/agent-import.js +30 -1
- package/dist/commands/agent.d.ts +6 -3
- package/dist/commands/agent.js +160 -12
- package/dist/commands/arb/index.js +23 -81
- package/dist/commands/arb-auto.d.ts +24 -0
- package/dist/commands/arb-auto.js +175 -97
- package/dist/commands/arb.d.ts +20 -0
- package/dist/commands/arb.js +107 -163
- package/dist/commands/backtest.js +23 -21
- package/dist/commands/bot.js +1 -1
- package/dist/commands/builder.js +1 -1
- package/dist/commands/funds.js +113 -3
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js +27 -7
- package/dist/commands/manage.js +23 -21
- package/dist/commands/market.d.ts +48 -0
- package/dist/commands/market.js +395 -100
- package/dist/commands/options.d.ts +14 -0
- package/dist/commands/options.js +151 -0
- package/dist/commands/pacifica-earn.d.ts +5 -0
- package/dist/commands/pacifica-earn.js +455 -0
- package/dist/commands/pacifica-orders.d.ts +14 -0
- package/dist/commands/pacifica-orders.js +142 -0
- package/dist/commands/portfolio.d.ts +16 -0
- package/dist/commands/portfolio.js +83 -55
- package/dist/commands/rebalance.d.ts +1 -0
- package/dist/commands/rebalance.js +15 -0
- package/dist/commands/risk.d.ts +11 -2
- package/dist/commands/risk.js +39 -44
- package/dist/commands/trade.d.ts +1 -0
- package/dist/commands/trade.js +67 -62
- package/dist/commands/wallet.js +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.js +15 -4
- package/dist/constants.js +6 -0
- package/dist/cross-chain-margin.d.ts +3 -1
- package/dist/cross-chain-margin.js +4 -2
- package/dist/dashboard/server.js +3 -3
- package/dist/dashboard/ui.js +9 -6
- package/dist/errors.d.ts +29 -1
- package/dist/errors.js +35 -3
- package/dist/exchanges/address.d.ts +8 -0
- package/dist/exchanges/address.js +47 -0
- package/dist/exchanges/arcus/adapter.d.ts +16 -12
- package/dist/exchanges/arcus/adapter.js +45 -18
- package/dist/exchanges/arcus/agent.d.ts +1 -1
- package/dist/exchanges/arcus/agent.js +1 -1
- package/dist/exchanges/arcus/client.js +1 -1
- package/dist/exchanges/arcus/public.js +3 -2
- package/dist/exchanges/arcus/signing.d.ts +2 -3
- package/dist/exchanges/arcus/signing.js +1 -1
- package/dist/exchanges/arcus/spot-chain.d.ts +1 -1
- package/dist/exchanges/arcus/spot-chain.js +1 -1
- package/dist/exchanges/arcus/spot-router.d.ts +1 -1
- package/dist/exchanges/arcus/spot-router.js +2 -2
- package/dist/exchanges/arcus/spot.d.ts +2 -3
- package/dist/exchanges/arcus/spot.js +2 -3
- package/dist/exchanges/aster-spot.d.ts +3 -3
- package/dist/exchanges/aster-spot.js +6 -9
- package/dist/exchanges/aster-typed-data.d.ts +1 -1
- package/dist/exchanges/aster-typed-data.js +1 -1
- package/dist/exchanges/aster.d.ts +30 -10
- package/dist/exchanges/aster.js +153 -53
- package/dist/exchanges/builder-fee.d.ts +1 -1
- package/dist/exchanges/builder-fee.js +13 -2
- package/dist/exchanges/canonical-symbols.d.ts +8 -2
- package/dist/exchanges/canonical-symbols.js +46 -2
- package/dist/exchanges/capabilities.d.ts +2 -0
- package/dist/exchanges/capabilities.js +2 -1
- package/dist/exchanges/derive/client.d.ts +37 -0
- package/dist/exchanges/derive/client.js +135 -0
- package/dist/exchanges/derive/options.d.ts +73 -0
- package/dist/exchanges/derive/options.js +379 -0
- package/dist/exchanges/extended/adapter.d.ts +96 -0
- package/dist/exchanges/extended/adapter.js +241 -0
- package/dist/exchanges/extended/client.d.ts +38 -0
- package/dist/exchanges/extended/client.js +88 -0
- package/dist/exchanges/extended/public.d.ts +133 -0
- package/dist/exchanges/extended/public.js +436 -0
- package/dist/exchanges/grvt/adapter.d.ts +100 -0
- package/dist/exchanges/grvt/adapter.js +283 -0
- package/dist/exchanges/grvt/client.d.ts +25 -0
- package/dist/exchanges/grvt/client.js +86 -0
- package/dist/exchanges/grvt/public.d.ts +151 -0
- package/dist/exchanges/grvt/public.js +438 -0
- package/dist/exchanges/hyperliquid-outcome.d.ts +2 -0
- package/dist/exchanges/hyperliquid-outcome.js +29 -1
- package/dist/exchanges/hyperliquid-spot.d.ts +9 -1
- package/dist/exchanges/hyperliquid-spot.js +24 -16
- package/dist/exchanges/hyperliquid.d.ts +199 -22
- package/dist/exchanges/hyperliquid.js +550 -202
- package/dist/exchanges/index.d.ts +1 -1
- package/dist/exchanges/index.js +1 -1
- package/dist/exchanges/interface.d.ts +157 -13
- package/dist/exchanges/interface.js +47 -0
- package/dist/exchanges/ioc-outcome.d.ts +1 -1
- package/dist/exchanges/ioc-outcome.js +1 -1
- package/dist/exchanges/legacy-trading-v2.d.ts +2 -2
- package/dist/exchanges/legacy-trading-v2.js +7 -2
- package/dist/exchanges/lighter-public.d.ts +67 -12
- package/dist/exchanges/lighter-public.js +250 -82
- package/dist/exchanges/lighter-signer.d.ts +1 -1
- package/dist/exchanges/lighter-signer.js +1 -1
- package/dist/exchanges/lighter-spot.d.ts +10 -5
- package/dist/exchanges/lighter-spot.js +105 -97
- package/dist/exchanges/lighter.d.ts +80 -21
- package/dist/exchanges/lighter.js +312 -105
- package/dist/exchanges/ondo/adapter.d.ts +38 -13
- package/dist/exchanges/ondo/adapter.js +86 -27
- package/dist/exchanges/ondo/agent.d.ts +1 -1
- package/dist/exchanges/ondo/agent.js +1 -1
- package/dist/exchanges/ondo/client.d.ts +1 -1
- package/dist/exchanges/ondo/client.js +2 -2
- package/dist/exchanges/ondo/public.d.ts +35 -3
- package/dist/exchanges/ondo/public.js +75 -32
- package/dist/exchanges/ondo/spot.d.ts +2 -2
- package/dist/exchanges/ondo/spot.js +3 -3
- package/dist/exchanges/options-interface.d.ts +158 -0
- package/dist/exchanges/options-interface.js +17 -0
- package/dist/exchanges/options-venues.d.ts +12 -0
- package/dist/exchanges/options-venues.js +35 -0
- package/dist/exchanges/outcome-interface.d.ts +4 -0
- package/dist/exchanges/pacifica-atomic.d.ts +211 -0
- package/dist/exchanges/pacifica-atomic.js +440 -0
- package/dist/exchanges/pacifica-decimal.d.ts +10 -0
- package/dist/exchanges/pacifica-decimal.js +51 -0
- package/dist/exchanges/pacifica-presigned.d.ts +53 -0
- package/dist/exchanges/pacifica-presigned.js +141 -0
- package/dist/exchanges/pacifica-print.d.ts +200 -0
- package/dist/exchanges/pacifica-print.js +417 -0
- package/dist/exchanges/pacifica-spot.d.ts +8 -2
- package/dist/exchanges/pacifica-spot.js +26 -18
- package/dist/exchanges/pacifica-typed-data.d.ts +1 -1
- package/dist/exchanges/pacifica-typed-data.js +1 -1
- package/dist/exchanges/pacifica-vaults.d.ts +130 -0
- package/dist/exchanges/pacifica-vaults.js +277 -0
- package/dist/exchanges/pacifica.d.ts +108 -10
- package/dist/exchanges/pacifica.js +428 -171
- package/dist/exchanges/precision.d.ts +3 -1
- package/dist/exchanges/precision.js +9 -2
- package/dist/exchanges/public-balances.d.ts +25 -0
- package/dist/exchanges/public-balances.js +158 -0
- package/dist/exchanges/public-positions.d.ts +43 -0
- package/dist/exchanges/public-positions.js +154 -0
- package/dist/exchanges/qfex/adapter.d.ts +69 -13
- package/dist/exchanges/qfex/adapter.js +102 -17
- package/dist/exchanges/qfex/agent.d.ts +1 -1
- package/dist/exchanges/qfex/agent.js +1 -1
- package/dist/exchanges/qfex/client.d.ts +1 -1
- package/dist/exchanges/qfex/client.js +1 -1
- package/dist/exchanges/qfex/errors.d.ts +1 -1
- package/dist/exchanges/qfex/errors.js +2 -2
- package/dist/exchanges/qfex/public.d.ts +65 -12
- package/dist/exchanges/qfex/public.js +131 -25
- package/dist/exchanges/qfex/signing.d.ts +2 -2
- package/dist/exchanges/qfex/signing.js +4 -5
- package/dist/exchanges/qfex/ws-transport.d.ts +3 -3
- package/dist/exchanges/qfex/ws-transport.js +3 -3
- package/dist/exchanges/rate-limiter.d.ts +1 -1
- package/dist/exchanges/rate-limiter.js +5 -2
- package/dist/exchanges/registry.d.ts +1 -1
- package/dist/exchanges/registry.js +1 -1
- package/dist/exchanges/risex/adapter.d.ts +160 -0
- package/dist/exchanges/risex/adapter.js +842 -0
- package/dist/exchanges/risex/agent.d.ts +154 -0
- package/dist/exchanges/risex/agent.js +384 -0
- package/dist/exchanges/risex/client.d.ts +47 -0
- package/dist/exchanges/risex/client.js +174 -0
- package/dist/exchanges/risex/nonce.d.ts +43 -0
- package/dist/exchanges/risex/nonce.js +212 -0
- package/dist/exchanges/risex/public.d.ts +64 -0
- package/dist/exchanges/risex/public.js +150 -0
- package/dist/exchanges/risex/session.d.ts +71 -0
- package/dist/exchanges/risex/session.js +171 -0
- package/dist/exchanges/risex/typed-data.d.ts +173 -0
- package/dist/exchanges/risex/typed-data.js +240 -0
- package/dist/exchanges/risex/units.d.ts +29 -0
- package/dist/exchanges/risex/units.js +104 -0
- package/dist/exchanges/slippage.d.ts +1 -1
- package/dist/exchanges/slippage.js +1 -1
- package/dist/exchanges/spot-factory.d.ts +3 -3
- package/dist/exchanges/spot-factory.js +8 -8
- package/dist/exchanges/spot-interface.d.ts +5 -5
- package/dist/exchanges/spot-interface.js +2 -2
- package/dist/exchanges/spot-result.d.ts +3 -3
- package/dist/exchanges/spot-result.js +3 -3
- package/dist/exchanges/trading-v2.d.ts +3 -3
- package/dist/exchanges/trading-v2.js +9 -6
- package/dist/exchanges/txflow/adapter.d.ts +61 -0
- package/dist/exchanges/txflow/adapter.js +150 -0
- package/dist/exchanges/txflow/client.d.ts +47 -0
- package/dist/exchanges/txflow/client.js +155 -0
- package/dist/exchanges/txflow/public.d.ts +87 -0
- package/dist/exchanges/txflow/public.js +355 -0
- package/dist/exchanges/unknown-symbol.d.ts +34 -0
- package/dist/exchanges/unknown-symbol.js +56 -0
- package/dist/exchanges/variational/adapter.d.ts +67 -0
- package/dist/exchanges/variational/adapter.js +137 -0
- package/dist/exchanges/variational/client.d.ts +21 -0
- package/dist/exchanges/variational/client.js +66 -0
- package/dist/exchanges/variational/public.d.ts +126 -0
- package/dist/exchanges/variational/public.js +430 -0
- package/dist/exchanges/venue-types.d.ts +52 -10
- package/dist/exchanges/venue-types.js +82 -11
- package/dist/exchanges/venue.d.ts +150 -11
- package/dist/exchanges/venue.js +126 -4
- package/dist/exchanges/venues/arcus.d.ts +1 -2
- package/dist/exchanges/venues/arcus.js +5 -4
- package/dist/exchanges/venues/aster.d.ts +2 -2
- package/dist/exchanges/venues/aster.js +6 -4
- package/dist/exchanges/venues/create-helpers.d.ts +1 -1
- package/dist/exchanges/venues/create-helpers.js +3 -3
- package/dist/exchanges/venues/extended.d.ts +21 -0
- package/dist/exchanges/venues/extended.js +96 -0
- package/dist/exchanges/venues/grvt.d.ts +30 -0
- package/dist/exchanges/venues/grvt.js +98 -0
- package/dist/exchanges/venues/hyperliquid.d.ts +2 -2
- package/dist/exchanges/venues/hyperliquid.js +19 -8
- package/dist/exchanges/venues/index.d.ts +7 -2
- package/dist/exchanges/venues/index.js +8 -2
- package/dist/exchanges/venues/lighter-family.d.ts +7 -9
- package/dist/exchanges/venues/lighter-family.js +9 -11
- package/dist/exchanges/venues/lighter-rh.d.ts +2 -2
- package/dist/exchanges/venues/lighter-rh.js +20 -8
- package/dist/exchanges/venues/lighter.d.ts +1 -1
- package/dist/exchanges/venues/lighter.js +18 -6
- package/dist/exchanges/venues/ondo.d.ts +1 -1
- package/dist/exchanges/venues/ondo.js +5 -3
- package/dist/exchanges/venues/pacifica.d.ts +2 -2
- package/dist/exchanges/venues/pacifica.js +15 -4
- package/dist/exchanges/venues/qfex.d.ts +1 -1
- package/dist/exchanges/venues/qfex.js +4 -2
- package/dist/exchanges/venues/risex-release.d.ts +14 -0
- package/dist/exchanges/venues/risex-release.js +14 -0
- package/dist/exchanges/venues/risex.d.ts +31 -0
- package/dist/exchanges/venues/risex.js +131 -0
- package/dist/exchanges/venues/txflow.d.ts +18 -0
- package/dist/exchanges/venues/txflow.js +77 -0
- package/dist/exchanges/venues/variational.d.ts +21 -0
- package/dist/exchanges/venues/variational.js +85 -0
- package/dist/execution-log.d.ts +1 -1
- package/dist/funding/legacy-public.d.ts +6 -4
- package/dist/funding/legacy-public.js +42 -41
- package/dist/funding/normalize.d.ts +1 -1
- package/dist/funding/normalize.js +1 -1
- package/dist/funding/rates.d.ts +95 -6
- package/dist/funding/rates.js +99 -19
- package/dist/index.js +7 -6
- package/dist/jobs.d.ts +1 -0
- package/dist/jobs.js +25 -1
- package/dist/landing.d.ts +2 -0
- package/dist/landing.js +1 -1
- package/dist/liquidity.d.ts +3 -1
- package/dist/liquidity.js +8 -4
- package/dist/mcp-pacifica-earn.d.ts +9 -0
- package/dist/mcp-pacifica-earn.js +64 -0
- package/dist/mcp-server.js +211 -68
- package/dist/pacifica/client.d.ts +69 -5
- package/dist/pacifica/client.js +181 -8
- package/dist/pacifica/rate-limit.d.ts +144 -0
- package/dist/pacifica/rate-limit.js +267 -0
- package/dist/pacifica/types/order.d.ts +2 -1
- package/dist/plan-executor.js +7 -2
- package/dist/positions-by-address.d.ts +34 -0
- package/dist/positions-by-address.js +46 -0
- package/dist/rebalance.js +1 -1
- package/dist/risk.d.ts +2 -1
- package/dist/risk.js +2 -4
- package/dist/settings.d.ts +32 -3
- package/dist/signer/ows-evm.d.ts +1 -1
- package/dist/signer/ows-evm.js +1 -1
- package/dist/smart-order.d.ts +1 -1
- package/dist/smart-order.js +1 -1
- package/dist/strategies/funding-arb.d.ts +1 -1
- package/dist/strategies/funding-arb.js +36 -63
- package/dist/trade-validator.js +2 -2
- package/dist/utils.d.ts +22 -3
- package/dist/utils.js +11 -3
- package/dist/venue-health.d.ts +40 -0
- package/dist/venue-health.js +75 -0
- package/dist/withdraw-gate.d.ts +1 -1
- package/dist/withdraw-gate.js +1 -1
- package/dist/ws/arcus-market.d.ts +9 -0
- package/dist/ws/arcus-market.js +9 -0
- package/dist/ws/aster-market.d.ts +33 -0
- package/dist/ws/aster-market.js +30 -0
- package/dist/ws/index.d.ts +980 -0
- package/dist/ws/index.js +4460 -0
- package/dist/ws/lighter-market.d.ts +14 -0
- package/dist/ws/lighter-market.js +13 -0
- package/dist/ws/node.d.ts +996 -0
- package/dist/ws/node.js +4554 -0
- package/dist/ws/pacifica-instrument.d.ts +8 -0
- package/dist/ws/pacifica-instrument.js +8 -0
- package/dist/ws/unclassified.d.ts +16 -0
- package/dist/ws/unclassified.js +43 -0
- package/dist/ws-cli/credentials.d.ts +62 -0
- package/dist/ws-cli/credentials.js +126 -0
- package/package.json +71 -10
- package/skills/perp-cli/SKILL.md +153 -36
- package/skills/perp-cli/package.json +15 -2
- package/skills/perp-cli/references/agent-operations.md +22 -12
- package/skills/perp-cli/references/commands.md +143 -17
- package/skills/perp-cli/references/strategies.md +38 -3
- package/skills/perp-cli/references/ws-library.md +523 -0
- package/skills/perp-cli/scripts/arb-monitor.sh +13 -10
- package/skills/perp-cli/scripts/funding-analysis.sh +57 -29
- package/skills/perp-cli/scripts/preflight.sh +27 -19
- package/skills/perp-cli/scripts/spot-perp-scan.sh +58 -38
- package/skills/perp-cli/scripts/validate-arb.sh +56 -39
- package/dist/cli-spec.d.ts +0 -46
- package/dist/cli-spec.js +0 -81
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Adapter construction for the pre-existing venues (pacifica / hyperliquid /
|
|
3
3
|
* lighter / lighter-rh / aster) — the single creation path that replaced the
|
|
4
4
|
* three copies in src/index.ts (getAdapter / _initWithOws / getAdapterForExchange)
|
|
5
|
-
* and the MCP server's getOrCreateAdapter
|
|
5
|
+
* and the MCP server's getOrCreateAdapter.
|
|
6
6
|
*
|
|
7
7
|
* Signer tiers, as before: agent (Tier 1) → OWS master (Tier 2) → raw PK (Tier 3).
|
|
8
8
|
* Which tier signs a given request is still decided inside each adapter.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Adapter construction for the pre-existing venues (pacifica / hyperliquid /
|
|
3
3
|
* lighter / lighter-rh / aster) — the single creation path that replaced the
|
|
4
4
|
* three copies in src/index.ts (getAdapter / _initWithOws / getAdapterForExchange)
|
|
5
|
-
* and the MCP server's getOrCreateAdapter
|
|
5
|
+
* and the MCP server's getOrCreateAdapter.
|
|
6
6
|
*
|
|
7
7
|
* Signer tiers, as before: agent (Tier 1) → OWS master (Tier 2) → raw PK (Tier 3).
|
|
8
8
|
* Which tier signs a given request is still decided inside each adapter.
|
|
@@ -84,7 +84,7 @@ export async function createPacifica(ctx) {
|
|
|
84
84
|
adapter = new PacificaAdapter(parseSolanaKeypair(creds.pk), ctx.network, true);
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
|
-
// Read-only: no key material. index.ts:143 Keypair.generate() recorded as out of scope
|
|
87
|
+
// Read-only: no key material. index.ts:143 Keypair.generate() recorded as out of scope.
|
|
88
88
|
adapter = new PacificaAdapter(Keypair.generate(), ctx.network, false);
|
|
89
89
|
}
|
|
90
90
|
const agent = await legacyAgentOf(ctx, creds, "pacifica");
|
|
@@ -138,7 +138,7 @@ export async function createHyperliquid(ctx) {
|
|
|
138
138
|
export async function createLighterFamily(venue, ctx) {
|
|
139
139
|
const creds = effectiveCredentials(ctx);
|
|
140
140
|
if (venue === "lighter-rh" && creds.pk !== null) {
|
|
141
|
-
//
|
|
141
|
+
// The Lighter RH master key is an OWS wallet only — no env / raw-PK tier.
|
|
142
142
|
throw new PerpError("NO_ENV_TIER", "Lighter RH does not accept a raw private key (env / --private-key / local wallet)", {
|
|
143
143
|
remediation: "Import the key into OWS (perp wallet import, key via hidden prompt / stdin) and run with --ows <wallet>, or register an agent: perp wallet agent approve lighter-rh",
|
|
144
144
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended (formerly X10) — perps order book on Starknet, USD collateral. MARKET DATA ONLY in this
|
|
3
|
+
* version, through the OFFICIAL public REST API (https://api.docs.extended.exchange/).
|
|
4
|
+
*
|
|
5
|
+
* - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path
|
|
6
|
+
* refuses with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported(), with the
|
|
7
|
+
* readOnlyRemediation below). There is no Extended order, signing (Stark), transfer or account
|
|
8
|
+
* code at all; trading is planned for a later release.
|
|
9
|
+
* - Hosts (docs "Mainnet" / "Testnet"): mainnet api.starknet.extended.exchange, testnet (Sepolia)
|
|
10
|
+
* api.starknet.sepolia.extended.exchange. The old api.extended.exchange answers 404.
|
|
11
|
+
* - Every request must carry a User-Agent header (docs "Mandatory headers"; none → HTTP 403).
|
|
12
|
+
* - Funding (docs "Get funding rates history", docs.extended.exchange funding-payments): applied
|
|
13
|
+
* once per hour; marketStats.fundingRate is the current hour's ACCRUING rate (recomputed every
|
|
14
|
+
* minute) as a FRACTION per hour — see extended/public.ts.
|
|
15
|
+
* Not registered here; the registry module owns registerVenue().
|
|
16
|
+
*/
|
|
17
|
+
import type { VenueDefinition } from "../venue.js";
|
|
18
|
+
export declare const EXTENDED_DOCS_URL = "https://api.docs.extended.exchange/";
|
|
19
|
+
/** The remediation of every role refusal (owner decision: phase 1 is read-only). */
|
|
20
|
+
export declare const EXTENDED_READ_ONLY_REMEDIATION = "Extended is read-only (market data) in this version; trading is planned for a later release. Market data: perp -e extended market list|prices|info|book|trades|funding|kline";
|
|
21
|
+
export declare const extendedVenue: VenueDefinition;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended (formerly X10) — perps order book on Starknet, USD collateral. MARKET DATA ONLY in this
|
|
3
|
+
* version, through the OFFICIAL public REST API (https://api.docs.extended.exchange/).
|
|
4
|
+
*
|
|
5
|
+
* - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path
|
|
6
|
+
* refuses with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported(), with the
|
|
7
|
+
* readOnlyRemediation below). There is no Extended order, signing (Stark), transfer or account
|
|
8
|
+
* code at all; trading is planned for a later release.
|
|
9
|
+
* - Hosts (docs "Mainnet" / "Testnet"): mainnet api.starknet.extended.exchange, testnet (Sepolia)
|
|
10
|
+
* api.starknet.sepolia.extended.exchange. The old api.extended.exchange answers 404.
|
|
11
|
+
* - Every request must carry a User-Agent header (docs "Mandatory headers"; none → HTTP 403).
|
|
12
|
+
* - Funding (docs "Get funding rates history", docs.extended.exchange funding-payments): applied
|
|
13
|
+
* once per hour; marketStats.fundingRate is the current hour's ACCRUING rate (recomputed every
|
|
14
|
+
* minute) as a FRACTION per hour — see extended/public.ts.
|
|
15
|
+
* Not registered here; the registry module owns registerVenue().
|
|
16
|
+
*/
|
|
17
|
+
export const EXTENDED_DOCS_URL = "https://api.docs.extended.exchange/";
|
|
18
|
+
/** The remediation of every role refusal (owner decision: phase 1 is read-only). */
|
|
19
|
+
export const EXTENDED_READ_ONLY_REMEDIATION = "Extended is read-only (market data) in this version; trading is planned for a later release. Market data: perp -e extended market list|prices|info|book|trades|funding|kline";
|
|
20
|
+
/** Lazy: public.ts is only loaded when market data is actually requested. */
|
|
21
|
+
const publicData = {
|
|
22
|
+
async fetchFundingRates(net) {
|
|
23
|
+
return (await import("../extended/public.js")).extendedPublicData.fetchFundingRates(net);
|
|
24
|
+
},
|
|
25
|
+
async fetchMarkets(net) {
|
|
26
|
+
return (await import("../extended/public.js")).extendedPublicData.fetchMarkets(net);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export const extendedVenue = {
|
|
30
|
+
id: "extended",
|
|
31
|
+
aliases: ["ext", "x10"],
|
|
32
|
+
displayName: "Extended",
|
|
33
|
+
family: "extended",
|
|
34
|
+
masterKeyKind: "none",
|
|
35
|
+
agentKeyKind: "none",
|
|
36
|
+
secretStorage: { kind: "none", dir: null },
|
|
37
|
+
networks: {
|
|
38
|
+
mainnet: {
|
|
39
|
+
restUrl: "https://api.starknet.extended.exchange/api/v1",
|
|
40
|
+
wsUrl: "wss://api.starknet.extended.exchange/stream.extended.exchange/v1",
|
|
41
|
+
explorerUrl: null,
|
|
42
|
+
signingChainId: null,
|
|
43
|
+
settlementChain: "starknet",
|
|
44
|
+
collateral: ["USD"],
|
|
45
|
+
collateralAssetIndex: null,
|
|
46
|
+
rpcUrl: null,
|
|
47
|
+
depositPins: null,
|
|
48
|
+
},
|
|
49
|
+
testnet: {
|
|
50
|
+
restUrl: "https://api.starknet.sepolia.extended.exchange/api/v1",
|
|
51
|
+
// The docs' SDK config (TESTNET_CONFIG stream_url). Unused (no ws codec); live 2026-10-19 it
|
|
52
|
+
// answered HTTP 403 to a public stream (api.starknet.sepolia… answered 503) — unverified.
|
|
53
|
+
wsUrl: "wss://starknet.sepolia.extended.exchange/stream.extended.exchange/v1",
|
|
54
|
+
explorerUrl: null,
|
|
55
|
+
signingChainId: null,
|
|
56
|
+
settlementChain: "starknet",
|
|
57
|
+
collateral: ["USD"],
|
|
58
|
+
collateralAssetIndex: null,
|
|
59
|
+
rpcUrl: null,
|
|
60
|
+
depositPins: null,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
// Funding is applied once per hour on every perpetual market; the published rate is per hour.
|
|
64
|
+
fundingRateBasis: { kind: "perHours", hours: 1 },
|
|
65
|
+
settlementIntervalHours: 1,
|
|
66
|
+
// Not verified: the unit / sign of marketStats.fundingRate is not checked against a settled account
|
|
67
|
+
// funding payment (needs an account; RISEx's bar). Partial evidence only: docs + one recorded
|
|
68
|
+
// settlement (src/__tests__/fixtures/extended/funding-settlement-evidence.json — last accruing value
|
|
69
|
+
// == applied print on 8 markets, 5 of them at the baseline). And `_24_5` equities print 0 while
|
|
70
|
+
// their underlying is closed (TSLA_24_5: 34 of 43 weekend prints were 0), so hourly × 8760
|
|
71
|
+
// overstates them. Until settled against payments Extended is not a funding-arb venue.
|
|
72
|
+
fundingVerified: false,
|
|
73
|
+
roles: ["marketData"],
|
|
74
|
+
capabilities: null,
|
|
75
|
+
// Docs "Rate Limits": default tier 1,000 requests/minute per IP, all endpoints throttled by IP.
|
|
76
|
+
// 15/s sustained (900/min) leaves headroom for other processes on the same IP.
|
|
77
|
+
rateLimit: { capacity: 50, refillPerSec: 15, weights: null },
|
|
78
|
+
// docs.extended.exchange/extended-resources/legal/restricted-countries (2026-10-19), Category A;
|
|
79
|
+
// Ukraine is restricted only for Crimea / Donetsk / Kherson / Luhansk / Zaporizhzhia (no alpha-2).
|
|
80
|
+
// Warning-only and shown with credentials — unused while the venue is market data only.
|
|
81
|
+
restrictedRegions: ["AF", "CA", "HK", "CU", "IR", "IQ", "YE", "KP", "RU", "SY", "SC", "GB", "US"],
|
|
82
|
+
symbolIdentity: "baseTicker",
|
|
83
|
+
publicData,
|
|
84
|
+
spot: null,
|
|
85
|
+
// Unused (no trading role); the field is required by the definition shape.
|
|
86
|
+
maxSlippageBps: 1,
|
|
87
|
+
builderFee: null,
|
|
88
|
+
apiStatus: { kind: "official" },
|
|
89
|
+
gatedRoles: null,
|
|
90
|
+
readOnlyRemediation: EXTENDED_READ_ONLY_REMEDIATION,
|
|
91
|
+
// A public-only adapter: market data works, every account / trading method refuses.
|
|
92
|
+
async create(ctx) {
|
|
93
|
+
const { ExtendedPublicAdapter } = await import("../extended/adapter.js");
|
|
94
|
+
return new ExtendedPublicAdapter(extendedVenue, ctx.network);
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GRVT venue definition — MARKET DATA ONLY in this version (official, documented API).
|
|
3
|
+
*
|
|
4
|
+
* GRVT (api-docs.grvt.io) is a hybrid perps exchange (off-chain matching, ZK-validium settlement on
|
|
5
|
+
* GRVT chain 325), USDT collateral. perp-cli reads its public Market Data REST API
|
|
6
|
+
* (`POST https://market-data.grvt.io/full/v1/<endpoint>`, no key) and nothing else:
|
|
7
|
+
* - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path refuses
|
|
8
|
+
* with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported(), with the
|
|
9
|
+
* readOnlyRemediation below). There is no GRVT order, signing, transfer or account code at all.
|
|
10
|
+
* - funding is unverified (fundingVerified false): the ticker's `funding_rate` is the venue's
|
|
11
|
+
* indicative rate for the active interval (a moving estimate of the next payment, "predicted"),
|
|
12
|
+
* quoted in percent per the market's own funding interval (4 h or 8 h, per instrument). The
|
|
13
|
+
* percent unit is documented for settled history (/full/v1/funding "percentage points") and
|
|
14
|
+
* observed identical in magnitude on the ticker (whose schema says "centibeeps"); it is not yet
|
|
15
|
+
* checked against settled funding payments (an authenticated read) — kept out of arb ranking
|
|
16
|
+
* unless --include-unverified.
|
|
17
|
+
* Not registered here; the registry module owns registerVenue().
|
|
18
|
+
*/
|
|
19
|
+
import type { RateLimitPolicy, VenueDefinition } from "../venue.js";
|
|
20
|
+
export declare const GRVT_DOCS_URL = "https://api-docs.grvt.io";
|
|
21
|
+
/** Uniform refusal text for every write / signer / setup-trading path on GRVT. */
|
|
22
|
+
export declare const GRVT_READ_ONLY_REMEDIATION = "GRVT is read-only (market data) in this version; trading is planned for a later release";
|
|
23
|
+
/**
|
|
24
|
+
* help.grvt.io "What are the rate limitations on Grvt?" — REST Market Data, every tier, per minute:
|
|
25
|
+
* GetInstrument / MiniTicker / Ticker 1500, all others 500 (WS JSON-RPC calls count too). Two token
|
|
26
|
+
* buckets sized so that no 60 s window can exceed the limit (capacity + 60 s × refill ≤ limit).
|
|
27
|
+
*/
|
|
28
|
+
export declare const GRVT_TICKER_RATE_LIMIT: RateLimitPolicy;
|
|
29
|
+
export declare const GRVT_OTHER_RATE_LIMIT: RateLimitPolicy;
|
|
30
|
+
export declare const grvtVenue: VenueDefinition;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GRVT venue definition — MARKET DATA ONLY in this version (official, documented API).
|
|
3
|
+
*
|
|
4
|
+
* GRVT (api-docs.grvt.io) is a hybrid perps exchange (off-chain matching, ZK-validium settlement on
|
|
5
|
+
* GRVT chain 325), USDT collateral. perp-cli reads its public Market Data REST API
|
|
6
|
+
* (`POST https://market-data.grvt.io/full/v1/<endpoint>`, no key) and nothing else:
|
|
7
|
+
* - roles are ["marketData"]: every account / trading / funds / agent / builder / bot path refuses
|
|
8
|
+
* with CAPABILITY_UNSUPPORTED before any request (venue.ts roleUnsupported(), with the
|
|
9
|
+
* readOnlyRemediation below). There is no GRVT order, signing, transfer or account code at all.
|
|
10
|
+
* - funding is unverified (fundingVerified false): the ticker's `funding_rate` is the venue's
|
|
11
|
+
* indicative rate for the active interval (a moving estimate of the next payment, "predicted"),
|
|
12
|
+
* quoted in percent per the market's own funding interval (4 h or 8 h, per instrument). The
|
|
13
|
+
* percent unit is documented for settled history (/full/v1/funding "percentage points") and
|
|
14
|
+
* observed identical in magnitude on the ticker (whose schema says "centibeeps"); it is not yet
|
|
15
|
+
* checked against settled funding payments (an authenticated read) — kept out of arb ranking
|
|
16
|
+
* unless --include-unverified.
|
|
17
|
+
* Not registered here; the registry module owns registerVenue().
|
|
18
|
+
*/
|
|
19
|
+
export const GRVT_DOCS_URL = "https://api-docs.grvt.io";
|
|
20
|
+
/** Uniform refusal text for every write / signer / setup-trading path on GRVT. */
|
|
21
|
+
export const GRVT_READ_ONLY_REMEDIATION = "GRVT is read-only (market data) in this version; trading is planned for a later release";
|
|
22
|
+
/**
|
|
23
|
+
* help.grvt.io "What are the rate limitations on Grvt?" — REST Market Data, every tier, per minute:
|
|
24
|
+
* GetInstrument / MiniTicker / Ticker 1500, all others 500 (WS JSON-RPC calls count too). Two token
|
|
25
|
+
* buckets sized so that no 60 s window can exceed the limit (capacity + 60 s × refill ≤ limit).
|
|
26
|
+
*/
|
|
27
|
+
export const GRVT_TICKER_RATE_LIMIT = { capacity: 750, refillPerSec: 12, weights: null };
|
|
28
|
+
export const GRVT_OTHER_RATE_LIMIT = { capacity: 250, refillPerSec: 4, weights: null };
|
|
29
|
+
/** Lazy: public.ts is only loaded when market data is actually requested. */
|
|
30
|
+
const publicData = {
|
|
31
|
+
async fetchFundingRates(net) {
|
|
32
|
+
return (await import("../grvt/public.js")).grvtPublicData.fetchFundingRates(net);
|
|
33
|
+
},
|
|
34
|
+
async fetchMarkets(net) {
|
|
35
|
+
return (await import("../grvt/public.js")).grvtPublicData.fetchMarkets(net);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export const grvtVenue = {
|
|
39
|
+
id: "grvt",
|
|
40
|
+
aliases: ["grv"],
|
|
41
|
+
displayName: "GRVT",
|
|
42
|
+
family: "grvt",
|
|
43
|
+
masterKeyKind: "none",
|
|
44
|
+
agentKeyKind: "none",
|
|
45
|
+
secretStorage: { kind: "none", dir: null },
|
|
46
|
+
networks: {
|
|
47
|
+
// grvt-pysdk grvt_raw_env.py (PROD / TESTNET); the docs' "Try it out" uses the same hosts.
|
|
48
|
+
mainnet: {
|
|
49
|
+
restUrl: "https://market-data.grvt.io",
|
|
50
|
+
wsUrl: "wss://market-data.grvt.io/ws/full",
|
|
51
|
+
explorerUrl: null,
|
|
52
|
+
signingChainId: null,
|
|
53
|
+
settlementChain: "offchain",
|
|
54
|
+
collateral: ["USDT"],
|
|
55
|
+
collateralAssetIndex: null,
|
|
56
|
+
rpcUrl: null,
|
|
57
|
+
depositPins: null,
|
|
58
|
+
},
|
|
59
|
+
testnet: {
|
|
60
|
+
restUrl: "https://market-data.testnet.grvt.io",
|
|
61
|
+
wsUrl: "wss://market-data.testnet.grvt.io/ws/full",
|
|
62
|
+
explorerUrl: null,
|
|
63
|
+
signingChainId: null,
|
|
64
|
+
settlementChain: "offchain",
|
|
65
|
+
collateral: ["USDT"],
|
|
66
|
+
collateralAssetIndex: null,
|
|
67
|
+
rpcUrl: null,
|
|
68
|
+
depositPins: null,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
// Per instrument: funding_interval_hours is 8 or 4 (live 2026-10-19: 124 × 8 h, 60 × 4 h).
|
|
72
|
+
fundingRateBasis: "perMarket",
|
|
73
|
+
settlementIntervalHours: "perMarket",
|
|
74
|
+
fundingVerified: false,
|
|
75
|
+
roles: ["marketData"],
|
|
76
|
+
// Not a release gate (nothing is implemented and switched off): the venue has no trading code yet.
|
|
77
|
+
gatedRoles: null,
|
|
78
|
+
capabilities: null,
|
|
79
|
+
// "All others" bucket (instruments, book, trade, funding, kline, margin_rules); the ticker bucket
|
|
80
|
+
// is GRVT_TICKER_RATE_LIMIT (grvt/client.ts picks per endpoint).
|
|
81
|
+
rateLimit: GRVT_OTHER_RATE_LIMIT,
|
|
82
|
+
// help.grvt.io/en/articles/9711621-restricted-jurisdictions (also Crimea / Donetsk / Luhansk /
|
|
83
|
+
// Kherson / Zaporizhzhya / Sevastopol regions). Trading needs KYC — relevant once trading lands.
|
|
84
|
+
restrictedRegions: ["US", "PR", "AS", "GU", "MP", "VI", "SG", "HK", "KP", "IR", "MM", "BY", "CU", "AF", "CA", "LY", "RU", "SO", "SS", "SD", "SY"],
|
|
85
|
+
symbolIdentity: "baseTicker",
|
|
86
|
+
publicData,
|
|
87
|
+
spot: null,
|
|
88
|
+
// Unused (no trading role); the field is required by the definition shape.
|
|
89
|
+
maxSlippageBps: 1,
|
|
90
|
+
builderFee: null,
|
|
91
|
+
apiStatus: { kind: "official" },
|
|
92
|
+
readOnlyRemediation: GRVT_READ_ONLY_REMEDIATION,
|
|
93
|
+
// A public-only adapter: market data works, every account / trading method refuses.
|
|
94
|
+
async create(ctx) {
|
|
95
|
+
const { GrvtPublicAdapter } = await import("../grvt/adapter.js");
|
|
96
|
+
return new GrvtPublicAdapter(grvtVenue, ctx.network);
|
|
97
|
+
},
|
|
98
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hyperliquid venue definition
|
|
2
|
+
* Hyperliquid venue definition.
|
|
3
3
|
* HIP-3 dexes are not venues: they are selected via VenueCreateContext.hlDex.
|
|
4
|
-
* Adapter + public-data code are loaded lazily
|
|
4
|
+
* Adapter + public-data code are loaded lazily.
|
|
5
5
|
*/
|
|
6
6
|
import type { Network, VenueDefinition } from "../venue.js";
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hyperliquid venue definition
|
|
2
|
+
* Hyperliquid venue definition.
|
|
3
3
|
* HIP-3 dexes are not venues: they are selected via VenueCreateContext.hlDex.
|
|
4
|
-
* Adapter + public-data code are loaded lazily
|
|
4
|
+
* Adapter + public-data code are loaded lazily.
|
|
5
5
|
*/
|
|
6
6
|
import { BUILDER_FEE_CAPABILITIES } from "../builder-fee.js";
|
|
7
7
|
/**
|
|
@@ -26,6 +26,15 @@ const publicData = {
|
|
|
26
26
|
async fetchMarkets(net) {
|
|
27
27
|
return (await import("../../funding/legacy-public.js")).legacyPublicData("hyperliquid").fetchMarkets(net);
|
|
28
28
|
},
|
|
29
|
+
// Keyless positions of any account by public address (account positions --address).
|
|
30
|
+
addressKind: "evm",
|
|
31
|
+
async fetchPositionsByAddress(net, address) {
|
|
32
|
+
return (await import("../public-positions.js")).hyperliquidPositionsByAddress(net, address);
|
|
33
|
+
},
|
|
34
|
+
// Keyless balances of any account by public address (account balance --address).
|
|
35
|
+
async fetchBalanceByAddress(net, address) {
|
|
36
|
+
return (await import("../public-balances.js")).hyperliquidBalanceByAddress(net, address);
|
|
37
|
+
},
|
|
29
38
|
};
|
|
30
39
|
export const hyperliquidVenue = {
|
|
31
40
|
id: "hyperliquid",
|
|
@@ -36,7 +45,7 @@ export const hyperliquidVenue = {
|
|
|
36
45
|
agentKeyKind: "evm",
|
|
37
46
|
secretStorage: { kind: "ows-wallet", dir: null },
|
|
38
47
|
// REST: src/exchanges/hyperliquid.ts; mainnet WS: src/dashboard/ws-feeds.ts.
|
|
39
|
-
// Testnet WS
|
|
48
|
+
// Testnet WS per the HL websocket docs (opened in the 2026-10-13 ws probe). signingChainId: L1 action phantom-agent domain (hyperliquid.ts).
|
|
40
49
|
networks: {
|
|
41
50
|
mainnet: {
|
|
42
51
|
restUrl: "https://api.hyperliquid.xyz",
|
|
@@ -51,7 +60,7 @@ export const hyperliquidVenue = {
|
|
|
51
60
|
},
|
|
52
61
|
testnet: {
|
|
53
62
|
restUrl: "https://api.hyperliquid-testnet.xyz",
|
|
54
|
-
wsUrl:
|
|
63
|
+
wsUrl: "wss://api.hyperliquid-testnet.xyz/ws",
|
|
55
64
|
explorerUrl: null,
|
|
56
65
|
signingChainId: 1337,
|
|
57
66
|
settlementChain: "hyperliquid",
|
|
@@ -65,11 +74,12 @@ export const hyperliquidVenue = {
|
|
|
65
74
|
settlementIntervalHours: 1,
|
|
66
75
|
fundingVerified: true,
|
|
67
76
|
roles: ["marketData", "account", "trading"],
|
|
68
|
-
|
|
77
|
+
gatedRoles: null,
|
|
78
|
+
// marketOrder: IOC limit at a protection price. Declared reference
|
|
69
79
|
// price = l2Book mid ((best bid + best ask) / 2) for native perps, HIP-3 and spot —
|
|
70
80
|
// no runtime substitute; a one-sided/empty book → PRICE_STALE. Rounding: 5 significant
|
|
71
81
|
// figures, max 6 − szDecimals (perp) / 8 − szDecimals (spot) decimals, toward crossing.
|
|
72
|
-
// tpsl stays "separateOrders": HL `normalTpsl` grouping was evaluated
|
|
82
|
+
// tpsl stays "separateOrders": HL `normalTpsl` grouping was evaluated and not
|
|
73
83
|
// used — its children have a fixed size equal to the parent and are fully cancelled when
|
|
74
84
|
// a partially filled parent is cancelled (HL docs, TP/SL orders), so a partially filled
|
|
75
85
|
// IOC entry would be left unprotected; separateOrders sizes TP/SL to the verified fill.
|
|
@@ -92,7 +102,7 @@ export const hyperliquidVenue = {
|
|
|
92
102
|
// HL docs "Rate limits and user limits": REST requests share an aggregated
|
|
93
103
|
// weight of 1200/min per IP. Exchange actions weigh 1 (unbatched); light info
|
|
94
104
|
// requests 2; most info requests 20; userRole 60.
|
|
95
|
-
// Declared only — per
|
|
105
|
+
// Declared only — per the limiter is applied to new venues + lighter-rh.
|
|
96
106
|
rateLimit: {
|
|
97
107
|
capacity: 1200,
|
|
98
108
|
refillPerSec: 20,
|
|
@@ -104,7 +114,7 @@ export const hyperliquidVenue = {
|
|
|
104
114
|
restrictedRegions: [],
|
|
105
115
|
symbolIdentity: "baseTicker",
|
|
106
116
|
publicData,
|
|
107
|
-
//
|
|
117
|
+
// spot USDC is shared with perp margin when the account is unified (isUnifiedAccount, read at init).
|
|
108
118
|
spot: {
|
|
109
119
|
accountModel: "runtime",
|
|
110
120
|
quoteAssets: { mainnet: ["USDC"], testnet: ["USDC"] },
|
|
@@ -122,5 +132,6 @@ export const hyperliquidVenue = {
|
|
|
122
132
|
},
|
|
123
133
|
maxSlippageBps: 5000,
|
|
124
134
|
builderFee: BUILDER_FEE_CAPABILITIES["hyperliquid"],
|
|
135
|
+
apiStatus: { kind: "official" },
|
|
125
136
|
create: async (ctx) => (await import("./create-helpers.js")).createHyperliquid(ctx),
|
|
126
137
|
};
|
|
@@ -10,7 +10,12 @@ import { lighterVenue } from "./lighter.js";
|
|
|
10
10
|
import { ondoVenue } from "./ondo.js";
|
|
11
11
|
import { pacificaVenue } from "./pacifica.js";
|
|
12
12
|
import { qfexVenue } from "./qfex.js";
|
|
13
|
-
|
|
13
|
+
import { risexVenue } from "./risex.js";
|
|
14
|
+
import { txflowVenue } from "./txflow.js";
|
|
15
|
+
import { variationalVenue } from "./variational.js";
|
|
16
|
+
import { grvtVenue } from "./grvt.js";
|
|
17
|
+
import { extendedVenue } from "./extended.js";
|
|
18
|
+
export declare const ALL_VENUES: readonly [import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition, import("../venue.js").VenueDefinition];
|
|
14
19
|
/** Idempotent: registers all venues on first call, no-op afterwards. */
|
|
15
20
|
export declare function ensureVenuesRegistered(): void;
|
|
16
|
-
export { pacificaVenue, hyperliquidVenue, lighterVenue, asterVenue, lighterRhVenue, ondoVenue, arcusVenue, qfexVenue, };
|
|
21
|
+
export { pacificaVenue, hyperliquidVenue, lighterVenue, asterVenue, lighterRhVenue, ondoVenue, arcusVenue, qfexVenue, risexVenue, txflowVenue, variationalVenue, grvtVenue, extendedVenue, };
|
|
@@ -11,9 +11,15 @@ import { lighterVenue } from "./lighter.js";
|
|
|
11
11
|
import { ondoVenue } from "./ondo.js";
|
|
12
12
|
import { pacificaVenue } from "./pacifica.js";
|
|
13
13
|
import { qfexVenue } from "./qfex.js";
|
|
14
|
+
import { risexVenue } from "./risex.js";
|
|
15
|
+
import { txflowVenue } from "./txflow.js";
|
|
16
|
+
import { variationalVenue } from "./variational.js";
|
|
17
|
+
import { grvtVenue } from "./grvt.js";
|
|
18
|
+
import { extendedVenue } from "./extended.js";
|
|
14
19
|
export const ALL_VENUES = [
|
|
15
20
|
pacificaVenue, hyperliquidVenue, lighterVenue, asterVenue,
|
|
16
|
-
lighterRhVenue, ondoVenue, arcusVenue, qfexVenue,
|
|
21
|
+
lighterRhVenue, ondoVenue, arcusVenue, qfexVenue, risexVenue, txflowVenue, variationalVenue, grvtVenue,
|
|
22
|
+
extendedVenue,
|
|
17
23
|
];
|
|
18
24
|
/** Idempotent: registers all venues on first call, no-op afterwards. */
|
|
19
25
|
export function ensureVenuesRegistered() {
|
|
@@ -23,4 +29,4 @@ export function ensureVenuesRegistered() {
|
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
ensureVenuesRegistered();
|
|
26
|
-
export { pacificaVenue, hyperliquidVenue, lighterVenue, asterVenue, lighterRhVenue, ondoVenue, arcusVenue, qfexVenue, };
|
|
32
|
+
export { pacificaVenue, hyperliquidVenue, lighterVenue, asterVenue, lighterRhVenue, ondoVenue, arcusVenue, qfexVenue, risexVenue, txflowVenue, variationalVenue, grvtVenue, extendedVenue, };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lighter-family constants shared by the `lighter` and `lighter-rh` venues
|
|
3
|
-
* (design §4 "Lighter RH" row, §10.3–§10.5, §10.8, §10.13 #4).
|
|
4
3
|
*
|
|
5
4
|
* Both venues run the same API/engine and the same LighterAdapter class; they
|
|
6
5
|
* differ only in the values below. This module has no runtime imports so venue
|
|
@@ -11,8 +10,7 @@ export type LighterVenueId = "lighter" | "lighter-rh";
|
|
|
11
10
|
/**
|
|
12
11
|
* Lighter (main). REST hosts are the values LighterAdapter used before
|
|
13
12
|
* venue-parameterization. Mainnet WS is the one ws-feeds.ts connects to.
|
|
14
|
-
* Testnet WS
|
|
15
|
-
* wss://testnet.zklighter.elliot.ai/stream answered 101 on 2026-09-30, but that is a probe, not a source).
|
|
13
|
+
* Testnet WS per apidocs.lighter.xyz websocket-reference (opened in the 2026-10-13 ws probe).
|
|
16
14
|
* explorerUrl is the explorer API host; callers append `/api/...`
|
|
17
15
|
* (lighter-spot.ts uses `${explorerUrl}/api/markets`). The testnet explorer host
|
|
18
16
|
* is the one lighter-ts-sdk documented (`https://testnet.explorer.elliot.ai/api`).
|
|
@@ -30,7 +28,8 @@ export declare const LIGHTER_NETWORKS: {
|
|
|
30
28
|
* explorerUrl is the explorer **API** host (`https://explorerapi.rh.lighter.xyz/api/`,
|
|
31
29
|
* rate-limits.md); no UI explorer URL is documented.
|
|
32
30
|
* Testnet WS is not documented → null (a WS upgrade on
|
|
33
|
-
* wss://api.rh-testnet.lighter.xyz/stream answered 101 on 2026-09-30
|
|
31
|
+
* wss://api.rh-testnet.lighter.xyz/stream answered 101 on 2026-09-30, but HTTP 403 from
|
|
32
|
+
* CloudFront in the 2026-10-13 ws probe).
|
|
34
33
|
* Testnet explorer is not documented → null.
|
|
35
34
|
* rpcUrl (mainnet): Robinhood Chain RPC — the L1 the RH contract lives on
|
|
36
35
|
* (GET /api/v1/layer1BasicInfo l1_providers chainId 4663; eth_chainId 0x1237 verified
|
|
@@ -46,22 +45,21 @@ export declare function lighterFamilyNetworks(venue: LighterVenueId): {
|
|
|
46
45
|
testnet: VenueNetworkConfig;
|
|
47
46
|
};
|
|
48
47
|
/**
|
|
49
|
-
*
|
|
48
|
+
* timeInForce lists the CLI inputs the adapter accepts:
|
|
50
49
|
* GTC is mapped to GTT (28-day expiry, LIGHTER_GTT_EXPIRY_MS) by LighterAdapter.limitOrder;
|
|
51
50
|
* ALO is sent as time-in-force 2 (POST_ONLY); FOK is not offered.
|
|
52
|
-
* clientOrderId
|
|
51
|
+
* clientOrderId: Lighter `clientOrderIndex`, a numeric id — CLI format rule
|
|
53
52
|
* in LIGHTER_CLIENT_ORDER_INDEX_MAX / lighterClientOrderIndex() (lighter.ts).
|
|
54
53
|
*/
|
|
55
54
|
export declare const LIGHTER_CAPABILITIES: VenueCapabilities;
|
|
56
55
|
/**
|
|
57
56
|
* GTC/GTT (and post-only) resting-order lifetime on both Lighter venues: orderExpiry -1 is
|
|
58
57
|
* resolved to now + 28 days by LighterWasmSigner (the venue allows 5 min – 30 days).
|
|
59
|
-
* Recorded as the execution record's expiry for GTC→GTT
|
|
58
|
+
* Recorded as the execution record's expiry for GTC→GTT.
|
|
60
59
|
*/
|
|
61
60
|
export declare const LIGHTER_GTT_EXPIRY_MS: number;
|
|
62
61
|
/**
|
|
63
|
-
* The ONE declared reference price for slippage-bounded orders on both Lighter venues
|
|
64
|
-
* (§13.10 #5): mid of best bid / best ask from `/api/v1/orderBookOrders`. Replaces
|
|
62
|
+
* The ONE declared reference price for slippage-bounded orders on both Lighter venues: mid of best bid / best ask from `/api/v1/orderBookOrders`. Replaces
|
|
65
63
|
* orderBookDetails `last_trade_price` (stale on thin RH stock books). No runtime
|
|
66
64
|
* substitute: a missing side → PRICE_STALE before anything is sent.
|
|
67
65
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lighter-family constants shared by the `lighter` and `lighter-rh` venues
|
|
3
|
-
* (design §4 "Lighter RH" row, §10.3–§10.5, §10.8, §10.13 #4).
|
|
4
3
|
*
|
|
5
4
|
* Both venues run the same API/engine and the same LighterAdapter class; they
|
|
6
5
|
* differ only in the values below. This module has no runtime imports so venue
|
|
@@ -9,8 +8,7 @@
|
|
|
9
8
|
/**
|
|
10
9
|
* Lighter (main). REST hosts are the values LighterAdapter used before
|
|
11
10
|
* venue-parameterization. Mainnet WS is the one ws-feeds.ts connects to.
|
|
12
|
-
* Testnet WS
|
|
13
|
-
* wss://testnet.zklighter.elliot.ai/stream answered 101 on 2026-09-30, but that is a probe, not a source).
|
|
11
|
+
* Testnet WS per apidocs.lighter.xyz websocket-reference (opened in the 2026-10-13 ws probe).
|
|
14
12
|
* explorerUrl is the explorer API host; callers append `/api/...`
|
|
15
13
|
* (lighter-spot.ts uses `${explorerUrl}/api/markets`). The testnet explorer host
|
|
16
14
|
* is the one lighter-ts-sdk documented (`https://testnet.explorer.elliot.ai/api`).
|
|
@@ -29,7 +27,7 @@ export const LIGHTER_NETWORKS = {
|
|
|
29
27
|
},
|
|
30
28
|
testnet: {
|
|
31
29
|
restUrl: "https://testnet.zklighter.elliot.ai",
|
|
32
|
-
wsUrl:
|
|
30
|
+
wsUrl: "wss://testnet.zklighter.elliot.ai/stream",
|
|
33
31
|
explorerUrl: "https://testnet.explorer.elliot.ai",
|
|
34
32
|
signingChainId: 300,
|
|
35
33
|
settlementChain: "ethereum",
|
|
@@ -48,7 +46,8 @@ export const LIGHTER_NETWORKS = {
|
|
|
48
46
|
* explorerUrl is the explorer **API** host (`https://explorerapi.rh.lighter.xyz/api/`,
|
|
49
47
|
* rate-limits.md); no UI explorer URL is documented.
|
|
50
48
|
* Testnet WS is not documented → null (a WS upgrade on
|
|
51
|
-
* wss://api.rh-testnet.lighter.xyz/stream answered 101 on 2026-09-30
|
|
49
|
+
* wss://api.rh-testnet.lighter.xyz/stream answered 101 on 2026-09-30, but HTTP 403 from
|
|
50
|
+
* CloudFront in the 2026-10-13 ws probe).
|
|
52
51
|
* Testnet explorer is not documented → null.
|
|
53
52
|
* rpcUrl (mainnet): Robinhood Chain RPC — the L1 the RH contract lives on
|
|
54
53
|
* (GET /api/v1/layer1BasicInfo l1_providers chainId 4663; eth_chainId 0x1237 verified
|
|
@@ -98,17 +97,17 @@ export function lighterFamilyNetworks(venue) {
|
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
/**
|
|
101
|
-
*
|
|
100
|
+
* timeInForce lists the CLI inputs the adapter accepts:
|
|
102
101
|
* GTC is mapped to GTT (28-day expiry, LIGHTER_GTT_EXPIRY_MS) by LighterAdapter.limitOrder;
|
|
103
102
|
* ALO is sent as time-in-force 2 (POST_ONLY); FOK is not offered.
|
|
104
|
-
* clientOrderId
|
|
103
|
+
* clientOrderId: Lighter `clientOrderIndex`, a numeric id — CLI format rule
|
|
105
104
|
* in LIGHTER_CLIENT_ORDER_INDEX_MAX / lighterClientOrderIndex() (lighter.ts).
|
|
106
105
|
*/
|
|
107
106
|
export const LIGHTER_CAPABILITIES = {
|
|
108
107
|
marketOrder: "slippageBounded",
|
|
109
108
|
// ALO → time-in-force 2 = POST_ONLY (apidocs trading.md; signed by the official lighter-go
|
|
110
109
|
// v1.0.9 WASM). Testnet confirmation that a crossing post-only is cancelled
|
|
111
|
-
// (canceled-post-only) is still pending
|
|
110
|
+
// (canceled-post-only) is still pending.
|
|
112
111
|
timeInForce: ["GTC", "GTT", "IOC", "ALO"],
|
|
113
112
|
reduceOnlyTif: null,
|
|
114
113
|
clientOrderId: true,
|
|
@@ -122,12 +121,11 @@ export const LIGHTER_CAPABILITIES = {
|
|
|
122
121
|
/**
|
|
123
122
|
* GTC/GTT (and post-only) resting-order lifetime on both Lighter venues: orderExpiry -1 is
|
|
124
123
|
* resolved to now + 28 days by LighterWasmSigner (the venue allows 5 min – 30 days).
|
|
125
|
-
* Recorded as the execution record's expiry for GTC→GTT
|
|
124
|
+
* Recorded as the execution record's expiry for GTC→GTT.
|
|
126
125
|
*/
|
|
127
126
|
export const LIGHTER_GTT_EXPIRY_MS = 28 * 24 * 60 * 60 * 1000;
|
|
128
127
|
/**
|
|
129
|
-
* The ONE declared reference price for slippage-bounded orders on both Lighter venues
|
|
130
|
-
* (§13.10 #5): mid of best bid / best ask from `/api/v1/orderBookOrders`. Replaces
|
|
128
|
+
* The ONE declared reference price for slippage-bounded orders on both Lighter venues: mid of best bid / best ask from `/api/v1/orderBookOrders`. Replaces
|
|
131
129
|
* orderBookDetails `last_trade_price` (stale on thin RH stock books). No runtime
|
|
132
130
|
* substitute: a missing side → PRICE_STALE before anything is sent.
|
|
133
131
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lighter RH venue definition
|
|
2
|
+
* Lighter RH venue definition.
|
|
3
3
|
* Same engine/adapter as Lighter; USDG collateral on the Robinhood chain.
|
|
4
|
-
* Master key = OWS wallet only (no env / raw-PK tier); referral off
|
|
4
|
+
* Master key = OWS wallet only (no env / raw-PK tier); referral off.
|
|
5
5
|
*/
|
|
6
6
|
import type { VenueDefinition } from "../venue.js";
|
|
7
7
|
export declare const lighterRhVenue: VenueDefinition;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lighter RH venue definition
|
|
2
|
+
* Lighter RH venue definition.
|
|
3
3
|
* Same engine/adapter as Lighter; USDG collateral on the Robinhood chain.
|
|
4
|
-
* Master key = OWS wallet only (no env / raw-PK tier); referral off
|
|
4
|
+
* Master key = OWS wallet only (no env / raw-PK tier); referral off.
|
|
5
5
|
*/
|
|
6
6
|
import { LIGHTER_RH_CAPABILITIES, LIGHTER_RH_NETWORKS, LIGHTER_RH_RATE_LIMIT } from "./lighter-family.js";
|
|
7
7
|
import { BUILDER_FEE_CAPABILITIES } from "../builder-fee.js";
|
|
@@ -9,8 +9,17 @@ const publicData = {
|
|
|
9
9
|
async fetchFundingRates(net) {
|
|
10
10
|
return (await import("../lighter-public.js")).lighterPublicData("lighter-rh").fetchFundingRates(net);
|
|
11
11
|
},
|
|
12
|
-
async fetchMarkets(net) {
|
|
13
|
-
return (await import("../lighter-public.js")).lighterPublicData("lighter-rh").fetchMarkets(net);
|
|
12
|
+
async fetchMarkets(net, opts) {
|
|
13
|
+
return (await import("../lighter-public.js")).lighterPublicData("lighter-rh").fetchMarkets(net, opts);
|
|
14
|
+
},
|
|
15
|
+
// Keyless positions of any account by public address (account positions --address).
|
|
16
|
+
addressKind: "evm",
|
|
17
|
+
async fetchPositionsByAddress(net, address, opts) {
|
|
18
|
+
return (await import("../public-positions.js")).lighterPositionsByAddress("lighter-rh", net, address, opts);
|
|
19
|
+
},
|
|
20
|
+
// Keyless balances of any account by public address (account balance --address).
|
|
21
|
+
async fetchBalanceByAddress(net, address, opts) {
|
|
22
|
+
return (await import("../public-balances.js")).lighterBalanceByAddress("lighter-rh", net, address, opts);
|
|
14
23
|
},
|
|
15
24
|
};
|
|
16
25
|
export const lighterRhVenue = {
|
|
@@ -22,18 +31,20 @@ export const lighterRhVenue = {
|
|
|
22
31
|
agentKeyKind: "lighter-l2",
|
|
23
32
|
secretStorage: { kind: "perp-keystore", dir: "lighter-rh-agents" },
|
|
24
33
|
networks: LIGHTER_RH_NETWORKS,
|
|
25
|
-
// "Lighter RH is the same API/engine as Lighter" → Lighter's basis/interval (
|
|
26
|
-
|
|
34
|
+
// "Lighter RH is the same API/engine as Lighter" → Lighter's basis/interval (live-data check pending).
|
|
35
|
+
// The market rows' fundingRate is the settled hourly rate (WS market_stats, lighter-public.ts).
|
|
36
|
+
fundingRateBasis: { kind: "perHours", hours: 1 },
|
|
27
37
|
settlementIntervalHours: 1,
|
|
28
38
|
fundingVerified: true,
|
|
29
39
|
roles: ["marketData", "account", "trading"],
|
|
40
|
+
gatedRoles: null,
|
|
30
41
|
capabilities: LIGHTER_RH_CAPABILITIES,
|
|
31
|
-
// Applied by the rate limiter (
|
|
42
|
+
// Applied by the rate limiter (new venues + lighter-rh).
|
|
32
43
|
rateLimit: LIGHTER_RH_RATE_LIMIT,
|
|
33
44
|
restrictedRegions: [],
|
|
34
45
|
symbolIdentity: "baseTicker",
|
|
35
46
|
publicData,
|
|
36
|
-
//
|
|
47
|
+
// per account (account_trading_mode, read by LighterSpotAdapter.init): Unified (1) shares
|
|
37
48
|
// the collateral between spot and perp (no transfer); Classic (0) = separate spot balance +
|
|
38
49
|
// self-transfer of the venue collateral.
|
|
39
50
|
spot: {
|
|
@@ -54,5 +65,6 @@ export const lighterRhVenue = {
|
|
|
54
65
|
},
|
|
55
66
|
maxSlippageBps: 5000,
|
|
56
67
|
builderFee: BUILDER_FEE_CAPABILITIES["lighter-rh"],
|
|
68
|
+
apiStatus: { kind: "official" },
|
|
57
69
|
create: async (ctx) => (await import("./create-helpers.js")).createLighterFamily("lighter-rh", ctx),
|
|
58
70
|
};
|