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
package/README.md
CHANGED
|
@@ -1,229 +1,155 @@
|
|
|
1
|
+
**English** | [한국어](README.ko.md) | [中文](README.zh.md) | [日本語](README.ja.md)
|
|
2
|
+
|
|
1
3
|
# perp-cli
|
|
2
4
|
|
|
3
5
|
[](https://www.npmjs.com/package/perp-cli)
|
|
4
6
|
[](https://www.npmjs.com/package/perp-cli)
|
|
5
7
|
[](https://github.com/hypurrquant/perp-cli/blob/main/LICENSE)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
One CLI for perpetual futures across many DEXs — trade, compare funding, move funds and run bots from the terminal, or hand it to an AI agent (JSON output, MCP server, agent skill).
|
|
10
|
+
|
|
11
|
+
- **Trade on 8 venues:** Hyperliquid (incl. HIP-3 dexes), Pacifica, Lighter, Lighter RH, Aster, Ondo Perps, Arcus, QFEX (bridge and perp-perp arb cover the original four: Pacifica, Hyperliquid, Lighter, Aster)
|
|
12
|
+
- **Market data only:** RISEx, GRVT, Extended, Variational, TxFlow (unofficial API) — plus Derive options data
|
|
13
|
+
|
|
14
|
+
## Install
|
|
8
15
|
|
|
9
16
|
```bash
|
|
10
|
-
npm install -g perp-cli
|
|
11
|
-
perp --
|
|
17
|
+
npm install -g perp-cli
|
|
18
|
+
perp --version
|
|
12
19
|
|
|
13
|
-
# Or without global install
|
|
20
|
+
# Or without a global install
|
|
14
21
|
npx -y perp-cli --json portfolio
|
|
15
22
|
```
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
The package ships three executables: `perp` (the CLI), `perp-mcp` (the [MCP server](docs/mcp.md), stdio) and `perp-guardrail` (the [signing guardrail](docs/guardrail.md)).
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
- **Funding Rate Arb** — perp-perp + spot-perp scan & one-command dual-leg execution
|
|
21
|
-
- **Portfolio** — single call returns balances, positions, risk level across all exchanges
|
|
22
|
-
- **Funds** — deposit, withdraw, transfer, multi-provider bridge (cctp/relay/debridge), inter-exchange rebalance — all in one group
|
|
23
|
-
- **Bots** — TWAP, grid, DCA, trailing-stop with background job management
|
|
24
|
-
- **Agent-First Design** — `--json`, `--fields`, `--ndjson`, `--dry-run`, runtime schema introspection
|
|
25
|
-
- **Safety** — pre-trade validation, response sanitization, client-id deduplication
|
|
26
|
+
## Quick start
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
**1. Look around — no keys needed.**
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
perp
|
|
33
|
-
pbpaste | OWS_PASSPHRASE="$PP" perp wallet set pac --name pac # Pacifica (Solana) — piped
|
|
34
|
-
# The active wallet serves every venue; one EVM key covers HL / Lighter / Aster.
|
|
35
|
-
# Lighter trading also needs: perp wallet agent approve lighter
|
|
36
|
-
|
|
37
|
-
# Or the interactive setup wizard (all 7 venues): picks / creates / imports an OWS
|
|
38
|
-
# vault wallet, network, venues, registers agent wallets (y/N confirmation before
|
|
39
|
-
# any signature — never moves funds), explains + sets the slippage bound, and the
|
|
40
|
-
# default venue. It never writes keys to ~/.perp/.env.
|
|
41
|
-
perp setup
|
|
42
|
-
|
|
43
|
-
# Scriptable (CI / agents) — writes settings only, signs nothing:
|
|
44
|
-
perp --json setup --non-interactive --wallet <ows-wallet> --venues hyperliquid,aster \
|
|
45
|
-
--network testnet --default-venue hyperliquid --slippage-bps 50 --slippage aster=80
|
|
46
|
-
# Add agent registration explicitly (Ondo key id + secret via stdin only):
|
|
47
|
-
OWS_PASSPHRASE=<pp> perp --json setup --non-interactive --wallet <ows-wallet> \
|
|
48
|
-
--venues hyperliquid,arcus --approve-agents --yes --arcus-account-index 0
|
|
49
|
-
|
|
50
|
-
# Verify
|
|
51
|
-
perp wallet show
|
|
31
|
+
perp -e hl market list # markets, prices, funding
|
|
32
|
+
perp -e hl market book BTC # order book
|
|
33
|
+
perp arb scan --rates # funding rates across venues
|
|
52
34
|
```
|
|
53
35
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
> **Lighter API Key Index:** Indexes 0–3 are reserved by Lighter's frontend (web/mobile). perp-cli defaults to index `4`. Override with `LIGHTER_API_KEY_INDEX` env var, or use `perp wallet agent approve lighter --api-key-index <n>` for managed agent slots. Valid range: 4–254.
|
|
57
|
-
|
|
58
|
-
### Lighter RH, Ondo Perps, Arcus
|
|
59
|
-
|
|
60
|
-
These venues have no `wallet set` private-key path — register an agent / API key instead:
|
|
36
|
+
**2. Add a wallet.** The setup wizard creates or imports an encrypted [OWS](https://github.com/open-wallet-standard) vault wallet, picks venues and registers agent keys (it asks before every signature and never moves funds):
|
|
61
37
|
|
|
62
38
|
```bash
|
|
63
|
-
perp
|
|
64
|
-
|
|
65
|
-
perp wallet agent approve arcus --master <ows-wallet> # Arcus Ed25519 API key (OWS wallet agent-arcus-<master>)
|
|
66
|
-
perp wallet agent verify [lighter-rh|ondo|arcus] # no venue = verify every configured venue
|
|
39
|
+
perp setup
|
|
40
|
+
perp wallet show
|
|
67
41
|
```
|
|
68
42
|
|
|
69
|
-
|
|
43
|
+
Keys are read from a hidden prompt or stdin — never from argv or `~/.perp/.env`. One EVM key covers Hyperliquid, Lighter and Aster. For other paths (one-line key import, scriptable setup, keys created on the exchange website) see [docs/setup.md](docs/setup.md).
|
|
70
44
|
|
|
71
|
-
|
|
72
|
-
on this machine; it is identified only by its public address. The key is read from a hidden prompt or
|
|
73
|
-
stdin (never argv) and **checked against the venue before anything is stored** — a refused check stores
|
|
74
|
-
nothing; a venue that cannot be checked without the master is reported as `unverified`, never as verified.
|
|
45
|
+
**3. Check your account and trade.** Add `-n testnet` to any command to use testnet.
|
|
75
46
|
|
|
76
47
|
```bash
|
|
77
|
-
perp
|
|
78
|
-
|
|
79
|
-
perp
|
|
80
|
-
perp
|
|
81
|
-
perp wallet agent import arcus --master-address 0xOWNER # Ed25519 key; public key listed ACTIVE for the owner
|
|
82
|
-
printf '%s\n%s\n' "$KEY_ID" "$SECRET" | perp wallet agent import ondo
|
|
83
|
-
printf '%s\n%s\n' "$PUBLIC_KEY" "$SECRET" | perp wallet agent import qfex --account-id <uuid> # QFEX: import only (keys are created on the website, 2FA)
|
|
84
|
-
perp wallet agent list # SOURCE column: approved | imported
|
|
85
|
-
|
|
86
|
-
# Setup without any master wallet: one stdin line per --import-agents venue, in order (ondo: 2 lines)
|
|
87
|
-
printf '%s\n%s\n' "$HL_AGENT_KEY" "$LT_KEY" | perp --json setup --non-interactive \
|
|
88
|
-
--venues hyperliquid,lighter --import-agents hyperliquid,lighter --yes \
|
|
89
|
-
--lighter-account-index 123 --lighter-api-key-index 5
|
|
48
|
+
perp --json portfolio # balances + positions + risk on every venue
|
|
49
|
+
perp --json --dry-run -e hl trade market BTC buy 0.001 # validate only, nothing is sent
|
|
50
|
+
perp --json -e hl trade market BTC buy 0.001 # market order (bounded by the slippage setting)
|
|
51
|
+
perp --json -e hl trade close BTC
|
|
90
52
|
```
|
|
91
53
|
|
|
92
|
-
|
|
93
|
-
approvals need the master**: without it they fail with `NO_SIGNER_AVAILABLE` ("do it on the exchange
|
|
94
|
-
website, or add the master with `perp wallet import`"). The CLI cannot revoke or rotate an imported key —
|
|
95
|
-
revoke it on the website; `perp wallet agent revoke <venue> <name> --local-only` removes the local copy,
|
|
96
|
-
and `wallet agent import <venue> --agent-name <name> --replace` swaps in a new website-created key.
|
|
97
|
-
`perp setup` offers the same choice per venue: approve with this computer's master wallet, or import a
|
|
98
|
-
website-created key (Step 1 can skip the master wallet).
|
|
54
|
+
## AI Agent Skill
|
|
99
55
|
|
|
100
|
-
|
|
56
|
+
Drop-in skill for Claude Code, Cursor, Codex, Gemini CLI, and other agent CLIs. Bundles a non-interactive command guide, ops playbook, strategy framework, and reusable shell scripts (preflight, arb monitor, validation) so your agent stops at the right confirmation points and never wedges on interactive wizards.
|
|
101
57
|
|
|
102
|
-
|
|
58
|
+
### Install
|
|
103
59
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
| Hyperliquid | `hyperliquid` (`hl`) | yes | HyperEVM; HIP-3 dexes via `--dex` |
|
|
108
|
-
| Lighter | `lighter` (`lt`) | yes | Ethereum L2 |
|
|
109
|
-
| Aster | `aster` (`ast`) | yes | BNB Chain; funding interval is per symbol |
|
|
110
|
-
| Lighter RH | `lighter-rh` (`lrh`, `rh`) | yes | Lighter engine on the Robinhood chain, USDG collateral |
|
|
111
|
-
| Ondo Perps | `ondo` (`ondo-perps`) | yes | Off-chain engine; limit TIF GTC (default) / IOC / ALO; restricted: US, PA |
|
|
112
|
-
| QFEX | `qfex` (`qf`) | yes (see **QFEX** below) | Custodial, off-chain engine; equities / indices / commodities, cross margin, USDC; limit TIF GTC (default) / IOC / FOK / ALO; testnet = QFEX UAT; restricted: US, GB, ES and others |
|
|
113
|
-
| Arcus | `arcus` | yes | Robinhood chain, USDG collateral; limit TIF GTC (default, sent as GTT) / IOC / FOK / ALO; restricted: US, CA, GB; **access whitelist** — unlisted addresses are rejected (request access at arcus.xyz) |
|
|
114
|
-
|
|
115
|
-
- **Time in force:** `trade limit` defaults to `GTC` on every venue (common names `GTC | IOC | FOK | ALO`; a TIF the venue does not offer → `CAPABILITY_UNSUPPORTED`). Lighter post-only (`ALO`) is disabled until verified on the venue.
|
|
116
|
-
- **TP/SL on an entry:** `trade market|buy|sell|limit ... --tp <px> --sl <px>` means the same on every venue — *protect this entry's verified fill*. The direction is checked before anything is sent (long: tp > reference > sl; short: the reverse; reference = mark for market entries, the limit price for limit entries). Ondo attaches the legs to the order; Arcus sends an entry+TP/SL batch; Hyperliquid / Lighter / Aster verify the entry fill, then place reduce-only TP/SL trigger orders sized to it (only market or `--tif IOC` entries — a resting entry → `CAPABILITY_UNSUPPORTED`); Pacifica verifies the fill, then sets position TP/SL (refused if the symbol already has a position or TP/SL — never overwritten). Entry outcome unknown → `ORDER_PENDING` and **no** TP/SL (the position may be unprotected); entry filled but a leg failed → `ORDER_PARTIAL` (not retryable) with the entry result and which legs were placed — do not re-enter, finish with `trade tpsl`.
|
|
117
|
-
- **TP/SL on a position:** `trade tpsl <SYM> <long|short> --tp <px> --sl <px> [--tp-limit <px>] [--size <n>]` — the argument is the **position's** side (buy/sell no longer accepted), checked against the live position; legs are reduce-only and sized to the live position (or `--size`).
|
|
118
|
-
- **Stop orders are reduce-only by default** on every venue (`trade stop`); pass `--no-reduce-only` to let a stop open or flip a position (refused on Ondo and QFEX, whose stops are always reduce-only). Lighter / Arcus market triggers execute as a limit at trigger ± the slippage bound (`--slippage-bps` or settings) and may stay unfilled in a fast move; other venues use native market triggers (`--slippage-bps` → `CAPABILITY_UNSUPPORTED`).
|
|
119
|
-
- **Order edit:** `trade edit` keeps the order's TIF. Pacifica: post-only (ALO) orders are edited natively; GTC / TOB orders placed by perp-cli (TIF recorded in the client order id) are cancelled and replaced with the remaining open size; orders whose TIF is unknown → `CAPABILITY_UNSUPPORTED` (pass `--tif`).
|
|
120
|
-
- **Slippage bound:** every market-type order (entry, close, spot) is bounded by one value: `--slippage-bps <n>` → `settings.slippageBps.<venue>` → `settings.defaultSlippageBps` (shipped default 50, shown in `perp settings show`; change with `perp settings set defaultSlippageBps <n>`). Values outside 1..venue max (Arcus 1000) are rejected before sending.
|
|
121
|
-
- **Restricted regions:** creating a signing adapter for a venue with restricted regions (Ondo, Arcus, QFEX) prints a one-time stderr notice; it never blocks — check the venue terms yourself.
|
|
122
|
-
- **Aggregate views** (`portfolio`, `account positions/orders`, `risk`, `history`, `wallet agent verify`, MCP `portfolio`) cover every account venue with configured credentials.
|
|
123
|
-
|
|
124
|
-
### What works — mainnet verification (2026-10-13)
|
|
125
|
-
|
|
126
|
-
Every mark below comes from a real-money mainnet run, not from code reading — at the venue minimum, with the per-venue cap raised to about $25–30 for multi-slice / multi-level checks and about $110 for the Hyperliquid TWAP. Details, evidence and the open issues: [`docs/MAINNET-VERIFICATION-STATUS.md`](docs/MAINNET-VERIFICATION-STATUS.md).
|
|
127
|
-
|
|
128
|
-
✅ verified live · ⛔ not supported (refused before anything is sent) · ❌ implemented but not run on mainnet yet · — not offered by the venue
|
|
129
|
-
|
|
130
|
-
| Feature | HL | HIP-3 `xyz` | Pacifica | Lighter | Lighter RH | Aster | Ondo | Arcus | QFEX |
|
|
131
|
-
|---|---|---|---|---|---|---|---|---|---|
|
|
132
|
-
| Market / limit (GTC, ALO, IOC), cancel, edit, close, reduce, flatten, status | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
133
|
-
| Entry `--tp/--sl`, `trade tpsl`, `trade stop` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
134
|
-
| Stop-limit | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ✅ | ⛔ |
|
|
135
|
-
| Resting reduce-only limit | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ✅ | ⛔ (IOC only) |
|
|
136
|
-
| Client order id (place / status / cancel) | ✅ | ✅ | ✅³ (UUID) | ✅ (numeric) | ✅ (numeric) | ✅ | ✅ | ✅ | generated ids only |
|
|
137
|
-
| Isolated margin (set, read back with a position, revert) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ (venue rejected with `-4050`, condition unknown) | ⛔ | ✅ | ⛔ |
|
|
138
|
-
| `trade scale-in` / `scale-tp` | ✅ | ✅ (position ≥ $20.5) | ✅ | ✅ | ✅ | ✅ | scale-in ✅ / scale-tp ⛔ — use partial `trade tpsl --size` ✅ | ✅ | scale-in ✅ / scale-tp ⛔ |
|
|
139
|
-
| `trade split` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
140
|
-
| `trade multi` (legs on several venues) | ✅ | ✅ (global `--dex xyz`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
141
|
-
| Native TWAP (`trade twap`) | ✅ | ❌ (HL minimum $100) | ✅ master-signed / ⛔ agent-signed | —² | —² | —² | —² | —² | —² |
|
|
142
|
-
| Client-side TWAP (`trade twap` on other venues, `strategy twap`, `--background`) | — | — | — | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ (automation gate) |
|
|
143
|
-
| `account margin` with a position | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
144
|
-
| Spot (`trade spot-*`) | ✅ | — | ✅ | ✅ | ✅ | ❌ (needs USDT) | ✅ | ❌ (needs an Arcus-issued key) | — |
|
|
145
|
-
| Deposit via perp-cli | ✅ | (HL) | ✅ | ✅ | ✅ | ✅ | ✅ | — (web app) | — (address only) |
|
|
146
|
-
| Withdraw | ❌ | (HL) | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
147
|
-
|
|
148
|
-
² perp-cli has no native TWAP for this venue: `trade twap` runs the client-side TWAP (slices) instead. Whether the venue's API offers one is not checked.
|
|
149
|
-
³ Verified in the session; no saved log file.
|
|
150
|
-
|
|
151
|
-
Automation, verified live (bounded runs at minimum size, stopped and flattened afterwards):
|
|
152
|
-
|
|
153
|
-
| Area | Verified |
|
|
154
|
-
|---|---|
|
|
155
|
-
| Arbitrage | `arb exec` / `status` / `close` on Aster–Arcus, Lighter–Arcus; `arb auto` (Lighter–HL); spot-perp `arb exec <sym> spot:hl pacifica` and `arb close`; `strategy funding-arb`, `quick-arb`, `funding-auto` (Pacifica–HL); `strategy delta-neutral` (HL spot + Pacifica perp) |
|
|
156
|
-
| Bots | `strategy grid` / `dca` / `trailing-stop` / `quick-grid` / `quick-dca` / `preset` (Aster); all 12 engine strategies via `strategy start <config>` (Aster); `strategy apex` (Aster) |
|
|
157
|
-
| Execution helpers | `strategy twap` (Aster), `trade twap --background` (Arcus), `strategy plan execute` (9 of 10 action types — `cancel_order` not run), `perp background stop` (graceful: orders cancelled, positions listed) |
|
|
158
|
-
| Hyperliquid HIP-4 outcomes | GTC place / cancel, IOC buy, `outcome sell --all` / `--size` |
|
|
60
|
+
```bash
|
|
61
|
+
# Claude Code — slash command
|
|
62
|
+
/install-skill hypurrquant/perp-cli
|
|
159
63
|
|
|
160
|
-
|
|
64
|
+
# Cursor / Codex / generic agent CLIs — via npx
|
|
65
|
+
npx skills add hypurrquant/perp-cli
|
|
161
66
|
|
|
162
|
-
|
|
67
|
+
# Manual install (any agent that reads a Skills directory)
|
|
68
|
+
git clone https://github.com/hypurrquant/perp-cli.git
|
|
69
|
+
cp -R perp-cli/skills/perp-cli ~/.claude/skills/ # or your CLI's skills dir
|
|
70
|
+
```
|
|
163
71
|
|
|
164
|
-
|
|
72
|
+
The skill ships inside the npm package (`perp-cli/skills/perp-cli`), so a global install also makes it available locally:
|
|
165
73
|
|
|
166
74
|
```bash
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
perp -e qfex trade limit AAPL buy 320 0.01 # GTC: "accepted" after the ACK; "open" once listed (trade status)
|
|
170
|
-
perp -e qfex trade market AAPL buy 0.01 # IOC LIMIT at mark ± slippage (never the venue's unbounded MARKET)
|
|
171
|
-
perp -e qfex trade status c:<id> --symbol AAPL # by the generated client order id
|
|
172
|
-
perp funds deposit qfex # prints the USDC / Arbitrum One deposit address; you send the funds
|
|
75
|
+
npm install -g perp-cli@latest
|
|
76
|
+
ls "$(npm root -g)/perp-cli/skills/perp-cli"
|
|
173
77
|
```
|
|
174
78
|
|
|
175
|
-
|
|
79
|
+
### What's in the skill
|
|
176
80
|
|
|
177
|
-
|
|
81
|
+
| File | Purpose |
|
|
82
|
+
|------|---------|
|
|
83
|
+
| `SKILL.md` | Top-level agent guide — rules, workflows, examples |
|
|
84
|
+
| `references/commands.md` | Full non-interactive command reference (every group) |
|
|
85
|
+
| `references/agent-operations.md` | Setup flows, idempotency, error handling, common mistakes |
|
|
86
|
+
| `references/strategies.md` | Funding-arb decision framework + risk management |
|
|
87
|
+
| `scripts/preflight.sh` | Install + wallet + connectivity + risk readiness check |
|
|
88
|
+
| `scripts/arb-monitor.sh` | Live monitor for open arb positions |
|
|
89
|
+
| `scripts/spot-perp-scan.sh` | Scan spot+perp opportunities with balance context |
|
|
90
|
+
| `scripts/funding-analysis.sh` | Cross-exchange funding overview / per-symbol drilldown |
|
|
91
|
+
| `scripts/validate-arb.sh` | Pre-execution validation (price / balance / risk / dry-run) |
|
|
178
92
|
|
|
179
|
-
|
|
180
|
-
|---|---|---|
|
|
181
|
-
| Resting reduce-only orders (`trade limit --reduce-only` with GTC / ALO, `trade scale-tp`) | Live: a resting reduce-only order **stays open after the position goes flat**; how the venue treats it if it later matches is unverified | Reduce-only IOC (`trade close` / `reduce`), or `trade stop` / `trade tpsl` |
|
|
182
|
-
| Stop-limit (`--tp-limit`, `trade stop` with a limit price) | The venue's stop orders convert to market orders when triggered | Stop-market |
|
|
183
|
-
| Stops that open or flip a position (`trade stop --no-reduce-only`) | QFEX stop orders only reduce a position | Reduce-only stops |
|
|
184
|
-
| `trade edit` of a reduce-only order | A reduce-only order is sized against the live position when placed; a modify would skip that check | `trade cancel`, then place again |
|
|
185
|
-
| `--client-id` | Client ids are not unique on the venue; perp-cli only trusts ids it generates | Omit it (the generated id is reported) |
|
|
186
|
-
| Markets not quoted in USD (`SKHYNIX-KRW`, …) | Sizing, risk limits and notionals assume USD | QFEX web app |
|
|
187
|
-
| Unattended automation on QFEX: bots, plans, TWAP, DCA, grid, funding arb, trailing stop, background jobs; QFEX in `arb scan` rankings | Automation is gated until verified (`QFEX_AUTOMATION_VERIFIED`); the funding rate's unit is unverified and equity funding accrues only part of the week (Q4) | Trade QFEX by hand; view funding only: `perp arb scan --rates --include-unverified` |
|
|
93
|
+
See [`skills/perp-cli/SKILL.md`](skills/perp-cli/SKILL.md) for the full agent guide.
|
|
188
94
|
|
|
189
|
-
|
|
95
|
+
## Features
|
|
190
96
|
|
|
191
|
-
|
|
97
|
+
- **Funding rate arb** — perp-perp and spot-perp scans, one-command dual-leg entry and exit
|
|
98
|
+
- **Portfolio** — one call returns balances, positions and risk across every venue
|
|
99
|
+
- **Funds** — deposit, withdraw, transfer, multi-provider bridge (CCTP / Relay / deBridge), inter-exchange rebalance
|
|
100
|
+
- **Bots** — TWAP, grid, DCA, trailing stop and more, with background job management
|
|
101
|
+
- **Agent-first** — `--json`, `--fields`, `--ndjson`, `--dry-run`, runtime schema introspection
|
|
102
|
+
- **Safety** — pre-trade validation, a slippage bound on every market order, client-id deduplication, response sanitization
|
|
192
103
|
|
|
193
|
-
|
|
104
|
+
## Venues
|
|
194
105
|
|
|
195
|
-
|
|
106
|
+
| Venue | `-e` | Trading | Chain / collateral |
|
|
107
|
+
|---|---|---|---|
|
|
108
|
+
| Hyperliquid | `hyperliquid` (`hl`) | ✅ | HyperEVM, USDC; HIP-3 dexes via `--dex` |
|
|
109
|
+
| Pacifica | `pacifica` (`pac`) | ✅ | Solana, USDC |
|
|
110
|
+
| Lighter | `lighter` (`lt`) | ✅ | Ethereum L2, USDC |
|
|
111
|
+
| Lighter RH | `lighter-rh` (`lrh`) | ✅ | Robinhood chain, USDG |
|
|
112
|
+
| Aster | `aster` (`ast`) | ✅ | BNB Chain, USDT / USDC |
|
|
113
|
+
| Ondo Perps | `ondo` | ✅ | off-chain, USDC |
|
|
114
|
+
| Arcus | `arcus` | ✅ (access whitelist) | Robinhood chain, USDG |
|
|
115
|
+
| QFEX | `qfex` (`qf`) | ✅ (manual trading only) | custodial; equities, indices, commodities |
|
|
116
|
+
| RISEx | `risex` | read-only | RISE chain, USDC |
|
|
117
|
+
| GRVT | `grvt` | market data only | USDT |
|
|
118
|
+
| Extended | `extended` (`ext`) | market data only | Starknet; crypto + equities / FX |
|
|
119
|
+
| Variational | `variational` (`var`) | market data only | RFQ venue |
|
|
120
|
+
| TxFlow | `txflow` (`txf`) | market data only | **unofficial** API |
|
|
121
|
+
| Derive | `derive` | options data only | — |
|
|
122
|
+
|
|
123
|
+
- **[Support matrix and per-venue notes](docs/venues.md)** — funding, WebSocket, deposit / withdraw, lookups by address, restricted regions
|
|
124
|
+
- **[Mainnet verification](docs/verification.md)** — which features have been run with real money
|
|
125
|
+
- **[Trading details](docs/trading.md)** — time in force, TP/SL, stops, slippage, spot trading, builder fees
|
|
126
|
+
|
|
127
|
+
## Common commands
|
|
196
128
|
|
|
197
|
-
|
|
129
|
+
```bash
|
|
130
|
+
# Market data
|
|
131
|
+
perp --json -e <EX> market list | book <SYM> | funding <SYM> | kline <SYM> 1h
|
|
198
132
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
| Aster | separate (`sapi` spot account) | USDT, USD1 (bare base → USDT) | yes | yes |
|
|
204
|
-
| Pacifica | **unified** — spot shares the perp account | USDC | yes | no (not needed) |
|
|
205
|
-
| Ondo Perps | separate (spot wallet ↔ margin) | USDC | yes | yes |
|
|
206
|
-
| Arcus | **wallet** — on-chain swaps from your master EVM wallet (router, Permit2) | USDG | no (market swaps only) | no |
|
|
133
|
+
# Trading
|
|
134
|
+
perp --json -e <EX> trade buy <SYM> <SIZE> --tp <PX> --sl <PX> # entry protected by TP/SL
|
|
135
|
+
perp --json -e <EX> trade limit <SYM> buy <PX> <SIZE>
|
|
136
|
+
perp --json -e <EX> trade close <SYM> # or: flatten (every position)
|
|
207
137
|
|
|
208
|
-
|
|
209
|
-
perp --json
|
|
210
|
-
perp --json -e <EX>
|
|
211
|
-
perp --json
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
perp --json
|
|
215
|
-
perp --json
|
|
138
|
+
# Account
|
|
139
|
+
perp --json portfolio
|
|
140
|
+
perp --json -e <EX> account positions
|
|
141
|
+
perp --json account balance --address <ADDR> # any account, keyless
|
|
142
|
+
|
|
143
|
+
# Funding arb
|
|
144
|
+
perp --json arb scan --min 5
|
|
145
|
+
perp --json arb exec <SYM> <longEx> <shortEx> <USD>
|
|
146
|
+
|
|
147
|
+
# Funds
|
|
148
|
+
perp --json funds deposit hyperliquid 100
|
|
149
|
+
perp --json funds bridge send --from solana --to arbitrum --amount 100
|
|
216
150
|
```
|
|
217
151
|
|
|
218
|
-
|
|
219
|
-
- **`spot-transfer` on a shared-balance account** (Pacifica, Hyperliquid unified) succeeds as a no-op with `execution.method: "sharedAccount"` (nothing needs to move); a real move reports `execution.method: "transfer"`.
|
|
220
|
-
- **Slippage:** same rule as perps — `--slippage-bps <n>` → `settings.slippageBps.<venue>` → `settings.defaultSlippageBps` (shipped 50).
|
|
221
|
-
- **Pacifica:** spot buys spend the shared USDC perp margin and reduce perp available margin (a warning is printed before the first buy). Pacifica `getMarkets()` (perp) no longer lists the `SOL-USDC` spot market.
|
|
222
|
-
- **Aster:** an agent signer needs spot permission — `perp wallet agent rotate aster --can-spot` (or `perp wallet agent approve aster --can-spot`); otherwise spot orders fail with `POLICY_DENIED`.
|
|
223
|
-
- **Arcus:** swaps go through `router.spot.arcus.xyz` and settle on the Robinhood chain from the master EVM wallet (`--ows` / active OWS wallet; none → `NO_SIGNER_AVAILABLE`). Spot needs only the master wallet — no Arcus perp agent key; perp orders / account reads without one fail with `AGENT_NOT_REGISTERED` (`perp wallet agent approve arcus`). Listing Arcus spot markets is slow (~80 s, one router `/price` per token) — use `spot-buy` / `spot-sell` directly. Tokens without EIP-2612 permit need a one-time on-chain `approve(Permit2)` that costs Robinhood Chain ETH gas — pass `--yes` to allow it. Results show `status`, `finality`, `receivedToken` and a remediation; a `pending` result means the swap was submitted — **do not resubmit**.
|
|
224
|
-
- **Results:** spot orders print the normalized result (status, finality, filled size, average price, received token, remediation). `spot-buy` / `spot-sell` add an `execution` record on every venue (method, slippage bps + source, protection price and reference where the venue path computes one). `spot-cancel` returns one `SpotOrderResult` shape on every venue (a Lighter cancel is `pending` until `spot-orders` confirms it); `spot-orders` lists the same columns on every venue (Hyperliquid included).
|
|
225
|
-
- **Portfolio / landing:** spot value is added on top of perp equity except balances marked `shared` (Pacifica USDC, Hyperliquid unified USDC). Tokens without a spot price are excluded from totals with a stderr warning (never valued at 0).
|
|
226
|
-
- **Bots and arb** (`funding-arb`, `spot-perp-arb`, `arb exec spot:<venue>`, `arb close`, `arb scan --mode spot-perp`) only use spot venues with a separate (or runtime) spot balance **and** a spot↔perp transfer: hyperliquid, lighter, lighter-rh, aster, ondo. Pacifica (shared margin) and Arcus (on-chain swaps) are refused with `CAPABILITY_UNSUPPORTED`; trade them manually with `trade spot-*`.
|
|
152
|
+
Full list with every group: **[docs/commands.md](docs/commands.md)**. Global flags: `--json`, `--fields <f>`, `--ndjson`, `--dry-run`, `-n testnet`, `-e <venue>`, `--dex <name>` (HIP-3), `-w, --wallet <name>`.
|
|
227
153
|
|
|
228
154
|
## Command Groups
|
|
229
155
|
|
|
@@ -233,13 +159,16 @@ perp --json -e <EX> trade spot-balance
|
|
|
233
159
|
| `account` | Balance, positions, orders, margin |
|
|
234
160
|
| `trade` | Market/limit/stop orders, close, scale, split execution |
|
|
235
161
|
| `outcome` | Hyperliquid Outcome (HIP-4) — binary/range contracts, quoted per outcome (outcomeMeta `quoteToken`, USDC today), no leverage |
|
|
162
|
+
| `options` | Options market data, read-only (Derive: `-e derive options underlyings / expiries / chain / quote`) |
|
|
163
|
+
| `print` | Pacifica Print — strike orders earning a premium per cycle: games, quote, positions, history, events, deposit / cancel (`--dry-run`) |
|
|
164
|
+
| `vault` | Pacifica vaults (API: lakes) — list, info, positions, deposit (master wallet only) / withdraw (`--dry-run`) |
|
|
236
165
|
| `arb` | Funding rate arb — scan, exec, close, monitor (perp-perp & spot-perp) |
|
|
237
166
|
| `strategy` | 19 bot algorithms (grid, dca, twap, APEX, REFLECT, presets) + nested scripted plans |
|
|
238
167
|
| `funds` | Deposit, withdraw, transfer, cross-chain bridge (multi-provider), inter-exchange rebalance |
|
|
239
168
|
| `risk` | Risk limits, liquidation distance, guardrails |
|
|
240
169
|
| `wallet` | Multi-wallet management, agent wallets (`wallet agent ...`), builder fees (`wallet builder ...`, off by default), margin mode / subaccount / API keys (`wallet manage ...`), on-chain balances |
|
|
241
170
|
| `history` | Execution log, PnL, performance breakdown |
|
|
242
|
-
| `portfolio` | Cross-exchange unified overview (replaces former `account balance` / `status` / `dashboard`) |
|
|
171
|
+
| `portfolio` | Cross-exchange unified overview (replaces former `account balance` / `status` / `dashboard`; `account balance --address` reads any account's balances, keyless) |
|
|
243
172
|
| `health` | Adapter health check: ping every venue's REST endpoint (connectivity + latency) |
|
|
244
173
|
| `settings` | CLI settings (referrals, defaults, fees, builder fees, deBridge affiliate) |
|
|
245
174
|
| `backtest` | Strategy backtesting |
|
|
@@ -247,165 +176,38 @@ perp --json -e <EX> trade spot-balance
|
|
|
247
176
|
| `alerts` | Funding rate alerts (Telegram / Discord) with background daemon |
|
|
248
177
|
| `setup` | Setup wizard: OWS wallet, venues, agent wallets, slippage, default venue (alias: `init`; `--non-interactive` for scripts) |
|
|
249
178
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
perp-cli attaches **no** builder fee unless you configure one and the venue approval is confirmed:
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
perp settings set builder.hyperliquid 0xBuilder…,1 # <address|code>,<feeBps> — strict: format, venue cap; asks y/N (or --yes)
|
|
256
|
-
perp wallet builder status # per venue: supported? configured? approved? attached?
|
|
257
|
-
perp --dry-run wallet builder approve hyperliquid # plan only
|
|
258
|
-
perp wallet builder approve hyperliquid # master-signed, asks y/N (or --yes)
|
|
259
|
-
perp --no-builder trade market BTC buy 0.1 # skip it for one command
|
|
260
|
-
perp settings unset builder.hyperliquid # off again
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
Supported: hyperliquid (≤ 10 bps, not on HIP-3 dexes), pacifica (≤ 10 bps max, not on spot), aster (≤ 10 bps, mainnet), ondo (≤ 10 bps, no approval step), qfex (`perp settings set builder.qfex <uuid>` — a **fee share**: your fills are attributed to the builder code and you pay the normal fee, nothing extra; the code rides on the trading connection; mainnet only). Lighter / Lighter RH / Arcus: unsupported. If the approval is missing or cannot be read, the order is sent **without** the fee and the result's `execution.notes` says why; `execution.builderFee` shows what was attached.
|
|
179
|
+
## Agent-First CLI Design
|
|
264
180
|
|
|
265
|
-
|
|
181
|
+
Built following [agent-first CLI principles](https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-agents/):
|
|
266
182
|
|
|
267
183
|
```bash
|
|
268
|
-
#
|
|
184
|
+
# Every command returns structured JSON envelope
|
|
269
185
|
perp --json portfolio
|
|
186
|
+
# → { "ok": true, "data": {...}, "meta": { "timestamp": "..." } }
|
|
270
187
|
|
|
271
|
-
#
|
|
272
|
-
perp --json
|
|
273
|
-
perp --json -e <EX> market book <SYM>
|
|
274
|
-
perp --json -e <EX> market mid <SYM> # fast mid-price lookup
|
|
275
|
-
perp --json -e <EX> market funding <SYM>
|
|
276
|
-
perp --json -e <EX> market kline <SYM> 1h # candlestick data
|
|
277
|
-
perp --json -e hl market hip3 # list HIP-3 deployed dexes
|
|
278
|
-
|
|
279
|
-
# Trading
|
|
280
|
-
perp --json -e <EX> trade buy <SYM> <SIZE> # shortcut for market buy
|
|
281
|
-
perp --json -e <EX> trade sell <SYM> <SIZE> # shortcut for market sell
|
|
282
|
-
perp --json -e <EX> trade market <SYM> buy <SIZE> --smart # IOC limit (less slippage)
|
|
283
|
-
perp --json -e <EX> trade split <SYM> buy 5000 # orderbook-aware split (large orders)
|
|
284
|
-
perp --json -e <EX> trade close <SYM>
|
|
285
|
-
perp --json -e <EX> trade flatten # close ALL positions on exchange
|
|
286
|
-
perp --json -e <EX> trade reduce <SYM> 50 # reduce position by 50%
|
|
287
|
-
perp --json -e <EX> trade cancel <SYM> # cancel by symbol (or orderId)
|
|
288
|
-
perp --json -e <EX> trade buy <SYM> <SIZE> --tp <PX> --sl <PX> # entry protected by TP/SL
|
|
289
|
-
perp --json -e <EX> trade tpsl <SYM> long --tp <PX> --sl <PX> # TP/SL on an open position (long|short)
|
|
290
|
-
perp --json -e <EX> trade stop <SYM> sell <SIZE> <PX> # reduce-only stop (default)
|
|
291
|
-
perp --json -e <EX> trade leverage <SYM> <N>
|
|
292
|
-
|
|
293
|
-
# Account
|
|
294
|
-
perp --json portfolio -e <EX> # balance + spot + positions (account balance was renamed in v0.12)
|
|
295
|
-
perp --json -e <EX> account positions
|
|
296
|
-
perp --json -e <EX> account pnl # realized + unrealized + funding
|
|
297
|
-
perp --json -e <EX> account funding # personal funding payment history
|
|
298
|
-
perp --json -e <EX> account settings # per-market leverage & margin mode
|
|
299
|
-
|
|
300
|
-
# Outcome markets (Hyperliquid HIP-4 — fully-collateralized binary contracts, quote token per outcome (USDC today), min 10 quote tokens)
|
|
301
|
-
perp --json outcome list # active markets + Yes/No mid prices
|
|
302
|
-
perp --json outcome view <outcome> # symmetric Yes/No book + underlying gap + expiry
|
|
303
|
-
perp --json outcome book <outcome> <side> # one-side orderbook (e.g. '1 yes' or '1 0')
|
|
304
|
-
perp --json outcome positions # open outcome holdings
|
|
305
|
-
perp --json outcome orders # open outcome orders
|
|
306
|
-
perp --json outcome buy <outcome> <side> <usd> --dry-run # validate before submit
|
|
307
|
-
perp --json outcome buy <outcome> <side> <usd> # market buy, notional in the outcome's quote token
|
|
308
|
-
perp --json outcome sell <outcome> <side> <usd> --limit <px> --tif gtc
|
|
309
|
-
perp --json outcome cancel <outcome> <side> <oid>
|
|
310
|
-
|
|
311
|
-
# Funding rate arbitrage
|
|
312
|
-
perp --json arb scan --min 5 # perp-perp opportunities
|
|
313
|
-
perp --json arb scan --mode spot-perp # spot+perp opportunities
|
|
314
|
-
perp --json arb scan --rates # funding rates across all exchanges
|
|
315
|
-
perp --json arb scan --basis # cross-exchange basis opportunities
|
|
316
|
-
perp --json arb scan --gaps # cross-exchange price gaps
|
|
317
|
-
perp --json arb scan --hip3 # HIP-3 cross-dex funding spreads
|
|
318
|
-
perp --json arb scan --live # continuous live monitoring
|
|
319
|
-
perp --json arb exec <SYM> <longEx> <shortEx> <$> # perp-perp dual-leg entry
|
|
320
|
-
perp --json arb exec <SYM> spot:<exch> <perpEx> <$> # spot+perp entry
|
|
321
|
-
perp --json arb config # show arb defaults
|
|
322
|
-
perp --json arb history # past arb trade performance (alias: log)
|
|
323
|
-
|
|
324
|
-
# Funds (deposit, withdraw, transfer, bridge, rebalance)
|
|
325
|
-
perp --json funds deposit hyperliquid 100
|
|
326
|
-
perp --json funds withdraw pacifica 50
|
|
327
|
-
perp --json funds deposit lighter-rh 10 # USDG on Robinhood Chain (approve + deposit, mainnet)
|
|
328
|
-
perp --json -e lighter-rh funds withdraw lighter 10 # USDG → Robinhood Chain
|
|
329
|
-
perp --json --dry-run funds withdraw ondo 10 --to <ADDRESS> # plan only, nothing sent
|
|
330
|
-
perp --json funds deposit aster 8 # USDT → Aster vault on BNB Chain (--chain arbitrum / --asset USDC; mainnet)
|
|
331
|
-
perp --json funds withdraw aster 8 --chain bsc # USDT → your own address (agent needs --can-withdraw --ip-whitelist)
|
|
332
|
-
perp --json funds deposit ondo 12 --probe 2 # USDC transfer to your Ondo funding address (Arbitrum; --chain ethereum)
|
|
333
|
-
perp --json funds address-book add ondo <MASTER_ADDR> # SIWE challenge → Ondo withdrawal address book
|
|
334
|
-
perp --json funds withdraw arcus 10 # to the Arcus account owner
|
|
335
|
-
perp --json funds transfer 100 <ADDRESS> # HL internal transfer (instant)
|
|
336
|
-
perp --json funds bridge quote --from solana --to arbitrum --amount 100
|
|
337
|
-
perp --json funds bridge send --from solana --to arbitrum --amount 100 # auto-cheapest provider
|
|
338
|
-
perp --json --dry-run funds bridge send --from robinhood --to solana --from-asset USDG --to-asset SOL --amount 15 # Relay quote only
|
|
339
|
-
perp --json funds bridge send --from robinhood --to bsc --from-asset USDG --to-asset USDT --amount 15 # Relay swap, OWS master signs
|
|
340
|
-
perp --json funds bridge exchange --from pacifica --to hyperliquid --amount 100
|
|
341
|
-
perp --json funds rebalance check # balances across exchanges
|
|
342
|
-
perp --json funds rebalance plan # compute optimal moves
|
|
343
|
-
perp --json funds rebalance execute --auto-bridge # withdraw → bridge → deposit
|
|
344
|
-
perp --json funds info # all routes & limits
|
|
345
|
-
|
|
346
|
-
# Risk
|
|
347
|
-
perp --json risk limits --max-leverage 5
|
|
348
|
-
perp --json risk liquidation-distance
|
|
349
|
-
|
|
350
|
-
# Strategies (19 bot algorithms + nested scripted plans)
|
|
351
|
-
perp strategy list-strategies # list all available strategies
|
|
352
|
-
perp strategy run <strategy> [symbol] # run any strategy
|
|
353
|
-
perp strategy apex [symbol] # APEX autonomous orchestrator
|
|
354
|
-
perp strategy reflect # trading performance analysis
|
|
355
|
-
perp strategy preset-list # list strategy presets
|
|
356
|
-
perp --json strategy twap <SYM> buy <SIZE> 30m
|
|
357
|
-
perp --json strategy grid <SYM> --range 5 --grids 10 --size 100
|
|
358
|
-
perp strategy plan example # scripted multi-step plan format
|
|
359
|
-
perp --json strategy plan validate <FILE> # validate scripted plan
|
|
360
|
-
perp --json strategy plan execute <FILE> --dry-run # dry-run scripted plan
|
|
361
|
-
|
|
362
|
-
# Background process supervisor (tmux)
|
|
363
|
-
perp background list # list running jobs
|
|
364
|
-
perp background stop <ID> # stop a job
|
|
365
|
-
perp background logs <ID> -f # follow logs
|
|
366
|
-
# Jobs inherit -n, --dry-run, -e, --ows, -w, --no-agent, --dex and never receive keys via argv/env:
|
|
367
|
-
# they read the OWS vault / agent keystores / ~/.perp/.env themselves. -k, --passphrase, --ows-key or a
|
|
368
|
-
# shell-exported key / OWS_PASSPHRASE is refused — register an agent (perp wallet agent approve <venue>).
|
|
369
|
-
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
## Telegram Alerts
|
|
373
|
-
|
|
374
|
-
Funding rate alerts via Telegram with background daemon support.
|
|
375
|
-
|
|
376
|
-
```bash
|
|
377
|
-
# Interactive setup (BotFather token + chat ID auto-detection)
|
|
378
|
-
perp alerts setup
|
|
188
|
+
# Filter output to specific fields (saves tokens)
|
|
189
|
+
perp --json --fields totalEquity,risk portfolio
|
|
379
190
|
|
|
380
|
-
#
|
|
381
|
-
perp
|
|
382
|
-
perp alerts add --all 50 # alert for any symbol > 50%
|
|
191
|
+
# Stream large lists as NDJSON (one JSON per line)
|
|
192
|
+
perp --json --ndjson -e hl market list
|
|
383
193
|
|
|
384
|
-
#
|
|
385
|
-
perp
|
|
386
|
-
perp
|
|
194
|
+
# Pre-validate before executing
|
|
195
|
+
perp --json -e hl trade check BTC buy 0.01
|
|
196
|
+
perp --json --dry-run -e hl trade market BTC buy 0.01
|
|
387
197
|
|
|
388
|
-
#
|
|
389
|
-
perp
|
|
390
|
-
perp
|
|
391
|
-
perp alerts stop # stop background daemon
|
|
198
|
+
# Idempotent orders with client ID (Hyperliquid: a 128-bit cloid, 0x + 32 hex; --auto-id generates one)
|
|
199
|
+
perp --json -e hl trade market BTC buy 0.01 --client-id 0x1234567890abcdef1234567890abcdef
|
|
200
|
+
perp --json -e hl trade status c:0x1234567890abcdef1234567890abcdef
|
|
392
201
|
```
|
|
393
202
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
Exchange flag: `-e hyperliquid` / `-e pacifica` / `-e lighter` / `-e aster` (aliases: `hl`, `pac`, `lt`).
|
|
397
|
-
|
|
398
|
-
Global flags: `--json`, `--fields <f>`, `--ndjson`, `--dry-run`, `--dex <name>` (HIP-3), `-w, --wallet <name>`.
|
|
203
|
+
All responses are auto-sanitized (control chars stripped, prompt injection patterns blocked).
|
|
204
|
+
Errors include `retryable` flag — only retry when `true`.
|
|
399
205
|
|
|
400
206
|
## MCP Server
|
|
401
207
|
|
|
402
208
|
[](https://glama.ai/mcp/servers/hypurrquant/perp-cli)
|
|
403
209
|
|
|
404
|
-
perp-
|
|
405
|
-
|
|
406
|
-
**No API keys required for market data** — explore prices, orderbooks, funding rates, and arb opportunities without any setup. Add keys only when you want to trade.
|
|
407
|
-
|
|
408
|
-
**Network:** set `PERP_NETWORK=testnet` in the server env to serve testnet (validated; unset = mainnet); every result reports `meta.network`. `trade_execute` / `trade_close` place real orders through the same local risk gate as `perp trade` (no override over MCP), refuse non-reduce-only orders on quarantined symbols, and are written to the execution log.
|
|
210
|
+
`perp-mcp` serves 31 tools to Claude Desktop, Cursor and other MCP clients. Market data needs no keys; for account and trading tools run `perp setup` first (the server reads the same wallet). Never put private keys in the MCP config.
|
|
409
211
|
|
|
410
212
|
```json
|
|
411
213
|
{
|
|
@@ -418,90 +220,21 @@ perp-cli includes a full-featured MCP server (18 tools, 3 resources, 2 prompts)
|
|
|
418
220
|
}
|
|
419
221
|
```
|
|
420
222
|
|
|
421
|
-
|
|
422
|
-
```json
|
|
423
|
-
{
|
|
424
|
-
"env": {
|
|
425
|
-
"PERP_NETWORK": "testnet"
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
**Read-only tools (no keys):** `get_markets`, `get_orderbook`, `get_funding_rates`, `get_prices`, `arb_scan`, `health_check`
|
|
431
|
-
|
|
432
|
-
**Account & trading tools (keys required):** `get_balance`, `get_positions`, `portfolio`, `trade_preview`, `trade_execute`, `trade_close`, `get_funding_analysis`, `get_pnl_analysis`, `get_arb_compare`
|
|
433
|
-
|
|
434
|
-
**Resources:** `market://prices`, `market://funding-rates`, `perp://schema`
|
|
223
|
+
Testnet, the full tool list, resources and prompts: **[docs/mcp.md](docs/mcp.md)**.
|
|
435
224
|
|
|
436
|
-
|
|
225
|
+
## Documentation
|
|
437
226
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
/
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
npx skills add hypurrquant/perp-cli
|
|
450
|
-
|
|
451
|
-
# Manual install (any agent that reads a Skills directory)
|
|
452
|
-
git clone https://github.com/hypurrquant/perp-cli.git
|
|
453
|
-
cp -R perp-cli/skills/perp-cli ~/.claude/skills/ # or your CLI's skills dir
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
The skill ships inside the npm package (`perp-cli/skills/perp-cli`), so a global install also makes it available locally:
|
|
457
|
-
|
|
458
|
-
```bash
|
|
459
|
-
npm install -g perp-cli@latest
|
|
460
|
-
ls "$(npm root -g)/perp-cli/skills/perp-cli"
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
### What's in the skill
|
|
464
|
-
|
|
465
|
-
| File | Purpose |
|
|
466
|
-
|------|---------|
|
|
467
|
-
| `SKILL.md` | Top-level agent guide — rules, workflows, examples |
|
|
468
|
-
| `references/commands.md` | Full non-interactive command reference (every group) |
|
|
469
|
-
| `references/agent-operations.md` | Setup flows, idempotency, error handling, common mistakes |
|
|
470
|
-
| `references/strategies.md` | Funding-arb decision framework + risk management |
|
|
471
|
-
| `scripts/preflight.sh` | Install + wallet + connectivity + risk readiness check |
|
|
472
|
-
| `scripts/arb-monitor.sh` | Live monitor for open arb positions |
|
|
473
|
-
| `scripts/spot-perp-scan.sh` | Scan spot+perp opportunities with balance context |
|
|
474
|
-
| `scripts/funding-analysis.sh` | Cross-exchange funding overview / per-symbol drilldown |
|
|
475
|
-
| `scripts/validate-arb.sh` | Pre-execution validation (price / balance / risk / dry-run) |
|
|
476
|
-
|
|
477
|
-
See [`skills/perp-cli/SKILL.md`](skills/perp-cli/SKILL.md) for the full agent guide.
|
|
478
|
-
|
|
479
|
-
## Agent-First CLI Design
|
|
480
|
-
|
|
481
|
-
Built following [agent-first CLI principles](https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-agents/):
|
|
482
|
-
|
|
483
|
-
```bash
|
|
484
|
-
# Every command returns structured JSON envelope
|
|
485
|
-
perp --json portfolio
|
|
486
|
-
# → { "ok": true, "data": {...}, "meta": { "timestamp": "..." } }
|
|
487
|
-
|
|
488
|
-
# Filter output to specific fields (saves tokens)
|
|
489
|
-
perp --json --fields totalEquity,risk portfolio
|
|
490
|
-
|
|
491
|
-
# Stream large lists as NDJSON (one JSON per line)
|
|
492
|
-
perp --json --ndjson -e hl market list
|
|
493
|
-
|
|
494
|
-
# Pre-validate before executing
|
|
495
|
-
perp --json -e hl trade check BTC buy 0.01
|
|
496
|
-
perp --json --dry-run -e hl trade market BTC buy 0.01
|
|
497
|
-
|
|
498
|
-
# Idempotent orders with client ID (Hyperliquid: a 128-bit cloid, 0x + 32 hex; --auto-id generates one)
|
|
499
|
-
perp --json -e hl trade market BTC buy 0.01 --client-id 0x1234567890abcdef1234567890abcdef
|
|
500
|
-
perp --json -e hl trade status c:0x1234567890abcdef1234567890abcdef
|
|
501
|
-
```
|
|
502
|
-
|
|
503
|
-
All responses are auto-sanitized (control chars stripped, prompt injection patterns blocked).
|
|
504
|
-
Errors include `retryable` flag — only retry when `true`.
|
|
227
|
+
| Doc | What's in it |
|
|
228
|
+
|---|---|
|
|
229
|
+
| [Setup](docs/setup.md) | Wallets, agent keys, keys created on the exchange website, where secrets are stored |
|
|
230
|
+
| [Venues](docs/venues.md) | Support matrix, venue ids, QFEX / RISEx / GRVT / Extended / Variational / TxFlow / Derive details |
|
|
231
|
+
| [Trading](docs/trading.md) | Time in force, TP/SL, stops, order edit, slippage, spot trading, builder fees |
|
|
232
|
+
| [Commands](docs/commands.md) | Every command group with examples, Telegram alerts |
|
|
233
|
+
| [Mainnet verification](docs/verification.md) | What has been run with real money, per venue |
|
|
234
|
+
| [MCP server](docs/mcp.md) | Configuration, testnet, tools, resources, prompts |
|
|
235
|
+
| [Signing guardrail](docs/guardrail.md) | `perp-guardrail`, the OWS policy executable for agent keys |
|
|
236
|
+
| [Testing](docs/TESTING.md) | Test suites and the venue checklist |
|
|
237
|
+
| [CHANGELOG](CHANGELOG.md) | Release notes |
|
|
505
238
|
|
|
506
239
|
## License
|
|
507
240
|
|