[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GTBA3VJM6AK4GYV3NF9W0K":3,"skill-same:01M6GTBA3VJM6AK4GYV3NF9W0K":129},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6GTBA3VJM6AK4GYV3NF9W0K","perp-cli",null,"Multi-DEX perpetual futures trading via the perp-cli command-line tool. Use when user asks to: trade perps, check funding rates, scan\u002Fexecute arbitrage (perp-perp or spot-perp), run delta-neutral strategies, bridge USDC across chains, manage positions\u002Forders\u002Fleverage, deposit\u002Fwithdraw, hedge spot+perp, trade HIP-3 DEXes, read Derive options chains, use Pacifica Print or Pacifica vaults, or mentions perp-cli, hypurrquant, Pacifica, Hyperliquid, Lighter, Aster, Lighter RH, Ondo Perps, Arcus, QFEX, RISEx, TxFlow, Variational, GRVT, Extended, Derive, HyperEVM, funding arb, or U-tokens (UBTC\u002FUETH\u002FUSOL). Covers Pacifica (Solana), Hyperliquid (HyperEVM), Lighter (Ethereum), Aster (BNB Chain), Lighter RH and Arcus (Robinhood chain), Ondo Perps and QFEX (off-chain), RISEx (RISE chain), TxFlow (manual trading; mainnet whitelisted; official API in Beta), Variational Omni (market data only, official API), GRVT and Extended (Starknet) (market data only for now, official API), Derive options (read-only), and Pacifica Print \u002F vaults.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"perp cli","perp","cli","usdc","starknet","bnb chain","command-line","hip","leverage","strategies","arbitrage","npm package","Wallet","bridge","read","command","preflight","run","gemini cli","gemini","2026-11-10 10:12:30",false,"---\nname: perp-cli\ndescription: \"Multi-DEX perpetual futures trading via the perp-cli command-line tool. Use when user asks to: trade perps, check funding rates, scan\u002Fexecute arbitrage (perp-perp or spot-perp), run delta-neutral strategies, bridge USDC across chains, manage positions\u002Forders\u002Fleverage, deposit\u002Fwithdraw, hedge spot+perp, trade HIP-3 DEXes, read Derive options chains, use Pacifica Print or Pacifica vaults, or mentions perp-cli, hypurrquant, Pacifica, Hyperliquid, Lighter, Aster, Lighter RH, Ondo Perps, Arcus, QFEX, RISEx, TxFlow, Variational, GRVT, Extended, Derive, HyperEVM, funding arb, or U-tokens (UBTC\u002FUETH\u002FUSOL). Covers Pacifica (Solana), Hyperliquid (HyperEVM), Lighter (Ethereum), Aster (BNB Chain), Lighter RH and Arcus (Robinhood chain), Ondo Perps and QFEX (off-chain), RISEx (RISE chain), TxFlow (manual trading; mainnet whitelisted; official API in Beta), Variational Omni (market data only, official API), GRVT and Extended (Starknet) (market data only for now, official API), Derive options (read-only), and Pacifica Print \u002F vaults.\"\nlicense: MIT\nallowed-tools: \"Bash(perp:*), Bash(bash scripts\u002Fpreflight.sh:*), Bash(bash scripts\u002Farb-monitor.sh:*), Bash(bash scripts\u002Ffunding-analysis.sh:*), Bash(bash scripts\u002Fspot-perp-scan.sh:*), Bash(bash scripts\u002Fvalidate-arb.sh:*)\"\ncompatibility: \"Requires Node.js 20 or newer and the perp-cli npm package installed by the user (version must be >= 0.17.0; the user runs `npm install -g perp-cli` — never install it yourself). Network access required for exchange APIs and bridge providers. Mutating commands need a wallet key imported into the OWS vault via 'perp wallet set EXCHANGE' (key on stdin or hidden prompt — never argv). Skill is portable across Claude Code, Claude.ai, Cursor, Codex, and Gemini CLI — no platform-specific features.\"\nmetadata:\n  author: hypurrquant\n  version: \"0.17.0\"\n---\n\n# perp-cli\n\nMulti-DEX perpetual futures CLI + MCP server for Pacifica (Solana), Hyperliquid (HyperEVM), Lighter (Ethereum), Aster (BNB Chain), Lighter RH (`lighter-rh`, Robinhood chain, USDG), Ondo Perps (`ondo`), QFEX (`qfex`, custodial TradFi perps — import-only API key; resting reduce-only limits and automation are refused for now, see \"QFEX\" below), Arcus (`arcus`, Robinhood chain, USDG), RISEx (`risex|rise`, RISE chain, USDC — trading through a trading-only session signer, not yet verified on mainnet; deposits \u002F withdrawals in the RISEx app only, see \"RISEx\" below), TxFlow (`txflow|txf`, official API (Beta) — manual trading with an approved agent key, verified on testnet only; mainnet whitelisted; see \"TxFlow\" below), Variational Omni (`variational|var|omni`, MARKET DATA ONLY through its official read-only API — RFQ venue, no public trading API yet, see \"Variational\" below), GRVT (`grvt|grv`, MARKET DATA ONLY in this version through its official API — trading is planned for a later release, see \"GRVT\" below), Extended (`extended|ext|x10`, Starknet, formerly X10 — MARKET DATA ONLY in this version through its official public API, see \"Extended\" below). v0.13.0+ also supports Hyperliquid Outcome markets (HIP-4) — fully-collateralized binary\u002Frange contracts; each outcome's quote token comes from `outcomeMeta.quoteToken` (USDC on every listed outcome as of 2026-10-12), minimum order value 10 quote tokens.\n\n## Instructions\n\n### When to use this skill\n\nActivate whenever the user wants to do anything against perp-cli, including: scanning funding-rate arbitrage, executing perp-perp or spot+perp legs, running long-running strategy bots, moving USDC between chains\u002Fexchanges, checking account\u002Fportfolio state, configuring wallets, or troubleshooting any of the above.\n\n**Do NOT** answer trading questions from memory — always run the actual CLI command and parse its JSON output.\n\n### Reference files (load only when needed)\n\nThis skill uses progressive disclosure. Read these on demand:\n\n- `references\u002Fcommands.md` — full command tree for every group (market, account, trade, outcome, options, print, vault, arb, funds, wallet, risk, history, strategy, background, alerts, settings, backtest)\n- `references\u002Fagent-operations.md` — non-interactive setup flows, idempotency rules, error codes, common mistakes\n- `references\u002Fstrategies.md` — funding-arb decision framework + risk-management playbook (read before designing arb strategy)\n- `references\u002Fws-library.md` — WebSocket library (shipped since 0.15.0, @experimental), published standalone as **`@hypurrquant\u002Fperp-ws`** (zero dependencies; recommended for integrators — `npm install @hypurrquant\u002Fperp-ws`) and inside perp-cli as `perp-cli\u002Fws` (same code, use it when perp-cli is already installed): build a live dashboard \u002F funding comparison \u002F account feed in the browser or Node (streams, events, nullability, comparator, user channels, errors, capability matrix). Cross-venue subscriptions use `canonicals` (e.g. `{ kind: \"allMarkets\", canonicals: [\"BTC\"] }`), never `symbols` (those are per-venue directory symbols); always surface `ready` rejections — an `idle` venue is not \"fine\"\n\nAlso bundled under `scripts\u002F`: `preflight.sh`, `arb-monitor.sh`, `funding-analysis.sh`, `spot-perp-scan.sh`, `validate-arb.sh`. Use these for repeatable multi-step diagnostics. They need `perp` on PATH (else they exit 1 with `PERP_NOT_FOUND` — ask the user to install it) and exit non-zero on a failed read; `funding-analysis.sh` \u002F `spot-perp-scan.sh` take `-n mainnet|testnet`, `spot-perp-scan.sh --no-portfolio` scans without a wallet.\n\n### Critical rules\n\n1. **Always pass `--json`.** Without it, output is human-formatted and hard to parse. `ok:false` also exits 1.\n2. **Always pass `-e \u003Cvenue>`** on venue-scoped commands. The default is `settings.defaultExchange`, else `pacifica` — never rely on it.\n3. **Always run `--dry-run` first** for any mutating command that supports it, show the result, get user confirmation, then execute without `--dry-run`. `--help` is NOT a reliable indicator — the 0.16.0 list: every `trade` write (market \u002F buy \u002F sell \u002F limit \u002F split \u002F cancel \u002F cancel-all \u002F stop \u002F tpsl \u002F scale-tp \u002F scale-in \u002F edit \u002F atomic \u002F leverage \u002F close \u002F close-all \u002F flatten \u002F reduce \u002F spot-buy \u002F spot-sell \u002F spot-limit \u002F spot-cancel \u002F spot-transfer), `arb exec|close|auto|rebalance`, `funds deposit|withdraw|transfer|faucet|bridge send|bridge exchange|rebalance execute|address-book add`, `outcome buy|sell`, `print deposit|cancel`, `vault deposit|withdraw`, `wallet builder approve|revoke`, `wallet manage referral set`, `strategy run`, `strategy plan execute`. Everything else (read-only commands too; `trade twap|multi|cancel-stop|cancel-twap`; the moved stubs `wallet manage lake deposit|withdraw` → use `vault deposit|withdraw`) refuses `--dry-run` with `INVALID_PARAMS` — that refusal means \"unsupported\", nothing ran (see \"Safety rules\").\n4. **Always use `--fields`** when you only need specific data — saves tokens.\n5. **Avoid bare `perp setup` \u002F `perp init` \u002F `perp wallet setup`** — they prompt and will hang an agent. Use `printf '%s' \"$KEY\" | OWS_PASSPHRASE=\u003Cpp> perp --json wallet set \u003Cexchange>` for key registration (key on stdin; a key on argv or `-k` is rejected), or `perp --json setup --non-interactive --wallet \u003Cows-wallet> --venues \u003Clist> [--default-venue \u003Cv>] [--slippage-bps \u003Cn>] [--slippage \u003Cvenue>=\u003Cbps>]` (new wallet: `--wallet-name \u003Cname>` with the passphrase in `OWS_PASSPHRASE`; agent registration only with `--approve-agents --yes`, after user confirmation) (and `OWS_PASSPHRASE=\u003Cpp> perp wallet setup --name \u003Cn> --max-tx-usd \u003Cusd> --max-daily-usd \u003Cusd>`) when the wizard is required. The passphrase goes in `OWS_PASSPHRASE` or stdin — the root `--passphrase` flag is deprecated (visible in `ps`).\n6. **NEVER trade without explicit user confirmation.** A dry-run is not consent.\n7. **NEVER read `~\u002F.perp\u002F.env` or other key files.** The CLI reads them — you should not.\n8. **NEVER manually add `-PERP` suffix** to symbols. Use bare names (`BTC`, `SOL`, `ICP`); the CLI resolves exchange-specific naming.\n9. **NEVER resubmit after `ORDER_PENDING`** (or any unknown outcome). See \"Safety rules\".\n\n### Step 1: Verify install, version, venue health\n\n```bash\nperp --version         # must be >= 0.17.0\nperp --json health     # keyless venue connectivity\n```\n\nIf `perp` is missing or older, STOP and ask the user to install \u002F upgrade it (`npm install -g perp-cli`) — never install it yourself and never switch to `npx`. `health`: `data.healthy` = every OFFICIAL-API venue is up (use this); `allHealthy` also counts unofficial APIs (listed under `unofficial[]`; none at present). Market-data-only venues (e.g. TxFlow) count toward `healthy` too — a venue you are not using being down is not a reason to stop; `skipped[]` = venues with no environment on this network (not probed). Don't use a venue whose `exchanges[].status` is not `\"ok\"`.\n\n### Step 2: Verify wallet + balance\n\n```bash\nperp --json wallet show               # with an OWS wallet, `exchanges: []` is normal — owsActiveWallet serves every venue\nperp --json portfolio -e \u003Cvenue>      # per-exchange perp.available (aliases like hl \u002F pac accepted)\n```\n\nIf any required exchange is missing, register it (user supplies the key):\n\n```bash\nprintf '%s' \"$EVM_HEX_KEY\" | OWS_PASSPHRASE=\u003Cpp> perp --json wallet set hl          # Hyperliquid \u002F Lighter \u002F Aster (EVM)\nprintf '%s' \"$SOLANA_BASE58_KEY\" | OWS_PASSPHRASE=\u003Cpp> perp --json wallet set pac   # Pacifica (Solana)\n```\n\nThe key is read from stdin (never argv — an argv key is rejected) and imported into the OWS vault; the imported wallet becomes `owsActiveWallet`, which serves every venue. The same EVM key works for Hyperliquid, Lighter and Aster. Lighter trading additionally needs `perp wallet agent approve lighter`.\n\nLighter RH \u002F Ondo Perps \u002F Arcus have no `wallet set` path — register an agent \u002F API key (user runs it; Ondo reads key id + secret from stdin):\n\n```bash\nperp --json wallet agent approve lighter-rh\nprintf '%s\\n%s\\n' \"$KEY_ID\" \"$SECRET\" | perp --json wallet agent approve ondo\nperp --json wallet agent approve arcus --master \u003Cows-wallet>   # address must be on the Arcus access whitelist\n```\n\n**No master wallet on this computer?** The user can create the agent \u002F API key on the exchange website and import it — key on stdin only, verified against the venue before it is stored (`verification.status` is `\"unverified\"` only for Pacifica, which lists bindings master-signed only):\n\n```bash\nprintf '%s' \"$AGENT_KEY\" | perp --json wallet agent import hyperliquid               # master read from HL\nprintf '%s' \"$AGENT_KEY\" | perp --json wallet agent import aster --master-address 0x…  # also Aster testnet\nprintf '%s' \"$AGENT_KEY\" | perp --json wallet agent import pacifica --master-address \u003CSOL>\nprintf '%s' \"$API_KEY\" | perp --json wallet agent import lighter --account-index \u003Cn> --api-key-index \u003Cslot>\nprintf '%s' \"$ED25519_KEY\" | perp --json wallet agent import arcus --master-address 0x…\n```\n\nImported keys trade; `funds deposit|withdraw|transfer|bridge`, `wallet manage referral set` and `wallet agent approve` need the master → `NO_SIGNER_AVAILABLE` (tell the user to do it on the website or `perp wallet import` the master). `wallet agent revoke` of an imported key needs `--local-only` and does NOT revoke it on the exchange; `rotate` is refused (new key on the website → `import --replace`).\n\n**QFEX** (`-e qfex`, testnet = QFEX UAT): keys are created on the QFEX website and imported by the USER (`perp wallet agent import qfex [--account-id \u003Cuuid>]` — the resolved account UUID must be confirmed). Rules an agent must follow:\n- Works: market \u002F IOC reduce-only closes (`trade close\u002Fclose-all\u002Fflatten\u002Freduce`), reduce-only stop-market orders (`trade stop`, `trade tpsl` TP\u002FSL legs, `--tp\u002F--sl` as separate stops after the verified fill; cancel with `trade cancel \u003CS> \u003Cid>` or `trade cancel-stop`), `trade edit` of a plain LIMIT \u002F ALO (the venue assigns a new order id; the client id is kept).\n- Refused with `CAPABILITY_UNSUPPORTED` (do not work around): resting reduce-only limits (GTC \u002F ALO \u002F FOK, `scale-tp`), stop-limit and opening stops, amend of a reduce-only order, `--client-id`, non-USD-quoted markets, unattended automation (bots \u002F plans \u002F TWAP \u002F DCA \u002F grid \u002F background jobs), QFEX as a funding-arb \u002F funding-bot leg.\n- After a close, reduce-only \u002F stop orders left on a now-flat symbol are listed as a WARNING (the venue does not cancel them) — cancel them, or use `trade flatten`, which cancels them.\n- Limit GTC \u002F ALO returns `status: accepted, finality: pending` after the ACK; `open` only via `perp --json trade status c:\u003Cid> --symbol \u003CS> -e qfex`.\n- `ORDER_PENDING` = outcome unknown: NEVER resubmit; check with the `c:\u003Cid>` in the remediation.\n- Funding rates on QFEX are unverified: excluded everywhere unless `perp --json arb scan --rates --include-unverified` (display only).\n- Withdrawals are disabled in perp-cli for now: `funds withdraw qfex` → `CAPABILITY_UNSUPPORTED` (also under `--dry-run`). Withdraw in the QFEX web app. Ondo Perps has no API withdrawals either.\n\n**RISEx** (`-e risex`, testnet = `-n testnet`, official API): orders are signed by a session SIGNER that the user registers with the master wallet (`perp wallet agent approve risex --master \u003Cows-wallet> [--expires-in 30d]`, default 30 days). Mainnet RISEx trading has NOT been verified with real funds yet (testnet-verified 2026-10-14): ask the user before placing mainnet RISEx orders. Rules an agent must follow:\n- Approve = master signs RegisterSigner (+ the new signer's VerifySigner), then the signer is restricted ON-CHAIN to trading only (it signs DisablePermission for every other permission; the MASTER sends those transactions and needs a little ETH on RISE chain for gas — `INSUFFICIENT_BALANCE` before anything is registered otherwise). Only the master can re-enable a permission. If the restriction fails, the signer is revoked automatically; `APPROVE_PARTIAL` means it could not be — tell the user to revoke it in the RISEx app.\n- **Never interrupt `wallet agent approve risex`** (no Ctrl-C, no timeout kill, no closing the terminal): between registration and the last DisablePermission transaction the signer briefly holds FULL permissions (including fund movement). If it was interrupted anyway: run `perp --json wallet agent verify risex` — `POLICY_DENIED` or an unknown signer means revoke it now (`perp wallet agent revoke risex \u003Cname>`, or in the RISEx app for a signer perp-cli did not record), then approve again.\n- Trading-only is proven from the raw on-chain permission bitmap (the bits of permissions 0, 3 and 4 clear and trading's set; permission 1 is the \"all\" mask and is never disabled — doing so would wipe trading too), cross-checked with `hasPermission` (exactly {trading}) and the key's status and expiry, the reviewed Authorization, Router and AccountRegistry contract versions, and the absence of any newer permission id — at approve (before the signer is registered), at `verify`, and before signed actions (re-checked at least every 60 s in long-running processes). If RISEx upgrades any of those contracts or adds a permission, every RISEx signed action — including cancel and cancel-all — is refused (`POLICY_DENIED`) until perp-cli is updated; manage open orders and positions in app.rise.trade meanwhile, and revoke with `perp wallet agent revoke risex \u003Cname>` if in doubt. Do not work around it.\n- Residual risk: those contracts are upgradeable by RISEx's admin keys, so RISEx itself can change what a registered signer may do. perp-cli only detects it (fail closed); the gap between an upgrade and the next check is not covered.\n- `wallet agent import risex` is refused (`CAPABILITY_UNSUPPORTED`): an app-created signer keeps fund-movement permissions. `wallet agent verify risex` re-reads the on-chain permissions; `wallet agent revoke risex \u003Cname>` revokes with the master.\n- Deposits and withdrawals are app-only: `funds deposit|withdraw risex` → `CAPABILITY_UNSUPPORTED` (also under `--dry-run`), remediation app.rise.trade. Testnet only: `perp -n testnet funds faucet risex` (1000 test USDC, once).\n- Works: market (IOC within `--slippage-bps`, which must fit the market's match price band, 2% on mainnet today), limit GTC \u002F IOC \u002F FOK \u002F ALO (post-only), reduce-only, cancel, cancel-all, leverage, margin mode (refused while a position is open), `trade status c:\u003Cid>`. Sizes \u002F prices must sit exactly on the step \u002F tick grid (`INVALID_TICK`, never rounded). Client ids are uint64 decimals (generated when omitted).\n- Not supported: TP\u002FSL \u002F stops (RISEx executes them from the venue backend against an account-signed OperatorHub spending allowance, outside the trading-only signer — perp-cli does not grant it; set TP\u002FSL in the RISEx app), amend, builder fee (`CAPABILITY_UNSUPPORTED`). Bots \u002F TWAP \u002F grid \u002F background jobs \u002F `strategy …` on RISEx are refused (`CAPABILITY_UNSUPPORTED`, \"unattended trading on RISEx is not enabled until its trading path is verified on mainnet\") — trade RISEx manually.\n- Account reads (`portfolio`, `account balance|positions|orders|history|trades|funding-history`) work with only the master address selected (public by address) — no signer needed.\n- `ORDER_PENDING` = outcome unknown (the symbol is quarantined): NEVER resubmit; check with `perp --json trade status c:\u003Cid> --symbol \u003CS> -e risex`. Each signed action uses a fresh permit nonce that is never reused.\n- Funding: hourly, `current_funding_rate` = the last settled hourly print (verified against funding payments).\n\n**TxFlow** (`-e txflow`, testnet = `-n testnet`, official API in Beta): manual trading is on. It was verified on testnet only — no mainnet TxFlow order has been run yet; tell the user before their first mainnet TxFlow order. Trading uses an AGENT key the master approves (`perp wallet agent approve txflow --master \u003Cows>`, or `wallet agent import txflow`; `wallet agent verify txflow` checks it read-only). Rules:\n- Mainnet `\u002Fexchange` is whitelisted: a refusal is `POLICY_DENIED` with \"apply at https:\u002F\u002Ftxflow.com\u002Fapply\" — tell the user; never retry. Testnet is open; an unfunded account is `DEPOSIT_REQUIRED` (fund it in the TxFlow web app).\n- Works: market data (`market list|prices|info|book|trades|kline`), account reads (`portfolio`, `account positions|orders|history|trades|funding`), `trade market|buy|sell|limit` (TIF GTC \u002F IOC \u002F ALO; FOK refused), `trade cancel|cancel-all|close|reduce|flatten`, `trade edit` (price + new TOTAL size, same order id), `trade stop` (reduce-only trigger on the MARK price), `--tp\u002F--sl` on a market \u002F IOC entry (legs placed after the verified fill), `trade tpsl`, `trade leverage [--isolated]`, `trade status c:\u003Cid> --symbol \u003CS>`, MCP `get_balance|get_positions|get_open_orders|trade_*`.\n- The venue's answer never says filled \u002F resting: perp-cli reads the order back by its client id. `status: accepted, finality: pending` = executed but not visible yet — check with `trade status c:\u003Cid>`. `ORDER_PENDING` = outcome unknown: NEVER resubmit.\n- Refused with `CAPABILITY_UNSUPPORTED` before anything is sent: `funds deposit|withdraw txflow`, `funds transfer -e txflow`, `funds rebalance` (the user moves funds in the TxFlow web app); builder codes; every `strategy …` \u002F bot \u002F TWAP \u002F background job (automation gate); `arb exec|auto` legs; hedge-mode accounts; `account positions --address` (no keyless reads for TxFlow).\n- Funding is percent per hour on the venue, shown as a FRACTION per hour, and is UNVERIFIED — display only (`arb scan --rates --include-unverified`); `market funding` (history) is refused.\n\n**Variational** (`-e variational`, aliases `var`, `omni`): Variational Omni, read-only (market data) in perp-cli through its OFFICIAL documented API (`GET \u002Fmetadata\u002Fv2\u002Fstats`, one call for all ~575 markets, cached ~5 s; venue limit 10 requests \u002F 10 s per IP). Variational has no public trading API yet. It is an RFQ venue: one market maker (the OLP) quotes every trade — there is no order book.\n- Works: `market list|prices|info|funding|book -e variational`, `perp health` (official), and Variational rows in `perp --json arb scan --rates --include-unverified` \u002F `--compare \u003Csym> --include-unverified` only — display only, never ranked or traded: funding is UNVERIFIED (a moving predicted rate, not checked against settled payments). `US500-PERP` is the SPDR S&P 500 ETF, compared as `SPY`; SPX (SPX6900) and QNT (Quant) are never matched.\n- `market book` shows the OLP's INDICATIVE RFQ quotes at fixed notionals (min order, $1k, $100k, $1M when published; `kind: \"rfqQuotes\"`), never order-book levels; they may be up to 600 s old (`updatedAt`). `market mid|trades|kline` are refused (`CAPABILITY_UNSUPPORTED`).\n- Funding: the interval is PER MARKET (1h \u002F 4h \u002F 8h perps; `fundingHours` on each row), positive = longs pay. `fundingRate` is the fraction for one interval; `market funding \u003Csym>` shows the current terms (`kind: \"currentFunding\"`: per interval, hourly, APR %, next time) — there is no funding history. `rateKind` is `predicted`: the rate for the window ending at `nextFundingTime`, recomputed during the window.\n- Perp symbols are the base (`BTC`); swaps keep their suffix (`XAU-SWAP`): daily-funded TradFi swaps with separate long \u002F short rates, `fundingRate` null and never matched across venues. Open interest is published in USD, single-sided (`openInterestUsd`); base-unit `openInterest` is null. No index price, tick, lot or leverage is published (null).\n- Refused with `CAPABILITY_UNSUPPORTED` before any request: every trade \u002F account \u002F portfolio \u002F funds \u002F agent \u002F builder \u002F bot command (also with `--dry-run`). The user trades on omni.variational.io. No testnet. Variational's terms exclude US \u002F Canada persons and sanctioned regions (perp-cli only warns).\n\n**GRVT** (`-e grvt`, testnet = `-n testnet`): official Market Data API (api-docs.grvt.io), READ-ONLY in this version. Rules an agent must follow:\n- Works: `market list|prices|info|book|trades|funding|kline -e grvt`, `perp health` (counted among the official venues), and GRVT rows in `perp --json arb scan --rates --include-unverified` (display only).\n- Symbols are the base ticker (`BTC`, `KPEPE`, `XAU`, `AAPL`; `BTC_USDT_Perp` also accepted); `venueSymbol` is GRVT's instrument name. Unknown symbols → `SYMBOL_NOT_FOUND`. Pre-IPO markets (OPENAI, ANTHROPIC, SPACEX) are never matched across venues.\n- Funding interval is PER MARKET (8 h or 4 h — `fundingHours`); rates are fractions per that interval (GRVT publishes percent). `market list|prices|info` rows carry the INDICATIVE rate of the running interval (`fundingRateKind: \"predicted\"`, moves until `nextFundingTime`); `market funding` is the settled history (`rateKind: \"lastSettled\"`, `intervalHours` per row). Funding is UNVERIFIED (not yet checked against settled payments) — never rank or trade on it.\n- `stepSize` is null (GRVT publishes a minimum size, `minSize`, but no lot step); `maxLeverage` \u002F `marginTiers` come from GRVT's margin rules and are filled by `market list|prices|info` only (cached up to 6 h — `leverageAsOf` says when they were read) — MCP `get_markets` \u002F `get_prices` rows have them null (price-only path). Equities match other venues only when reviewed; an unreviewed new GRVT equity has `canonical: null`.\n- Refused with `CAPABILITY_UNSUPPORTED` before any request (also under `--dry-run`): every trade \u002F account \u002F portfolio \u002F funds \u002F agent \u002F builder \u002F bot command and `setup` venue selection — remediation \"GRVT is read-only (market data) in this version; trading is planned for a later release\". GRVT trading needs KYC and is banned in restricted jurisdictions (US, CA, SG, HK, …) — relevant once trading lands.\n\n**Extended** (`-e extended`, aliases `ext` \u002F `x10`; testnet = Sepolia via `-n testnet`): official public API (api.docs.extended.exchange), READ-ONLY in this version — counted as an official venue in `perp health`. Rules an agent must follow:\n- Works: `market list|prices|info|book|trades|funding|kline -e extended`, and Extended rows in `perp --json arb scan --rates --include-unverified` (display only — funding is UNVERIFIED: never rank or trade on it). `market list` rows carry `assetClass` (crypto \u002F equity \u002F etf \u002F index \u002F commodity \u002F fx \u002F preIpo; human table \"Class\" column), `venueSymbol` (wire name, e.g. `TSLA_24_5-USD`), `tickSize`, `minSize`, `tradable` (false while `REDUCE_ONLY` or `isOffHours`), `isRfq`, `tradingHours`.\n- Symbols: `assetName` without the `_24_5` suffix (`TSLA_24_5-USD` → `TSLA`, `SPX500m-USD` → `SPX500M`); `-e extended market book TSLA-USD` and the wire name also resolve. The crypto `SPX` market is SPX6900, not the S&P 500 (index = `SPX500M`). RWA tickers that are also crypto tickers (PURR = Hyperliquid Strategies Inc., QNT, BB, ON, ADI, BOT), XIAOMI and the crypto SPX are never matched across venues.\n- Funding: applied hourly; `fundingRate` in market rows = the current hour's ACCRUING rate (fraction per hour, recomputed every minute, rounded to 6 decimals by the venue — no public source is more precise; `fundingRateKind: \"accruing\"`, `nextFundingTime`), `market funding` = applied hourly prints (`rateKind: \"lastSettled\"`, `annualizedPct`). `_24_5` equities print 0 while their underlying is closed (weekends \u002F holidays), so an annualized rate overstates them.\n- Refused with `CAPABILITY_UNSUPPORTED` before any request (\"Extended is read-only (market data) in this version; trading is planned for a later release\"): every trade \u002F account \u002F portfolio \u002F funds \u002F agent \u002F builder \u002F bot command, also under `--dry-run`. RFQ markets' REST order book is the indicative book.\n\nVenue rules for these: `trade limit` defaults to `--tif GTC` on every venue (arcus maps it to GTT; ondo offers GTC|IOC|ALO; FOK is never emulated → `CAPABILITY_UNSUPPORTED` where not offered); market orders on every venue are bounded by `--slippage-bps \u003Cn>` → `settings.slippageBps.\u003Cvenue>` → `settings.defaultSlippageBps` (shipped default 50). Ondo (US, PA) and Arcus (US, CA, GB) print a one-time restricted-region notice on stderr when used with credentials (warn only, never blocks).\n\n### Step 3: Discover (read-only)\n\n```bash\nperp --json arb scan                              # all modes (perp-perp + spot-perp), default --min 10 (% annual)\nperp --json arb scan --mode perp-perp --top 10\nperp --json arb scan --mode spot-perp --top 10\nperp --json arb scan --rates                      # raw funding rates\nperp --json arb scan --basis [\u003Csymbol>]           # cross-exchange basis\nperp --json arb scan --gaps                       # cross-exchange price gaps\nperp --json arb scan --hip3                       # HIP-3 cross-dex spreads\nperp --json arb scan --history \u003Csymbol>           # LOCAL snapshots only (written by earlier `arb scan --rates` runs; often `rates: {}`)\nperp --json -e \u003Cex> market funding \u003Csymbol> -l 24 # real settled history (newest first; rate per `intervalHours`)\nperp --json arb scan --compare \u003Csymbol>           # one symbol across all exchanges\nperp --json arb scan --positions                  # funding impact on open positions\nperp --json arb scan --live --interval 60         # continuous monitoring\n```\n\nCommon knobs: `--min \u003Cpct>`, `--top \u003Cn>`, `--hold-days \u003Cn>` (default 7), `--bridge-cost \u003Cusd>`, `--size \u003Cusd>`.\n\nPrices: `perp --json -e \u003Cex> market mid \u003CSYM>` is the canonical price read; cross-venue: `arb scan --compare \u003CSYM>`. `market prices` takes no symbol (every market). There is no spot price \u002F book read (`market *` are perp markets; `HYPE\u002FUSDC`, `@107`, `HYPE-SPOT` → `SYMBOL_NOT_FOUND`), and `arb scan --basis` is cross-venue PERP basis, not spot-perp.\n\n**Reading scan rows** — act only on these fields (detail: `references\u002Fcommands.md` → \"Arbitrage\"):\n- perp-perp rows (`mode: \"perp-perp\"`): `longExch` \u002F `shortExch`, `netSpread` \u002F `grossSpread` (= `netSpreadPct` \u002F `grossSpreadPct`, annual %), `estFeesPct` (estimated round trip on BOTH legs incl. 0.1 % slippage — e.g. hl+hl 0.24 %; `perp settings fees show` is the per-fill taker rate it is built from).\n- spot-perp rows (`mode: \"spot-perp\"`): `spotExchanges[]`, `perpExchange`, `direction`, `netSpread`, `estFeesPct`, `breakEvenDays` — no `longExch` \u002F `shortExch`. Executable ONLY when `direction == \"long-spot-short-perp\"`: `arb exec \u003CSYM> spot:\u003Cone of spotExchanges> \u003CperpExchange> \u003CUSD>`. `arb exec spot:` does not look at the funding sign — it always buys spot and shorts the perp, so on a `sell-spot-long-perp` row it would PAY the funding. Never act on `sell-spot-long-perp` rows.\n- `--rates` \u002F `--compare` rows: `longExchange` \u002F `shortExchange` \u002F `maxSpreadAnnual` (all null when fewer than two verified rates), `executable`, `readOnlyLegs`, `unverifiedLegs`, `mixedKinds` (the legs' rates are of different kinds — lastSettled \u002F accruing \u002F predicted); `--rates` top level has `minSpread` \u002F `belowMinSpread`. Act only when `executable === true`. `--compare \u003Cunknown>` is `ok:true` with `data.available: false`.\n- **Testnet funding rates and spreads are meaningless** (thousands of % \u002F yr). Never report them as opportunities; do yield analysis on mainnet public reads (keyless, `-n mainnet`).\n\n#### HIP-3 dexes (part of Hyperliquid, not a separate venue)\n\nHIP-3 dexes are selected on the Hyperliquid venue with the root `--dex \u003Cname>` flag; every market \u002F account \u002F trade command works the same way. Same account and wallet as native Hyperliquid perps.\n\n```bash\nperp --json -e hyperliquid market hip3                               # deployed dexes: name, deployer, assets, delistedAssets, delisted\nperp --json -e hyperliquid market list --hip3                        # native + every HIP-3 dex market\nperp --json -e hyperliquid --dex xyz market list                     # markets on dex \"xyz\"\nperp --json -e hyperliquid --dex xyz market info GOLD                # symbols WITHOUT the \"xyz:\" prefix\nperp --json -e hyperliquid --dex xyz account positions               # positions on that dex only\nperp --json -e hyperliquid account positions --hip3                  # native + every HIP-3 dex\nperp --json -e hyperliquid --dex xyz --dry-run trade market GOLD buy 0.01\n```\n\n- `--dex` with any other `-e` venue → `INVALID_PARAMS` (never ignored).\n- A dex symbol without `--dex` (e.g. `-e hyperliquid market mid xyz:GOLD`) → `SYMBOL_NOT_FOUND` with remediation `--dex xyz`; it is never read from the native dex.\n- `portfolio --dexes` works only with `--serve` (web dashboard); for HIP-3 positions use `account positions --hip3` \u002F `--dex \u003Cname>` or `--address`. Builder fees are never attached on HIP-3.\n- Symbols: input is bare (`BTC`; HIP-3 `TSLA` + `--dex xyz`). Output differs: market rows are plain, keyed HL native position \u002F order rows show `\u003CCOIN>-PERP`, HIP-3 rows `xyz:TSLA` — pass the bare name back (`BTC`, `TSLA` + `--dex xyz`).\n- MCP tools cover native Hyperliquid perps only, except `get_positions_by_address` (reads every HIP-3 dex) — use the CLI for the rest of HIP-3.\n\n#### Options market data (Derive, read-only)\n\nDerive (derive.xyz) options via the official public API — keyless, never trades. Not a perp venue (`-e derive` works only with `perp options`).\n\n```bash\nperp --json -e derive options expiries ETH                              # active expiries\nperp --json -e derive options chain ETH --expiry 2026-12-25 --strikes 10 # calls\u002Fputs per strike: bid\u002Fask, mark, IV, greeks, OI\nperp --json -e derive options quote ETH-20261225-3500-P                 # one option\n```\n\n`schema: 1`; decimals are strings; `null` = unknown (empty side, uncomputable IV). Unknown underlying \u002F expiry \u002F instrument → `SYMBOL_NOT_FOUND`. Full reference: `references\u002Fcommands.md` → \"Options market data\".\n\n### Step 4: Validate before mutating\n\nFor arb:\n\n```bash\nperp --json portfolio -e \u003ClongEx>                     # perp.available (long leg)\nperp --json portfolio -e \u003CshortEx>                    # perp.available (short leg)\nperp --json --dry-run arb exec \u003CSYM> \u003ClongEx> \u003CshortEx> \u003CUSD>\n```\n\nSpot-perp (`spot:\u003Cvenue>` long leg, only for `direction == \"long-spot-short-perp\"` rows): the spot leg needs the full spot notional in the spot venue's quote (`perp --json -e \u003Cvenue> trade spot-balance`; separate-margin venues transfer the shortfall perp→spot) plus perp margin on the perp leg — the dry-run checks both and refuses an empty book or a > 5% spot\u002Fperp price gap.\n\nFor a single trade:\n\n```bash\nperp --json -e \u003Cex> market info \u003CSYM>                                    # markPrice, stepSize (lot), maxLeverage\nperp --json -e \u003Cex> trade check \u003CSYM> \u003CSIDE> \u003CSIZE> --leverage \u003CN>\nperp --json --dry-run -e \u003Cex> trade buy \u003CSYM> \u003CSIZE>                     # market entry\nperp --json --dry-run -e \u003Cex> trade buy \u003CSYM> \u003CSIZE> --tp \u003CPX> --sl \u003CPX> # entry + TP\u002FSL\nperp --json --dry-run -e \u003Cex> trade buy \u003CSYM> \u003CSIZE> --smart             # IOC at best ask + 1 tick (no TP\u002FSL)\n```\n\n> `trade check` does NOT read exchange-set leverage. Always pass `--leverage` explicitly.\n>\n> `--tp` \u002F `--sl` are ABSOLUTE trigger prices (not %). Market entries: every venue (venues that place TP\u002FSL as separate orders need a market \u002F IOC entry); `trade limit --tp\u002F--sl`: ondo \u002F arcus on any entry, elsewhere only with `--tif IOC`. TP\u002FSL on an already open position: `trade tpsl \u003CSYM> long|short --tp \u003CPX> --sl \u003CPX>` (side = the position's side).\n>\n> `--smart` (IOC at best bid\u002Fask ± 1 tick) exists only on pacifica \u002F hyperliquid \u002F lighter \u002F aster, and is refused (`CAPABILITY_UNSUPPORTED`) together with `--tp`\u002F`--sl` or `--client-id`\u002F`--auto-id` — need TP\u002FSL → plain market entry (or `--smart`, then `trade tpsl`).\n>\n> Pacifica basket (pair trade): `perp --json --dry-run -e pacifica trade atomic --long BTC:50 --short ETH:50 --usd 1000` — one batch of market orders, NOT all-or-nothing (a leg can fill while another is refused → `ORDER_PARTIAL`; an unconfirmed leg → `ORDER_PENDING` + quarantine). A batch failure other than HTTP 400 \u002F 429 quarantines every leg. Pacifica's Chase \u002F OCO \u002F Trailing Stop \u002F Swarm \u002F Trigger Swarm \u002F Conditional orders have no documented API \u002F SDK path (as of 2026-10-19); nearest here: `trade twap` (≈ Swarm) and `trade tpsl` (≈ OCO bracket exit).\n\nShow the dry-run output to the user. Wait for confirmation.\n\n#### Minimum order size and tick (not in `market info`; `trade check` and `--dry-run` do NOT enforce the minimum)\n\n| Venue | Min order value (USD notional) |\n|---|---|\n| hyperliquid | $10 (also spot; HIP-4 outcomes: 10 quote tokens) |\n| pacifica | $10 (per market `min_order_size`) |\n| lighter, lighter-rh | $10 (per market `min_quote_amount`; a few markets 0) |\n| aster | $5 (`MIN_NOTIONAL`) |\n| arcus | $5 (`minOrderNotional`; reduce-only exempt; perp-cli refuses below it, `SIZE_TOO_SMALL`) |\n| ondo, qfex | unknown (not published) |\n\nValues read from the venues' public market data on 2026-10-26; keyless MCP `get_markets` (no credentials configured) returns them per market as `minNotional`, with `tickSize` \u002F `minSize`. **Default smallest order = $15 notional** (on every venue, including the $5 ones and the unknown ones): `mark` = `market mid \u003CSYM>`, `step` = `stepSize` from `market info`; `size = ceil(15 \u002F mark \u002F step) × step`, then `trade check` + dry-run. The $15 buffer over the $10 venue minimum absorbs price moves between sizing and the fill, step rounding and fees; below the venue minimum the live order is rejected. Use the bare venue minimum only when the user explicitly asks for it. Anything that splits a position must keep every piece ≥ $15 too: `trade reduce 50` \u002F `scale-tp` \u002F partial `tpsl --size` need a position of ≥ $30 (≥ $15 × number of pieces), and an arb's matched size must clear $15 on both legs. Tick: off-grid limit \u002F trigger prices are refused with `INVALID_TICK` on the live send (never rounded, nothing sent) — Hyperliquid: ≤ 5 significant figures; elsewhere take `tickSize` from keyless MCP `get_markets` or the price steps of `market book \u003CSYM>`.\n\n### Step 5: Execute\n\nAfter explicit user confirmation:\n\n```bash\n# Perp-perp arb: legs are SEQUENTIAL — long first, then the short sized to the verified long fill;\n# reconcile is always on (the long is trimmed reduce-only to the short's verified fill).\n# An unconfirmed leg quarantines the symbol (see \"Safety rules\").\nperp --json arb exec \u003CSYM> \u003ClongEx> \u003CshortEx> \u003CUSD> --smart\n\n# Spot+perp arb (spot has 0 funding cost; spot:\u003Cvenue> = hl, lt, lrh, aster, ondo)\n# ONLY for a spot-perp scan row with direction == \"long-spot-short-perp\": buys spot, shorts the perp.\nperp --json arb exec \u003CSYM> spot:hl hl \u003CUSD>\nperp --json arb exec \u003CSYM> spot:lt pac \u003CUSD>\n\n# Single trade\nperp --json -e \u003Cex> trade buy  \u003CSYM> \u003CSIZE> --smart\nperp --json -e \u003Cex> trade sell \u003CSYM> \u003CSIZE> --tp \u003CPX> --sl \u003CPX>\nperp --json -e \u003Cex> trade split \u003CSYM> buy \u003CUSD> --max-slippage 0.5\n```\n\n#### Orders: limit \u002F status \u002F edit \u002F cancel\n\n```bash\nperp --json -e \u003Cex> trade limit \u003CSYM> buy|sell \u003CPRICE> \u003CSIZE> [--tif GTC|IOC|FOK|ALO] [--reduce-only]   # default GTC\nperp --json -e \u003Cex> account orders                                # open orders + ids\nperp --json -e \u003Cex> trade status \u003CORDER_ID> [--symbol \u003CSYM>]      # --symbol required on ondo \u002F arcus \u002F qfex\nperp --json -e \u003Cex> trade edit \u003CSYM> \u003CORDER_ID> \u003CPRICE> \u003CSIZE>    # SIZE = new open (unfilled) size\nperp --json -e \u003Cex> trade cancel \u003CSYM> \u003CORDER_ID>                 # one order\nperp --json -e \u003Cex> trade cancel \u003CSYM>                            # every order on that symbol\n```\n\nAll of these writes take `--dry-run`. **`trade edit` may return a NEW `orderId` — always continue with the id it returns**: pacifica (ALO → native edit, GTC \u002F TOB → cancel+replace; new id either way, TIF kept), ondo (cancel+replace), qfex (venue assigns a new id); hyperliquid \u002F lighter \u002F lighter-rh \u002F aster \u002F arcus amend natively — use the returned id anyway. `trade edit --tif` only on ondo \u002F pacifica.\n\nHL spot uses U-tokens (`BTC→UBTC`, `ETH→UETH`, `SOL→USOL`) — auto-resolved.\n\n### Step 6: Monitor\n\n```bash\nperp --json arb status                              # open arb positions, PnL, funding earned\nperp --json portfolio                               # cross-exchange equity + risk\nperp --json risk status                             # canTrade, level, violations\nperp --json risk liquidation-distance               # % from liq for ALL positions\nperp --json -e \u003Cex> account positions --address \u003CADDR> [--symbol BTC] [--account-index \u003Cn>]   # keyless, ANY account\nperp --json -e \u003Cex> account balance --address \u003CADDR> [--account-index \u003Cn>]                  # keyless balances of ANY account\n```\n\n`arb status` reads every configured venue and fails as a whole (`EXCHANGE_ERROR`) when one venue's read fails — there is no venue filter; check the venues one by one with `perp --json -e \u003Cex> account positions` and report which one failed. Never read the failure as \"no positions\".\n\n`account positions --address` (keyless, nothing signed; without `-e`: every venue that supports it): hyperliquid (0x; native + every HIP-3 dex, rows carry `dex`), lighter \u002F lighter-rh (0x; every account of the address, rows carry `accountIndex`, narrow with `--account-index`), pacifica (Solana address), risex (0x). Other venues → `CAPABILITY_UNSUPPORTED`. MCP `get_positions_by_address` returns the same rows (HIP-3 included). `account balance --address` (same venues and address rules; MCP `get_balance_by_address`): `data = { exchange, address, balance, spot }` — `balance` = `{ equity, available, marginUsed, unrealizedPnl }` (+ Pacifica `usdcBalance` \u002F `borrowedUsdc` \u002F `pendingInterest` \u002F `availableToWithdraw`), `spot` = token rows or null (RISEx). Hyperliquid: `accountMode` decides equity (unified \u002F portfolio → the spot collateral row; standard \u002F default → perp `accountValue`; read `meta.notes`), `dexes` = HIP-3 dexes with a non-zero value, a failed dex → `meta.errors[\"hip3:\u003Cdex>\"]` + `meta.warnings` (unknown, not zero). Lighter: top-level `balance` \u002F `spot` null, one row per account in `accounts: [{ accountIndex, balance, spot }]`; no account → `[]` + note. `account balance` WITHOUT `--address` is the renamed-command error — your own balance is `perp portfolio`.\n\nIf `risk status.canTrade === false`, do NOT open new positions. If liquidation distance falls below the user's `--min-liq-distance`, recommend reducing position size.\n\nFor continuous monitoring, run `bash scripts\u002Farb-monitor.sh --json`.\n\n### Step 7: Close\n\n```bash\nperp --json arb close \u003CSYM>                                     # perp-perp arb\nperp --json arb close \u003CSYM> --pair \u003ClongEx>:\u003CshortEx>           # disambiguate\nperp --json arb close \u003CSYM> --spot-exch hl --perp-exch hl       # spot+perp\nperp --json arb close \u003CSYM> --smart                             # IOC limits\nperp --json arb close \u003CSYM> --force                             # quarantined symbol — only after the user checked positions\nperp --json arb close \u003CSYM> --state-only --yes                  # drop a stale state entry (arb status staleStateEntries); sends no order\n\n# Single trade (dry-run first, then confirm)\nperp --json -e \u003Cex> trade close \u003CSYM>                           # close one symbol\nperp --json -e \u003Cex> trade close-all                             # close all positions on this exchange\nperp --json -e \u003Cex> trade flatten                               # cancel ALL orders, then close ALL positions\n```\n\n`trade close` \u002F `close-all` close positions only — perp-cli does not cancel resting TP\u002FSL \u002F stop \u002F limit orders (QFEX lists the leftovers as a WARNING). After a close, run `account orders` and cancel what is left (`trade cancel \u003CSYM> \u003Cid>`), or use `trade flatten`, which cancels every order on the venue first.\n\n### Pacifica Print and vaults (`perp print`, `perp vault`)\n\nPacifica-only, details in `references\u002Fcommands.md`. Reads first (`print games`, `print quote`, `print positions`, `vault list|info|positions`); every write is `--dry-run` first and needs the user's confirmation:\n- **Print** (`print deposit \u003Cgame> long|short \u003Cusd> --strike \u003Cpx> --leverage \u003Cn> [--cycles 1-1000]`) locks the deposit until a fill or until a cancel settles at the END of the running cycle (up to 30 days on `BTC_1M`). Before asking, show the user: cycle length, `--cycles`, leverage, `maxLoss` (deposit + premiums), and that `docsLiquidationPrice` is only an outer bound (a liquidation was observed earlier in one live case; the venue trigger is unpublished). Checkpoint-only evaluation applies while resting; after a fill it is an ordinary position in the main account (continuous liquidation, nets with an existing position) — `account positions`. The premium is not quoted by perp-cli. `print cancel` uses an UNOFFICIAL endpoint: live runs need `--unverified-endpoint`.\n- **Vaults** (`vault deposit \u003Cvault> \u003Cusd>`, `vault withdraw \u003Cvault> \u003Cshares>|--all`): third-party trading pools (can lose the whole deposit); every deposit restarts the lock-up for the whole balance; withdrawals only go to the own account, inside the vault's window. **`vault deposit` is master-only** (never an agent key). Pass the vault ADDRESS and confirm the shown manager with the user — nicknames are not unique (an ambiguous one is refused with the candidates).\n- `ORDER_PENDING` on any of them → NEVER resubmit with a new key; check `print positions` \u002F `vault positions` against `error.details.before`. The only safe retry is the same command with `--idempotency-key \u003Creported key>` (dedupe window unverified).\n\n### Funds workflow (deposit \u002F withdraw \u002F transfer \u002F bridge \u002F rebalance)\n\nAll money movement lives under `perp funds`:\n\n```bash\n# Exchange in\u002Fout\nperp --json funds deposit hyperliquid 100\nperp --json funds deposit pacifica 100\nperp --json funds deposit lighter ethereum 100              # L1 direct\nperp --json funds deposit lighter cctp arbitrum 100         # via CCTP\nperp --json funds withdraw hyperliquid 100 [--chain arbitrum|ethereum|base]   # CCTP to your own wallet\nperp --json funds transfer 100 \u003CADDRESS>                    # HL internal (instant) — allowlisted destinations only\n\n# Cross-chain bridge (auto-cheapest cctp\u002Frelay\u002Fdebridge)\nperp --json funds bridge quote --from solana --to arbitrum --amount 100\nperp --json funds bridge send  --from solana --to arbitrum --amount 100\nperp --json funds bridge status \u003CorderId>                   # poll until success\n\n# Inter-exchange rebalance\nperp --json funds rebalance check\nperp --json funds rebalance plan\nperp --json --dry-run funds rebalance execute --auto-bridge   # status \"simulated\" (moves[].status \"dry_run\"), or \"balanced\" (nothing to move)\nperp --json funds rebalance execute --auto-bridge             # withdraw → bridge ONLY; no deposit\n```\n\nAlways run `funds bridge quote` before `funds bridge send` so the user sees fees + ETA.\n\n- `funds rebalance execute` returns `ok:true` even when a move failed: check EVERY `moves[].status` (`withdrawn`, `bridged`, `same_chain`, `needs_bridge`, `withdraw_failed`, `bridge_failed`). It never deposits — after the bridge arrives, deposit manually (`funds deposit \u003Cvenue> \u003Camt>`).\n- `funds transfer \u003Camt> \u003Caddr>` (HL) and `funds withdraw hyperliquid --to \u003Cother address>` require the destination on the `settings withdraw.hyperliquid` allowlist (`POLICY_DENIED` otherwise). Only the user can set it, in an interactive terminal (`--json` \u002F piped → `POLICY_DENIED`). NEVER try to set or change `withdraw.\u003Cvenue>` yourself.\n- HL withdraw goes over CCTP (native USDC); on Arbitrum a 0.2 USDC forwarding fee is deducted (an amount ≤ the fee → `SIZE_TOO_SMALL`).\n- Bridges: exactly `--amount` leaves the wallet (fees come out of it); a deBridge `nativeFee` is shown separately and is paid in the source chain's native token. Solana-origin deBridge is refused (`NO_BRIDGE_ROUTE`) → `--provider cctp`. `--fast` = fast CCTP finality (higher fee).\n- `funds bridge exchange --from \u003Cex> --to \u003Cex>` bridges the master wallet's OWN USDC between the venues' chains (pacifica → solana, lighter → arbitrum); it does NOT withdraw from \u002F deposit into Pacifica or Lighter. Exception hyperliquid: `--from hyperliquid` spends HyperCore spot USDC, `--to hyperliquid` credits HyperCore perps. HyperCore → Solana is refused (`NO_BRIDGE_ROUTE`).\n\nRelay swaps between assets (`--from-asset` \u002F `--to-asset`, chains `robinhood`, `arbitrum`, `bsc`, `base`, destination `solana`): run `perp --json --dry-run funds bridge send ...` first — it prints the locally verified quote (amount in, expected out, protocol-guaranteed minimum, fees, ETA) and the min-out verdict without loading a key. Stable → native (e.g. USDG → SOL \u002F ETH) needs `--min-out`. The recipient is always the master wallet's own address; an `ORDER_PENDING` result carries the Relay request id — never bridge again before checking it.\n\n### Strategy engine (20 algorithms + scripted plans)\n\n```bash\nperp strategy list-strategies                                 # 20 registered\nperp strategy run \u003Cstrategy> [symbol]                         # run any strategy (multi-venue: --exchanges must include the -e venue)\nperp --json --dry-run strategy run \u003Cstrategy> [symbol]        # simulate: actions logged, never sent\nperp strategy apex [symbol]                                   # APEX orchestrator\nperp strategy reflect                                         # performance analysis\nperp --json strategy plan validate \u003CFILE>                     # validate scripted plan\nperp --json strategy plan execute \u003CFILE> --dry-run            # dry-run scripted plan\n```\n\n**Strategies:** `grid`, `dca`, `simple-mm`, `engine-mm`, `avellaneda-mm`, `regime-mm`, `grid-mm`, `liquidation-mm`, `momentum-breakout`, `mean-reversion`, `aggressive-taker`, `funding-arb`, `funding-arb-v2`, `funding-auto`, `basis-arb`, `spot-perp-arb`, `hedge-agent`, `rfq-agent`, `claude-agent`, `apex`.\n\nBackground daemon (tmux):\n\n```bash\nperp --json --dry-run arb auto --min-spread 30 --size 100     # simulate first (--background inherits --dry-run)\nperp --json arb auto --min-spread 30 --size 100 --background\nperp --json background list\nperp --json background logs \u003Cid> -f\nperp --json background stop \u003Cid> [--timeout 90]   # graceful: SIGINT, job cancels its orders, waits, reports what is left on the venue\n```\n\n`strategy funding-arb` is monitor-only unless `--auto-execute`. Bots: `equity` is `null` when a balance read fails — arb strategies then skip new entries and the bot stops after 10 consecutive unknown ticks; `ordersPlaced` counts orders sent, `fills` only venue-reported fills — a resting order is placed, not filled.\n\nBackground jobs inherit the parent's `-n`, `--dry-run`, `-e`, `--ows`, `-w`, `--no-agent`, `--dex`, and never receive key material (argv\u002Fenv): they resolve credentials from the OWS vault \u002F agent keystores \u002F `~\u002F.perp\u002F.env` themselves. `--background` with `-k`, `--passphrase`, `--ows-key` or a shell-exported key \u002F `OWS_PASSPHRASE` → `INVALID_PARAMS` — register an agent (`perp wallet agent approve \u003Cvenue>`), which signs without the master passphrase.\n\n### Position sizing & safety\n\n- Single position notional \u003C **80%** of that exchange's available balance.\n- Leverage 1–3x for arb; never above 5x for arb positions.\n- `arb exec` sizes the short to the verified long fill and always reconciles; still check `arb status` (`unconfirmedPairs`, `staleStateEntries`) afterwards.\n- ALWAYS follow `longExch`\u002F`shortExch` (perp-perp) or `longExchange`\u002F`shortExchange` (`--rates` \u002F `--compare`) — NEVER reverse direction. Spot-perp: only `direction == \"long-spot-short-perp\"`.\n- NEVER enter if `netSpread \u003C= 0` or `netSpread \u003C estimated round-trip slippage`.\n- Capital that's mid-bridge is \"at risk\" and unhedged — factor it in.\n\nFor deeper risk-management framework, read `references\u002Fstrategies.md`.\n\n## Examples\n\n### Example 1: \"Find funding-rate arb opportunities\"\n\n```bash\n# 1. Discover\nperp --json arb scan --min 10 --top 10\n# 2. Show top 3 to user; ask which to evaluate\n# 3. Check balances on the two exchanges\nperp --json portfolio -e \u003ClongEx>\nperp --json portfolio -e \u003CshortEx>\n# 4. Recommend size + dry-run\nperp --json --dry-run arb exec BTC \u003ClongEx> \u003CshortEx> 100\n# 5. After user confirmation:\nperp --json arb exec BTC \u003ClongEx> \u003CshortEx> 100 --smart\nperp --json arb status\n```\n\n### Example 2: \"ETH spot+perp arb, $100\"\n\n```bash\nperp --json arb scan --mode spot-perp --min 0       # ETH row must say direction \"long-spot-short-perp\"\nperp --json --dry-run arb exec ETH spot:hl hl 100\n# → show dry-run, ask confirmation\nperp --json arb exec ETH spot:hl hl 100\nperp --json arb status\n# Later, to close both legs:\nperp --json arb close ETH --spot-exch hl --perp-exch hl\n```\n\n### Example 3: \"Long SOL 0.5 on Hyperliquid with 2x leverage\"\n\n```bash\nperp --json -e hl trade check SOL buy 0.5 --leverage 2\nperp --json --dry-run -e hl trade leverage SOL 2 --isolated\nperp --json --dry-run -e hl trade buy SOL 0.5 --smart\n# → show both dry-runs (isolated 2x + the order), ask confirmation; only then:\nperp --json -e hl trade leverage SOL 2 --isolated\nperp --json -e hl trade buy SOL 0.5 --smart\nperp --json -e hl account positions\n```\n\n### Example 4: \"Move 500 USDC from Pacifica to Hyperliquid\"\n\n```bash\nperp --json --dry-run funds withdraw pacifica 500\nperp --json funds bridge quote --from solana --to arbitrum --amount 500\n# → show the withdraw plan + bridge fee \u002F ETA, ask confirmation; only then:\nperp --json funds withdraw pacifica 500\nperp --json funds bridge send  --from solana --to arbitrum --amount 500\nperp --json funds bridge status \u003CorderId>             # poll until completed\nperp --json funds deposit hyperliquid 500\n```\n\n`funds rebalance execute --auto-bridge` only withdraws and bridges — check every `moves[].status`, then deposit by hand (`funds deposit hyperliquid \u003Camt>`) after the bridge arrives.\n\n### Example 5: \"Run a delta-neutral funding bot in background\"\n\n```bash\nperp --json --dry-run arb auto --min-spread 30 --close-spread 5 --size 100 --max-positions 5\n# → show the simulation, ask confirmation\nperp --json arb auto --min-spread 30 --close-spread 5 --size 100 --max-positions 5 --background\nperp --json background list\nperp --json background logs \u003Cid> -f\n# To stop:\nperp --json background stop \u003Cid>\n```\n\n## Troubleshooting\n\nEvery response is `{ \"ok\": true, \"data\": ... }` or `{ \"ok\": false, \"error\": { \"code\": \"...\", \"retryable\": true|false, \"remediation\"?: \"...\" } }`; `ok:false` exits 1. Always check `ok` first and follow `error.remediation`. `retryable: true` → wait and retry ONCE, and only for read-only commands — a write is never blindly retried.\n\n| Error code | Meaning | Action |\n|---|---|---|\n| `ORDER_PENDING` | A write was sent, outcome unknown | NEVER resubmit. See \"Safety rules\". |\n| `ORDER_PARTIAL` | Part of a multi-leg \u002F close succeeded | Don't retry; check positions per venue, close residuals by hand (may be quarantined). |\n| `ORDER_REJECTED` \u002F `ACTION_REJECTED` | Definitely not placed \u002F not executed | Fix the cause from `error.message`; a new attempt is a new decision (ask the user). |\n| `RISK_VIOLATION` | Local risk limit breached, or symbol quarantined | Report to the user. `--force` only with explicit user consent, and never bypasses quarantine. |\n| `CAPABILITY_UNSUPPORTED` | Venue\u002Ffeature combination not offered | Do NOT work around it (no emulation via other orders\u002Fvenues); tell the user. |\n| `INVALID_TICK` | Limit\u002Ftrigger price off the venue grid (HL: ≤ 5 significant figures) | Refused, never rounded — re-price on the grid and confirm with the user. |\n| `INVALID_PARAMS` | Bad argument (incl. strict sizes: `1,000` \u002F `1e3` \u002F `10abc` refused; `--dry-run` on a command without dry-run) | Fix the argument. |\n| `CLI_ERROR` | Command parse error (unknown command \u002F missing option) | Check `\u003Ccmd> --help`. |\n| `NO_SIGNER_AVAILABLE` | No key that may sign this (e.g. imported agent key for a master-only action) | User does it on the website, or `perp wallet import`s the master. |\n| `AGENT_NOT_REGISTERED` \u002F `AGENT_EXPIRED` | Agent key missing, on the other network, or expired | Follow `remediation`: master on this computer → `perp wallet agent approve \u003Cvenue> [--rotate]` (master-signed: user consent); imported key → new key on the website, `wallet agent import \u003Cvenue> --replace`. |\n| `POLICY_DENIED` | Local withdraw gate \u002F OWS policy refused | Never change `withdraw.\u003Cvenue>` — only the user can, in a terminal. |\n| `PASSPHRASE_REQUIRED` | Vault passphrase needed | Ask the user to provide `OWS_PASSPHRASE` (or stdin); never put it on argv. |\n| `LOCK_HELD` | Another perp process holds a state lock | Wait ~5s and retry once; check `background list`. |\n| `NO_BRIDGE_ROUTE` | No supported bridge route (e.g. deBridge from Solana, HyperCore → Solana) | Use the route in `remediation` (e.g. `--provider cctp`). |\n| `RATE_LIMITED` \u002F `EXCHANGE_UNREACHABLE` | Throttled \u002F API down (reads) | Wait 5–10s (or `retryAfterMs` when present — Pacifica sets it from its credit headers), retry once; then skip that venue. |\n| `INSUFFICIENT_BALANCE` | Not enough collateral on that venue | Reduce size or move funds first (user-confirmed). |\n| `SYMBOL_NOT_FOUND` | Not listed on this venue | `market list`. Don't add `-PERP`. |\n| `SIZE_TOO_SMALL` | Below venue minimum (HL TWAP: $100 total) | Compute `size × price`; raise size (minimum table in Step 4). |\n| `UNKNOWN` | Unclassified failure (the message matched no known code) | Read `error.message`. After a write: treat the outcome as unknown — check `account orders` \u002F `account positions` \u002F `portfolio` before anything else, never resubmit blindly; report to the user. |\n\nLighter \u002F Lighter RH \"account not found\" (venue code `21100`): the address has no account on that venue \u002F network — the user must fund (create) the account first, then `perp wallet agent approve lighter` (or `lighter-rh`).\n\n`--client-id` (`trade market\u002Fbuy\u002Fsell\u002Flimit`): an id already recorded in `~\u002F.perp\u002Fclient-ids.jsonl` (and not marked failed) returns `ok:true` with `data.duplicate: true` and sends nothing — local tracking only, not a venue check (it is NOT a `DUPLICATE_ORDER` error). Formats: Pacifica a full UUID, Hyperliquid `0x` + 32 hex; QFEX refuses `--client-id` (use `--auto-id`); `--smart` + client id → `CAPABILITY_UNSUPPORTED`.\n\n## Safety rules\n\n- **Unknown outcome (`ORDER_PENDING`) on ANY write** — orders, cancels, edits, leverage, withdraw \u002F deposit \u002F bridge \u002F transfer: do NOT resubmit. Check `perp --json -e \u003Cex> trade status c:\u003Cid> --symbol \u003CS>` (the id in `remediation`), `account orders` \u002F `account positions` \u002F `portfolio`, and the tx hash \u002F request id in `error.details` (`funds bridge status \u003Cid>` for bridges). Report to the user.\n- **Quarantine**: an unknown or unhedged outcome (arb, bots, `trade close`, `trade multi`, `trade atomic`) quarantines the symbol — global per symbol, scoped by network. It blocks opening orders, `arb exec`, `arb auto` and bots (`RISK_VIOLATION`); reduce-only orders pass. List: `perp --json strategy quarantine`. Clear only after the USER has verified the positions on the venues: `perp --json strategy quarantine-clear \u003CSYM>`. `arb close` on a quarantined symbol needs `--force`.\n- **Risk gate**: `trade market \u002F buy \u002F sell \u002F limit \u002F split \u002F market --split \u002F scale-in \u002F twap \u002F multi \u002F atomic \u002F stop --no-reduce-only` check `~\u002F.perp\u002Frisk.json` (`perp risk limits ...`); reduce-only is exempt. `--force` bypasses the limits (never quarantine) — only with explicit user consent.\n- **Stops** (`trade stop`, `tpsl`) are reduce-only by default; `--no-reduce-only` is refused on ondo and qfex. `trade tpsl \u003CSYM> long|short` = the OPEN position's side; legs are sized to the live position.\n- **Dry-run is default-deny**: commands that cannot simulate refuse `--dry-run` with `INVALID_PARAMS` (e.g. `trade twap`, `trade multi`, `trade cancel-stop`, `trade cancel-twap`, `strategy start \u002F preset \u002F grid \u002F dca \u002F quick-* \u002F funding-arb`, `wallet agent approve`, `wallet rotate`). Simulate bots with `perp --json --dry-run strategy run \u003Cstrategy>` \u002F `perp --json --dry-run arb auto`.\n- **A dry-run is not a full venue check**: it validates arguments, the risk gate and quarantine, but some venue rules are enforced only on the live send — e.g. an off-grid limit price (`INVALID_TICK`) or `--no-reduce-only` on ondo \u002F qfex (`CAPABILITY_UNSUPPORTED`). Those refusals happen before anything is sent.\n- **`wallet rotate`** creates a new wallet and transfers assets, with no dry-run — only on the user's explicit request.\n\n### Common mistakes\n\n- **Forgetting `--json`** → output becomes unparseable human text. The very first thing to check when parsing fails.\n- **Using legacy command names** — `arb rates`\u002F`arb prices`\u002F`arb dex`\u002F`arb spot-exec`\u002F`arb spot-close` are removed. Use `arb scan --rates|--gaps|--hip3` and `arb exec spot:\u003Cexch>` \u002F `arb close \u003CSYM> --spot-exch \u003Cex>`.\n- **Calling `trade check` without `--leverage`** → cost estimate doesn't match what the exchange applies.\n- **Retrying a non-idempotent trade** without checking `account positions` → opens a duplicate position.\n- **Bridging without quoting first** → user sees no fee\u002FETA and can't approve cleanly.\n- **Treating `bridge send` as instant** → always `funds bridge status \u003CorderId>` before depositing on the destination.\n- **Manually adding `-PERP` suffix** → CLI auto-resolves; let it.\n\nFor a full troubleshooting + non-interactive flow guide, read `references\u002Fagent-operations.md`.\n\n## Referrals (optional, ask once per setup)\n\n```bash\nperp --json --dry-run -e hyperliquid wallet manage referral set   # preview (nothing signed)\nperp --json -e hyperliquid wallet manage referral set [code]      # signs + sends ONE referral action\nperp --json -e lighter wallet manage referral set [code]          # Lighter (needs an agent key)\n```\n\nReferral codes are never applied implicitly (adapter creation signs nothing). When the user first sets up a wallet, ask:\n> \"perp-cli development is supported by optional referrals. Apply the referral code? It signs one referral action on the venue; no extra fees — only exchange rebates are used.\"\n\n## Builder fees (OFF by default — never enable on your own)\n\nBuilder fees are extra fees on the USER's perp orders, paid to a third-party builder. perp-cli attaches none unless the user explicitly set `settings builder.\u003Cvenue>` AND the venue approval is confirmed. Do not configure or approve a builder unless the user asks for it.\n\n```bash\nperp --json wallet builder status [venue]                 # support, config, approval, attaches?\nperp --json --dry-run wallet builder approve \u003Cvenue>      # plan only — show it to the user\nperp --json wallet builder approve \u003Cvenue> --yes          # only after explicit user consent (master-signed)\nperp --json --no-builder -e \u003Cex> trade market BTC buy 0.1   # one run without the fee\n```\n\nqfex: `builder.qfex \u003Cuuid>` is a fee share (no extra fee, no approval; mainnet only). Unsupported: lighter, lighter-rh, arcus (`CAPABILITY_UNSUPPORTED`). An order whose approval is missing or unknown is sent without the fee (`execution.notes`); `execution.builderFee` records what was attached.\n\n## MCP Server\n\nThe package also ships a 30-tool MCP server (no API keys required for read-only market data — `get_markets`, `get_orderbook`, `get_funding_rates`, `get_prices`, `get_outcome_markets`, `get_outcome_view`, `get_outcome_book`, `get_option_expiries`, `get_option_chain`, `get_option_quote` (Derive options), the read-only Pacifica Print \u002F vault tools `pacifica_print_products`, `pacifica_print_quote`, `pacifica_print_positions`, `pacifica_vaults`, plus 16 account\u002Fadvisor tools, incl. keyless `get_positions_by_address`):\n\nMCP `portfolio` totals (`totalEquity`, `totalAvailable`, `totalMarginUsed`, `totalUnrealizedPnl`, `riskMetrics.marginUtilization`) are `null` when no balance was read — check `accountState` (`\"ok\"` | `\"unread\"` = credentials but no balance read | `\"noAccount\"`) and `totalsCover` (the venues the totals include) before quoting a total. The CLI `portfolio` shape differs: `totals.{equity,marginUsed,marginPct,funding24h,fundingIncomplete}`, `risk.{level,marginPct}`.\n\nMCP network: `PERP_NETWORK=mainnet|testnet` (validated; unset = mainnet); every result's `meta.network` says which. The only write tools, `trade_execute` \u002F `trade_close`, run the same local risk gate as `perp trade` (no override over MCP), refuse non-reduce-only orders on quarantined symbols, and log every order.\n\n```json\n{\n  \"mcpServers\": {\n    \"perp-cli\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"-p\", \"perp-cli\", \"perp-mcp\"]\n    }\n  }\n}\n```\n\n**`perp-guardrail`** (third binary): not run by hand — the OWS Policy Engine spawns it before an agent API key signs anything; it allows \u002F denies by chain + contract whitelist, per-tx and daily USD limits, withdrawal limits and blocked selectors. Set it up through `perp wallet setup` or `perp wallet policy create --perp-defaults`; it is a second line of defence, not a replacement for perp-cli's risk gate.\n\n[![Glama MCP server](https:\u002F\u002Fglama.ai\u002Fmcp\u002Fservers\u002Fhypurrquant\u002Fperp-cli\u002Fbadges\u002Fscore.svg)](https:\u002F\u002Fglama.ai\u002Fmcp\u002Fservers\u002Fhypurrquant\u002Fperp-cli)\n","# perp-cli\n\nMulti-DEX perpetual futures CLI + MCP server for Pacifica (Solana), Hyperliquid (HyperEVM), Lighter (Ethereum), Aster (BNB Chain), Lighter RH (`lighter-rh`, Robinhood chain, USDG), Ondo Perps (`ondo`), QFEX (`qfex`, custodial TradFi perps — import-only API key; resting reduce-only limits and automation are refused for now, see \"QFEX\" below), Arcus (`arcus`, Robinhood chain, USDG), RISEx (`risex|rise`, RISE chain, USDC — trading through a trading-only session signer, not yet verified on mainnet; deposits \u002F withdrawals in the RISEx app only, see \"RISEx\" below), TxFlow (`txflow|txf`, official API (Beta) — manual trading with an approved agent key, verified on testnet only; mainnet whitelisted; see \"TxFlow\" below), Variational Omni (`variational|var|omni`, MARKET DATA ONLY through its official read-only API — RFQ venue, no public trading API yet, see \"Variational\" below), GRVT (`grvt|grv`, MARKET DATA ONLY in this version through its official API — trading is planned for a later release, see \"GRVT\" below), Extended (`extended|ext|x10`, Starknet, formerly X10 — MARKET DATA ONLY in this version through its official public API, see \"Extended\" below). v0.13.0+ also supports Hyperliquid Outcome markets (HIP-4) — fully-collateralized binary\u002Frange contracts; each outcome's quote token comes from `outcomeMeta.quoteToken` (USDC on every listed outcome as of 2026-10-12), minimum order value 10 quote tokens.\n\n## Instructions\n\n### When to use this skill\n\nActivate whenever the user wants to do anything against perp-cli, including: scanning funding-rate arbitrage, executing perp-perp or spot+perp legs, running long-running strategy bots, moving USDC between chains\u002Fexchanges, checking account\u002Fportfolio state, configuring wallets, or troubleshooting any of the above.\n\n**Do NOT** answer trading questions from memory — always run the actual CLI command and parse its JSON output.\n\n### Reference files (load only when needed)\n\nThis skill uses progressive disclosure. Read these on demand:\n\n- `references\u002Fcommands.md` — full command tree for every group (market, account, trade, outcome, options, print, vault, arb, funds, wallet, risk, history, strategy, background, alerts, settings, backtest)\n- `references\u002Fagent-operations.md` — non-interactive setup flows, idempotency rules, error codes, common mistakes\n- `references\u002Fstrategies.md` — funding-arb decision framework + risk-management playbook (read before designing arb strategy)\n- `references\u002Fws-library.md` — WebSocket library (shipped since 0.15.0, @experimental), published standalone as **`@hypurrquant\u002Fperp-ws`** (zero dependencies; recommended for integrators — `npm install @hypurrquant\u002Fperp-ws`) and inside perp-cli as `perp-cli\u002Fws` (same code, use it when perp-cli is already installed): build a live dashboard \u002F funding comparison \u002F account feed in the browser or Node (streams, events, nullability, comparator, user channels, errors, capability matrix). Cross-venue subscriptions use `canonicals` (e.g. `{ kind: \"allMarkets\", canonicals: [\"BTC\"] }`), never `symbols` (those are per-venue directory symbols); always surface `ready` rejections — an `idle` venue is not \"fine\"\n\nAlso bundled under `scripts\u002F`: `preflight.sh`, `arb-monitor.sh`, `funding-analysis.sh`, `spot-perp-scan.sh`, `validate-arb.sh`. Use these for repeatable multi-step diagnostics. They need `perp` on PATH (else they exit 1 with `PERP_NOT_FOUND` — ask the user to install it) and exit non-zero on a failed read; `funding-analysis.sh` \u002F `spot-perp-scan.sh` take `-n mainnet|testnet`, `spot-perp-scan.sh --no-portfolio` scans without a wallet.\n\n### Critical rules\n\n1. **Always pass `--json`.** Without it, output is human-formatted and hard to parse. `ok:false` also exits 1.\n2. **Always pass `-e \u003Cvenue>`** on venue-scoped commands. The default is `settings.defaultExchange`, else `pacifica` — never rely on it.\n3. **Always run `--dry-run` first** for any mutating command that supports it, show the result, get user confirmation, then execute without `--dry-run`. `--help` is NOT a reliable indicator — the 0.16.0 list: every `trade` write (market \u002F buy \u002F sell \u002F limit \u002F split \u002F cancel \u002F cancel-all \u002F stop \u002F tpsl \u002F scale-tp \u002F scale-in \u002F edit \u002F atomic \u002F leverage \u002F close \u002F close-all \u002F flatten \u002F reduce \u002F spot-buy \u002F spot-sell \u002F spot-limit \u002F spot-cancel \u002F spot-transfer), `arb exec|close|auto|rebalance`, `funds deposit|withdraw|transfer|faucet|bridge send|bridge exchange|rebalance execute|address-book add`, `outcome buy|sell`, `print deposit|cancel`, `vault deposit|withdraw`, `wallet builder approve|revoke`, `wallet manage referral set`, `strategy run`, `strategy plan execute`. Everything else (read-only commands too; `trade twap|multi|cancel-stop|cancel-twap`; the moved stubs `wallet manage lake deposit|withdraw` → use `vault deposit|withdraw`) refuses `--dry-run` with `INVALID_PARAMS` — that refusal means \"unsupported\", nothing ran (see \"Safety rules\").\n4. **Always use `--fields`** when you only need specific data — saves tokens.\n5. **Avoid bare `perp setup` \u002F `perp init` \u002F `perp wallet setup`** — they prompt and will hang an agent. Use `printf '%s' \"$KEY\" | OWS_PASSPHRASE=\u003Cpp> perp --json wallet set \u003Cexchange>` for key registration (key on stdin; a key on argv or `-k` is rejected), or `perp --json setup --non-interactive --wallet \u003Cows-wallet> --venues \u003Clist> [--default-venue \u003Cv>] [--slippage-bps \u003Cn>] [--slippage \u003Cvenue>=\u003Cbps>]` (new wallet: `--wallet-name \u003Cname>` with the passphrase in `OWS_PASSPHRASE`; agent registration only with `--approve-agents --yes`, after user confirmation) (and `OWS_PASSPHRASE=\u003Cpp> perp wallet setup --name \u003Cn> --max-tx-usd \u003Cusd> --max-daily-usd \u003Cusd>`) when the wizard is required. The passphrase goes in `OWS_PASSPHRASE` or stdin — the root `--passphrase` flag is deprecated (visible in `ps`).\n6. **NEVER trade without explicit user confirmation.** A dry-run is not consent.\n7. **NEVER read `~\u002F.perp\u002F.env` or other key files.** The CLI reads them — you should not.\n8. **NEVER manually add `-PERP` suffix** to symbols. Use bare names (`BTC`, `SOL`, `ICP`); the CLI resolves exchange-specific naming.\n9. **NEVER resubmit after `ORDER_PENDING`** (or any unknown outcome). See \"Safety rules\".\n\n### Step 1: Verify install, version, venue health\n\n```bash\nperp --version         # must be >= 0.17.0\nperp --json health     # keyless venue connectivity\n```\n\nIf `perp` is missing or older, STOP and ask the user to install \u002F upgrade it (`npm install -g perp-cli`) — never install it yourself and never switch to `npx`. `health`: `data.healthy` = every OFFICIAL-API venue is up (use this); `allHealthy` also counts unofficial APIs (listed under `unofficial[]`; none at present). Market-data-only venues (e.g. TxFlow) count toward `healthy` too — a venue you are not using being down is not a reason to stop; `skipped[]` = venues with no environment on this network (not probed). Don't use a venue whose `exchanges[].status` is not `\"ok\"`.\n\n### Step 2: Verify wallet + balance\n\n```bash\nperp --json wallet show               # with an OWS wallet, `exchanges: []` is normal — owsActiveWallet serves every venue\nperp --json portfolio -e \u003Cvenue>      # per-exchange perp.available (aliases like hl \u002F pac accepted)\n```\n\nIf any required exchange is missing, register it (user supplies the key):\n\n```bash\nprintf '%s' \"$EVM_HEX_KEY\" | OWS_PASSPHRASE=\u003Cpp> perp --json wallet set hl          # Hyperliquid \u002F Lighter \u002F Aster (EVM)\nprintf '%s' \"$SOLANA_BASE58_KEY\" | OWS_PASSPHRASE=\u003Cpp> perp --json wallet set pac   # Pacifica (Solana)\n```\n\nThe key is read from stdin (never argv — an argv key is rejected) and imported into the OWS vault; the imported wallet becomes `owsActiveWallet`, which serves every venue. The same EVM key works for Hyperliquid, Lighter and Aster. Lighter trading additionally needs `perp wallet agent approve lighter`.\n\nLighter RH \u002F Ondo Perps \u002F Arcus have no `wallet set` path — register an agent \u002F API key (user runs it; Ondo reads key id + secret from stdin):\n\n```bash\nperp --json wallet agent approve lighter-rh\nprintf '%s\\n%s\\n' \"$KEY_ID\" \"$SECRET\" | perp --json wallet agent approve ondo\nperp --json wallet agent approve arcus --master \u003Cows-wallet>   # address must be on the Arcus access whitelist\n```\n\n**No master wallet on this computer?** The user can create the agent \u002F API key on the exchange website and import it — key on stdin only, verified against the venue before it is stored (`verification.status` is `\"unverified\"` only for Pacifica, which lists bindings master-signed only):\n\n```bash\nprintf '%s' \"$AGENT_KEY\" | perp --json wallet agent import hyperliquid               # master read from HL\nprintf '%s' \"$AGENT_KEY\" | perp --json wallet agent import aster --master-address 0x…  # also Aster testnet\nprintf '%s' \"$AGENT_KEY\" | perp --json wallet agent import pacifica --master-address \u003CSOL>\nprintf '%s' \"$API_KEY\" | perp --json wallet agent import lighter --account-index \u003Cn> --api-key-index \u003Cslot>\nprintf '%s' \"$ED25519_KEY\" | perp --json wallet agent import arcus --master-address 0x…\n```\n\nImported keys trade; `funds deposit|withdraw|transfer|bridge`, `wallet manage referral set` and `wallet agent approve` need the master → `NO_SIGNER_AVAILABLE` (tell the user to do it on the website or `perp wallet import` the master). `wallet agent revoke` of an imported key needs `--local-only` and does NOT revoke it on the exchange; `rotate` is refused (new key on the website → `import --replace`).\n\n**QFEX** (`-e qfex`, testnet = QFEX UAT): keys are created on the QFEX website and imported by the USER (`perp wallet agent import qfex [--account-id \u003Cuuid>]` — the resolved account UUID must be confirmed). Rules an agent must follow:\n- Works: market \u002F IOC reduce-only closes (`trade close\u002Fclose-all\u002Fflatten\u002Freduce`), reduce-only stop-market orders (`trade stop`, `trade tpsl` TP\u002FSL legs, `--tp\u002F--sl` as separate stops after the verified fill; cancel with `trade cancel \u003CS> \u003Cid>` or `trade cancel-stop`), `trade edit` of a plain LIMIT \u002F ALO (the venue assigns a new order id; the client id is kept).\n- Refused with `CAPABILITY_UNSUPPORTED` (do not work around): resting reduce-only limits (GTC \u002F ALO \u002F FOK, `scale-tp`), stop-limit and opening stops, amend of a reduce-only order, `--client-id`, non-USD-quoted markets, unattended automation (bots \u002F plans \u002F TWAP \u002F DCA \u002F grid \u002F background jobs), QFEX as a funding-arb \u002F funding-bot leg.\n- After a close, reduce-only \u002F stop orders left on a now-flat symbol are listed as a WARNING (the venue does not cancel them) — cancel them, or use `trade flatten`, which cancels them.\n- Limit GTC \u002F ALO returns `status: accepted, finality: pending` after the ACK; `open` only via `perp --json trade status c:\u003Cid> --symbol \u003CS> -e qfex`.\n- `ORDER_PENDING` = outcome unknown: NEVER resubmit; check with the `c:\u003Cid>` in the remediation.\n- Funding rates on QFEX are unverified: excluded everywhere unless `perp --json arb scan --rates --include-unverified` (display only).\n- Withdrawals are disabled in perp-cli for now: `funds withdraw qfex` → `CAPABILITY_UNSUPPORTED` (also under `--dry-run`). Withdraw in the QFEX web app. Ondo Perps has no API withdrawals either.\n\n**RISEx** (`-e risex`, testnet = `-n testnet`, official API): orders are signed by a session SIGNER that the user registers with the master wallet (`perp wallet agent approve risex --master \u003Cows-wallet> [--expires-in 30d]`, default 30 days). Mainnet RISEx trading has NOT been verified with real funds yet (testnet-verified 2026-10-14): ask the user before placing mainnet RISEx orders. Rules an agent must follow:\n- Approve = master signs RegisterSigner (+ the new signer's VerifySigner), then the signer is restricted ON-CHAIN to trading only (it signs DisablePermission for every other permission; the MASTER sends those transactions and needs a little ETH on RISE chain for gas — `INSUFFICIENT_BALANCE` before anything is registered otherwise). Only the master can re-enable a permission. If the restriction fails, the signer is revoked automatically; `APPROVE_PARTIAL` means it could not be — tell the user to revoke it in the RISEx app.\n- **Never interrupt `wallet agent approve risex`** (no Ctrl-C, no timeout kill, no closing the terminal): between registration and the last DisablePermission transaction the signer briefly holds FULL permissions (including fund movement). If it was interrupted anyway: run `perp --json wallet agent verify risex` — `POLICY_DENIED` or an unknown signer means revoke it now (`perp wallet agent revoke risex \u003Cname>`, or in the RISEx app for a signer perp-cli did not record), then approve again.\n- Trading-only is proven from the raw on-chain permission bitmap (the bits of permissions 0, 3 and 4 clear and trading's set; permission 1 is the \"all\" mask and is never disabled — doing so would wipe trading too), cross-checked with `hasPermission` (exactly {trading}) and the key's status and expiry, the reviewed Authorization, Router and AccountRegistry contract versions, and the absence of any newer permission id — at approve (before the signer is registered), at `verify`, and before signed actions (re-checked at least every 60 s in long-running processes). If RISEx upgrades any of those contracts or adds a permission, every RISEx signed action — including cancel and cancel-all — is refused (`POLICY_DENIED`) until perp-cli is updated; manage open orders and positions in app.rise.trade meanwhile, and revoke with `perp wallet agent revoke risex \u003Cname>` if in doubt. Do not work around it.\n- Residual risk: those contracts are upgradeable by RISEx's admin keys, so RISEx itself can change what a registered signer may do. perp-cli only detects it (fail closed); the gap between an upgrade and the next check is not covered.\n- `wallet agent import risex` is refused (`CAPABILITY_UNSUPPORTED`): an app-created signer keeps fund-movement permissions. `wallet agent verify risex` re-reads the on-chain permissions; `wallet agent revoke risex \u003Cname>` revokes with the master.\n- Deposits and withdrawals are app-only: `funds deposit|withdraw risex` → `CAPABILITY_UNSUPPORTED` (also under `--dry-run`), remediation app.rise.trade. Testnet only: `perp -n testnet funds faucet risex` (1000 test USDC, once).\n- Works: market (IOC within `--slippage-bps`, which must fit the market's match price band, 2% on mainnet today), limit GTC \u002F IOC \u002F FOK \u002F ALO (post-only), reduce-only, cancel, cancel-all, leverage, margin mode (refused while a position is open), `trade status c:\u003Cid>`. Sizes \u002F prices must sit exactly on the step \u002F tick grid (`INVALID_TICK`, never rounded). Client ids are uint64 decimals (generated when omitted).\n- Not supported: TP\u002FSL \u002F stops (RISEx executes them from the venue backend against an account-signed OperatorHub spending allowance, outside the trading-only signer — perp-cli does not grant it; set TP\u002FSL in the RISEx app), amend, builder fee (`CAPABILITY_UNSUPPORTED`). Bots \u002F TWAP \u002F grid \u002F background jobs \u002F `strategy …` on RISEx are refused (`CAPABILITY_UNSUPPORTED`, \"unattended trading on RISEx is not enabled until its trading path is verified on mainnet\") — trade RISEx manually.\n- Account reads (`portfolio`, `account balance|positions|orders|history|trades|funding-history`) work with only the master address selected (public by address) — no signer needed.\n- `ORDER_PENDING` = outcome unknown (the symbol is quarantined): NEVER resubmit; check with `perp --json trade status c:\u003Cid> --symbol \u003CS> -e risex`. Each signed action uses a fresh permit nonce that is never reused.\n- Funding: hourly, `current_funding_rate` = the last settled hourly print (verified against funding payments).\n\n**TxFlow** (`-e txflow`, testnet = `-n testnet`, official API in Beta): manual trading is on. It was verified on testnet only — no mainnet TxFlow order has been run yet; tell the user before their first mainnet TxFlow order. Trading uses an AGENT key the master approves (`perp wallet agent approve txflow --master \u003Cows>`, or `wallet agent import txflow`; `wallet agent verify txflow` checks it read-only). Rules:\n- Mainnet `\u002Fexchange` is whitelisted: a refusal is `POLICY_DENIED` with \"apply at https:\u002F\u002Ftxflow.com\u002Fapply\" — tell the user; never retry. Testnet is open; an unfunded account is `DEPOSIT_REQUIRED` (fund it in the TxFlow web app).\n- Works: market data (`market list|prices|info|book|trades|kline`), account reads (`portfolio`, `account positions|orders|history|trades|funding`), `trade market|buy|sell|limit` (TIF GTC \u002F IOC \u002F ALO; FOK refused), `trade cancel|cancel-all|close|reduce|flatten`, `trade edit` (price + new TOTAL size, same order id), `trade stop` (reduce-only trigger on the MARK price), `--tp\u002F--sl` on a market \u002F IOC entry (legs placed after the verified fill), `trade tpsl`, `trade leverage [--isolated]`, `trade status c:\u003Cid> --symbol \u003CS>`, MCP `get_balance|get_positions|get_open_orders|trade_*`.\n- The venue's answer never says filled \u002F resting: perp-cli reads the order back by its client id. `status: accepted, finality: pending` = executed but not visible yet — check with `trade status c:\u003Cid>`. `ORDER_PENDING` = outcome unknown: NEVER resubmit.\n- Refused with `CAPABILITY_UNSUPPORTED` before anything is sent: `funds deposit|withdraw txflow`, `funds transfer -e txflow`, `funds rebalance` (the user moves funds in the TxFlow web app); builder codes; every `strategy …` \u002F bot \u002F TWAP \u002F background job (automation gate); `arb exec|auto` legs; hedge-mode accounts; `account positions --address` (no keyless reads for TxFlow).\n- Funding is percent per hour on the venue, shown as a FRACTION per hour, and is UNVERIFIED — display only (`arb scan --rates --include-unverified`); `market funding` (history) is refused.\n\n**Variational** (`-e variational`, aliases `var`, `omni`): Variational Omni, read-only (market data) in perp-cli through its OFFICIAL documented API (`GET \u002Fmetadata\u002Fv2\u002Fstats`, one call for all ~575 markets, cached ~5 s; venue limit 10 requests \u002F 10 s per IP). Variational has no public trading API yet. It is an RFQ venue: one market maker (the OLP) quotes every trade — there is no order book.\n- Works: `market list|prices|info|funding|book -e variational`, `perp health` (official), and Variational rows in `perp --json arb scan --rates --include-unverified` \u002F `--compare \u003Csym> --include-unverified` only — display only, never ranked or traded: funding is UNVERIFIED (a moving predicted rate, not checked against settled payments). `US500-PERP` is the SPDR S&P 500 ETF, compared as `SPY`; SPX (SPX6900) and QNT (Quant) are never matched.\n- `market book` shows the OLP's INDICATIVE RFQ quotes at fixed notionals (min order, $1k, $100k, $1M when published; `kind: \"rfqQuotes\"`), never order-book levels; they may be up to 600 s old (`updatedAt`). `market mid|trades|kline` are refused (`CAPABILITY_UNSUPPORTED`).\n- Funding: the interval is PER MARKET (1h \u002F 4h \u002F 8h perps; `fundingHours` on each row), positive = longs pay. `fundingRate` is the fraction for one interval; `market funding \u003Csym>` shows the current terms (`kind: \"currentFunding\"`: per interval, hourly, APR %, next time) — there is no funding history. `rateKind` is `predicted`: the rate for the window ending at `nextFundingTime`, recomputed during the window.\n- Perp symbols are the base (`BTC`); swaps keep their suffix (`XAU-SWAP`): daily-funded TradFi swaps with separate long \u002F short rates, `fundingRate` null and never matched across venues. Open interest is published in USD, single-sided (`openInterestUsd`); base-unit `openInterest` is null. No index price, tick, lot or leverage is published (null).\n- Refused with `CAPABILITY_UNSUPPORTED` before any request: every trade \u002F account \u002F portfolio \u002F funds \u002F agent \u002F builder \u002F bot command (also with `--dry-run`). The user trades on omni.variational.io. No testnet. Variational's terms exclude US \u002F Canada persons and sanctioned regions (perp-cli only warns).\n\n**GRVT** (`-e grvt`, testnet = `-n testnet`): official Market Data API (api-docs.grvt.io), READ-ONLY in this version. Rules an agent must follow:\n- Works: `market list|prices|info|book|trades|funding|kline -e grvt`, `perp health` (counted among the official venues), and GRVT rows in `perp --json arb scan --rates --include-unverified` (display only).\n- Symbols are the base ticker (`BTC`, `KPEPE`, `XAU`, `AAPL`; `BTC_USDT_Perp` also accepted); `venueSymbol` is GRVT's instrument name. Unknown symbols → `SYMBOL_NOT_FOUND`. Pre-IPO markets (OPENAI, ANTHROPIC, SPACEX) are never matched across venues.\n- Funding interval is PER MARKET (8 h or 4 h — `fundingHours`); rates are fractions per that interval (GRVT publishes percent). `market list|prices|info` rows carry the INDICATIVE rate of the running interval (`fundingRateKind: \"predicted\"`, moves until `nextFundingTime`); `market funding` is the settled history (`rateKind: \"lastSettled\"`, `intervalHours` per row). Funding is UNVERIFIED (not yet checked against settled payments) — never rank or trade on it.\n- `stepSize` is null (GRVT publishes a minimum size, `minSize`, but no lot step); `maxLeverage` \u002F `marginTiers` come from GRVT's margin rules and are filled by `market list|prices|info` only (cached up to 6 h — `leverageAsOf` says when they were read) — MCP `get_markets` \u002F `get_prices` rows have them null (price-only path). Equities match other venues only when reviewed; an unreviewed new GRVT equity has `canonical: null`.\n- Refused with `CAPABILITY_UNSUPPORTED` before any request (also under `--dry-run`): every trade \u002F account \u002F portfolio \u002F funds \u002F agent \u002F builder \u002F bot command and `setup` venue selection — remediation \"GRVT is read-only (market data) in this version; trading is planned for a later release\". GRVT trading needs KYC and is banned in restricted jurisdictions (US, CA, SG, HK, …) — relevant once trading lands.\n\n**Extended** (`-e extended`, aliases `ext` \u002F `x10`; testnet = Sepolia via `-n testnet`): official public API (api.docs.extended.exchange), READ-ONLY in this version — counted as an official venue in `perp health`. Rules an agent must follow:\n- Works: `market list|prices|info|book|trades|funding|kline -e extended`, and Extended rows in `perp --json arb scan --rates --include-unverified` (display only — funding is UNVERIFIED: never rank or trade on it). `market list` rows carry `assetClass` (crypto \u002F equity \u002F etf \u002F index \u002F commodity \u002F fx \u002F preIpo; human table \"Class\" column), `venueSymbol` (wire name, e.g. `TSLA_24_5-USD`), `tickSize`, `minSize`, `tradable` (false while `REDUCE_ONLY` or `isOffHours`), `isRfq`, `tradingHours`.\n- Symbols: `assetName` without the `_24_5` suffix (`TSLA_24_5-USD` → `TSLA`, `SPX500m-USD` → `SPX500M`); `-e extended market book TSLA-USD` and the wire name also resolve. The crypto `SPX` market is SPX6900, not the S&P 500 (index = `SPX500M`). RWA tickers that are also crypto tickers (PURR = Hyperliquid Strategies Inc., QNT, BB, ON, ADI, BOT), XIAOMI and the crypto SPX are never matched across venues.\n- Funding: applied hourly; `fundingRate` in market rows = the current hour's ACCRUING rate (fraction per hour, recomputed every minute, rounded to 6 decimals by the venue — no public source is more precise; `fundingRateKind: \"accruing\"`, `nextFundingTime`), `market funding` = applied hourly prints (`rateKind: \"lastSettled\"`, `annualizedPct`). `_24_5` equities print 0 while their underlying is closed (weekends \u002F holidays), so an annualized rate overstates them.\n- Refused with `CAPABILITY_UNSUPPORTED` before any request (\"Extended is read-only (market data) in this version; trading is planned for a later release\"): every trade \u002F account \u002F portfolio \u002F funds \u002F agent \u002F builder \u002F bot command, also under `--dry-run`. RFQ markets' REST order book is the indicative book.\n\nVenue rules for these: `trade limit` defaults to `--tif GTC` on every venue (arcus maps it to GTT; ondo offers GTC|IOC|ALO; FOK is never emulated → `CAPABILITY_UNSUPPORTED` where not offered); market orders on every venue are bounded by `--slippage-bps \u003Cn>` → `settings.slippageBps.\u003Cvenue>` → `settings.defaultSlippageBps` (shipped default 50). Ondo (US, PA) and Arcus (US, CA, GB) print a one-time restricted-region notice on stderr when used with credentials (warn only, never blocks).\n\n### Step 3: Discover (read-only)\n\n```bash\nperp --json arb scan                              # all modes (perp-perp + spot-perp), default --min 10 (% annual)\nperp --json arb scan --mode perp-perp --top 10\nperp --json arb scan --mode spot-perp --top 10\nperp --json arb scan --rates                      # raw funding rates\nperp --json arb scan --basis [\u003Csymbol>]           # cross-exchange basis\nperp --json arb scan --gaps                       # cross-exchange price gaps\nperp --json arb scan --hip3                       # HIP-3 cross-dex spreads\nperp --json arb scan --history \u003Csymbol>           # LOCAL snapshots only (written by earlier `arb scan --rates` runs; often `rates: {}`)\nperp --json -e \u003Cex> market funding \u003Csymbol> -l 24 # real settled history (newest first; rate per `intervalHours`)\nperp --json arb scan --compare \u003Csymbol>           # one symbol across all exchanges\nperp --json arb scan --positions                  # funding impact on open positions\nperp --json arb scan --live --interval 60         # continuous monitoring\n```\n\nCommon knobs: `--min \u003Cpct>`, `--top \u003Cn>`, `--hold-days \u003Cn>` (default 7), `--bridge-cost \u003Cusd>`, `--size \u003Cusd>`.\n\nPrices: `perp --json -e \u003Cex> market mid \u003CSYM>` is the canonical price read; cross-venue: `arb scan --compare \u003CSYM>`. `market prices` takes no symbol (every market). There is no spot price \u002F book read (`market *` are perp markets; `HYPE\u002FUSDC`, `@107`, `HYPE-SPOT` → `SYMBOL_NOT_FOUND`), and `arb scan --basis` is cross-venue PERP basis, not spot-perp.\n\n**Reading scan rows** — act only on these fields (detail: `references\u002Fcommands.md` → \"Arbitrage\"):\n- perp-perp rows (`mode: \"perp-perp\"`): `longExch` \u002F `shortExch`, `netSpread` \u002F `grossSpread` (= `netSpreadPct` \u002F `grossSpreadPct`, annual %), `estFeesPct` (estimated round trip on BOTH legs incl. 0.1 % slippage — e.g. hl+hl 0.24 %; `perp settings fees show` is the per-fill taker rate it is built from).\n- spot-perp rows (`mode: \"spot-perp\"`): `spotExchanges[]`, `perpExchange`, `direction`, `netSpread`, `estFeesPct`, `breakEvenDays` — no `longExch` \u002F `shortExch`. Executable ONLY when `direction == \"long-spot-short-perp\"`: `arb exec \u003CSYM> spot:\u003Cone of spotExchanges> \u003CperpExchange> \u003CUSD>`. `arb exec spot:` does not look at the funding sign — it always buys spot and shorts the perp, so on a `sell-spot-long-perp` row it would PAY the funding. Never act on `sell-spot-long-perp` rows.\n- `--rates` \u002F `--compare` rows: `longExchange` \u002F `shortExchange` \u002F `maxSpreadAnnual` (all null when fewer than two verified rates), `executable`, `readOnlyLegs`, `unverifiedLegs`, `mixedKinds` (the legs' rates are of different kinds — lastSettled \u002F accruing \u002F predicted); `--rates` top level has `minSpread` \u002F `belowMinSpread`. Act only when `executable === true`. `--compare \u003Cunknown>` is `ok:true` with `data.available: false`.\n- **Testnet funding rates and spreads are meaningless** (thousands of % \u002F yr). Never report them as opportunities; do yield analysis on mainnet public reads (keyless, `-n mainnet`).\n\n#### HIP-3 dexes (part of Hyperliquid, not a separate venue)\n\nHIP-3 dexes are selected on the Hyperliquid venue with the root `--dex \u003Cname>` flag; every market \u002F account \u002F trade command works the same way. Same account and wallet as native Hyperliquid perps.\n\n```bash\nperp --json -e hyperliquid market hip3                               # deployed dexes: name, deployer, assets, delistedAssets, delisted\nperp --json -e hyperliquid market list --hip3                        # native + every HIP-3 dex market\nperp --json -e hyperliquid --dex xyz market list                     # markets on dex \"xyz\"\nperp --json -e hyperliquid --dex xyz market info GOLD                # symbols WITHOUT the \"xyz:\" prefix\nperp --json -e hyperliquid --dex xyz account positions               # positions on that dex only\nperp --json -e hyperliquid account positions --hip3                  # native + every HIP-3 dex\nperp --json -e hyperliquid --dex xyz --dry-run trade market GOLD buy 0.01\n```\n\n- `--dex` with any other `-e` venue → `INVALID_PARAMS` (never ignored).\n- A dex symbol without `--dex` (e.g. `-e hyperliquid market mid xyz:GOLD`) → `SYMBOL_NOT_FOUND` with remediation `--dex xyz`; it is never read from the native dex.\n- `portfolio --dexes` works only with `--serve` (web dashboard); for HIP-3 positions use `account positions --hip3` \u002F `--dex \u003Cname>` or `--address`. Builder fees are never attached on HIP-3.\n- Symbols: input is bare (`BTC`; HIP-3 `TSLA` + `--dex xyz`). Output differs: market rows are plain, keyed HL native position \u002F order rows show `\u003CCOIN>-PERP`, HIP-3 rows `xyz:TSLA` — pass the bare name back (`BTC`, `TSLA` + `--dex xyz`).\n- MCP tools cover native Hyperliquid perps only, except `get_positions_by_address` (reads every HIP-3 dex) — use the CLI for the rest of HIP-3.\n\n#### Options market data (Derive, read-only)\n\nDerive (derive.xyz) options via the official public API — keyless, never trades. Not a perp venue (`-e derive` works only with `perp options`).\n\n```bash\nperp --json -e derive options expiries ETH                              # active expiries\nperp --json -e derive options chain ETH --expiry 2026-12-25 --strikes 10 # calls\u002Fputs per strike: bid\u002Fask, mark, IV, greeks, OI\nperp --json -e derive options quote ETH-20261225-3500-P                 # one option\n```\n\n`schema: 1`; decimals are strings; `null` = unknown (empty side, uncomputable IV). Unknown underlying \u002F expiry \u002F instrument → `SYMBOL_NOT_FOUND`. Full reference: `references\u002Fcommands.md` → \"Options market data\".\n\n### Step 4: Validate before mutating\n\nFor arb:\n\n```bash\nperp --json portfolio -e \u003ClongEx>                     # perp.available (long leg)\nperp --json portfolio -e \u003CshortEx>                    # perp.available (short leg)\nperp --json --dry-run arb exec \u003CSYM> \u003ClongEx> \u003CshortEx> \u003CUSD>\n```\n\nSpot-perp (`spot:\u003Cvenue>` long leg, only for `direction == \"long-spot-short-perp\"` rows): the spot leg needs the full spot notional in the spot venue's quote (`perp --json -e \u003Cvenue> trade spot-balance`; separate-margin venues transfer the shortfall perp→spot) plus perp margin on the perp leg — the dry-run checks both and refuses an empty book or a > 5% spot\u002Fperp price gap.\n\nFor a single trade:\n\n```bash\nperp --json -e \u003Cex> market info \u003CSYM>                                    # markPrice, stepSize (lot), maxLeverage\nperp --json -e \u003Cex> trade check \u003CSYM> \u003CSIDE> \u003CSIZE> --leverage \u003CN>\nperp --json --dry-run -e \u003Cex> trade buy \u003CSYM> \u003CSIZE>                     # market entry\nperp --json --dry-run -e \u003Cex> trade buy \u003CSYM> \u003CSIZE> --tp \u003CPX> --sl \u003CPX> # entry + TP\u002FSL\nperp --json --dry-run -e \u003Cex> trade buy \u003CSYM> \u003CSIZE> --smart             # IOC at best ask + 1 tick (no TP\u002FSL)\n```\n\n> `trade check` does NOT read exchange-set leverage. Always pass `--leverage` explicitly.\n>\n> `--tp` \u002F `--sl` are ABSOLUTE trigger prices (not %). Market entries: every venue (venues that place TP\u002FSL as separate orders need a market \u002F IOC entry); `trade limit --tp\u002F--sl`: ondo \u002F arcus on any entry, elsewhere only with `--tif IOC`. TP\u002FSL on an already open position: `trade tpsl \u003CSYM> long|short --tp \u003CPX> --sl \u003CPX>` (side = the position's side).\n>\n> `--smart` (IOC at best bid\u002Fask ± 1 tick) exists only on pacifica \u002F hyperliquid \u002F lighter \u002F aster, and is refused (`CAPABILITY_UNSUPPORTED`) together with `--tp`\u002F`--sl` or `--client-id`\u002F`--auto-id` — need TP\u002FSL → plain market entry (or `--smart`, then `trade tpsl`).\n>\n> Pacifica basket (pair trade): `perp --json --dry-run -e pacifica trade atomic --long BTC:50 --short ETH:50 --usd 1000` — one batch of market orders, NOT all-or-nothing (a leg can fill while another is refused → `ORDER_PARTIAL`; an unconfirmed leg → `ORDER_PENDING` + quarantine). A batch failure other than HTTP 400 \u002F 429 quarantines every leg. Pacifica's Chase \u002F OCO \u002F Trailing Stop \u002F Swarm \u002F Trigger Swarm \u002F Conditional orders have no documented API \u002F SDK path (as of 2026-10-19); nearest here: `trade twap` (≈ Swarm) and `trade tpsl` (≈ OCO bracket exit).\n\nShow the dry-run output to the user. Wait for confirmation.\n\n#### Minimum order size and tick (not in `market info`; `trade check` and `--dry-run` do NOT enforce the minimum)\n\n| Venue | Min order value (USD notional) |\n|---|---|\n| hyperliquid | $10 (also spot; HIP-4 outcomes: 10 quote tokens) |\n| pacifica | $10 (per market `min_order_size`) |\n| lighter, lighter-rh | $10 (per market `min_quote_amount`; a few markets 0) |\n| aster | $5 (`MIN_NOTIONAL`) |\n| arcus | $5 (`minOrderNotional`; reduce-only exempt; perp-cli refuses below it, `SIZE_TOO_SMALL`) |\n| ondo, qfex | unknown (not published) |\n\nValues read from the venues' public market data on 2026-10-26; keyless MCP `get_markets` (no credentials configured) returns them per market as `minNotional`, with `tickSize` \u002F `minSize`. **Default smallest order = $15 notional** (on every venue, including the $5 ones and the unknown ones): `mark` = `market mid \u003CSYM>`, `step` = `stepSize` from `market info`; `size = ceil(15 \u002F mark \u002F step) × step`, then `trade check` + dry-run. The $15 buffer over the $10 venue minimum absorbs price moves between sizing and the fill, step rounding and fees; below the venue minimum the live order is rejected. Use the bare venue minimum only when the user explicitly asks for it. Anything that splits a position must keep every piece ≥ $15 too: `trade reduce 50` \u002F `scale-tp` \u002F partial `tpsl --size` need a position of ≥ $30 (≥ $15 × number of pieces), and an arb's matched size must clear $15 on both legs. Tick: off-grid limit \u002F trigger prices are refused with `INVALID_TICK` on the live send (never rounded, nothing sent) — Hyperliquid: ≤ 5 significant figures; elsewhere take `tickSize` from keyless MCP `get_markets` or the price steps of `market book \u003CSYM>`.\n\n### Step 5: Execute\n\nAfter explicit user confirmation:\n\n```bash\n# Perp-perp arb: legs are SEQUENTIAL — long first, then the short sized to the verified long fill;\n# reconcile is always on (the long is trimmed reduce-only to the short's verified fill).\n# An unconfirmed leg quarantines the symbol (see \"Safety rules\").\nperp --json arb exec \u003CSYM> \u003ClongEx> \u003CshortEx> \u003CUSD> --smart\n\n# Spot+perp arb (spot has 0 funding cost; spot:\u003Cvenue> = hl, lt, lrh, aster, ondo)\n# ONLY for a spot-perp scan row with direction == \"long-spot-short-perp\": buys spot, shorts the perp.\nperp --json arb exec \u003CSYM> spot:hl hl \u003CUSD>\nperp --json arb exec \u003CSYM> spot:lt pac \u003CUSD>\n\n# Single trade\nperp --json -e \u003Cex> trade buy  \u003CSYM> \u003CSIZE> --smart\nperp --json -e \u003Cex> trade sell \u003CSYM> \u003CSIZE> --tp \u003CPX> --sl \u003CPX>\nperp --json -e \u003Cex> trade split \u003CSYM> buy \u003CUSD> --max-slippage 0.5\n```\n\n#### Orders: limit \u002F status \u002F edit \u002F cancel\n\n```bash\nperp --json -e \u003Cex> trade limit \u003CSYM> buy|sell \u003CPRICE> \u003CSIZE> [--tif GTC|IOC|FOK|ALO] [--reduce-only]   # default GTC\nperp --json -e \u003Cex> account orders                                # open orders + ids\nperp --json -e \u003Cex> trade status \u003CORDER_ID> [--symbol \u003CSYM>]      # --symbol required on ondo \u002F arcus \u002F qfex\nperp --json -e \u003Cex> trade edit \u003CSYM> \u003CORDER_ID> \u003CPRICE> \u003CSIZE>    # SIZE = new open (unfilled) size\nperp --json -e \u003Cex> trade cancel \u003CSYM> \u003CORDER_ID>                 # one order\nperp --json -e \u003Cex> trade cancel \u003CSYM>                            # every order on that symbol\n```\n\nAll of these writes take `--dry-run`. **`trade edit` may return a NEW `orderId` — always continue with the id it returns**: pacifica (ALO → native edit, GTC \u002F TOB → cancel+replace; new id either way, TIF kept), ondo (cancel+replace), qfex (venue assigns a new id); hyperliquid \u002F lighter \u002F lighter-rh \u002F aster \u002F arcus amend natively — use the returned id anyway. `trade edit --tif` only on ondo \u002F pacifica.\n\nHL spot uses U-tokens (`BTC→UBTC`, `ETH→UETH`, `SOL→USOL`) — auto-resolved.\n\n### Step 6: Monitor\n\n```bash\nperp --json arb status                              # open arb positions, PnL, funding earned\nperp --json portfolio                               # cross-exchange equity + risk\nperp --json risk status                             # canTrade, level, violations\nperp --json risk liquidation-distance               # % from liq for ALL positions\nperp --json -e \u003Cex> account positions --address \u003CADDR> [--symbol BTC] [--account-index \u003Cn>]   # keyless, ANY account\nperp --json -e \u003Cex> account balance --address \u003CADDR> [--account-index \u003Cn>]                  # keyless balances of ANY account\n```\n\n`arb status` reads every configured venue and fails as a whole (`EXCHANGE_ERROR`) when one venue's read fails — there is no venue filter; check the venues one by one with `perp --json -e \u003Cex> account positions` and report which one failed. Never read the failure as \"no positions\".\n\n`account positions --address` (keyless, nothing signed; without `-e`: every venue that supports it): hyperliquid (0x; native + every HIP-3 dex, rows carry `dex`), lighter \u002F lighter-rh (0x; every account of the address, rows carry `accountIndex`, narrow with `--account-index`), pacifica (Solana address), risex (0x). Other venues → `CAPABILITY_UNSUPPORTED`. MCP `get_positions_by_address` returns the same rows (HIP-3 included). `account balance --address` (same venues and address rules; MCP `get_balance_by_address`): `data = { exchange, address, balance, spot }` — `balance` = `{ equity, available, marginUsed, unrealizedPnl }` (+ Pacifica `usdcBalance` \u002F `borrowedUsdc` \u002F `pendingInterest` \u002F `availableToWithdraw`), `spot` = token rows or null (RISEx). Hyperliquid: `accountMode` decides equity (unified \u002F portfolio → the spot collateral row; standard \u002F default → perp `accountValue`; read `meta.notes`), `dexes` = HIP-3 dexes with a non-zero value, a failed dex → `meta.errors[\"hip3:\u003Cdex>\"]` + `meta.warnings` (unknown, not zero). Lighter: top-level `balance` \u002F `spot` null, one row per account in `accounts: [{ accountIndex, balance, spot }]`; no account → `[]` + note. `account balance` WITHOUT `--address` is the renamed-command error — your own balance is `perp portfolio`.\n\nIf `risk status.canTrade === false`, do NOT open new positions. If liquidation distance falls below the user's `--min-liq-distance`, recommend reducing position size.\n\nFor continuous monitoring, run `bash scripts\u002Farb-monitor.sh --json`.\n\n### Step 7: Close\n\n```bash\nperp --json arb close \u003CSYM>                                     # perp-perp arb\nperp --json arb close \u003CSYM> --pair \u003ClongEx>:\u003CshortEx>           # disambiguate\nperp --json arb close \u003CSYM> --spot-exch hl --perp-exch hl       # spot+perp\nperp --json arb close \u003CSYM> --smart                             # IOC limits\nperp --json arb close \u003CSYM> --force                             # quarantined symbol — only after the user checked positions\nperp --json arb close \u003CSYM> --state-only --yes                  # drop a stale state entry (arb status staleStateEntries); sends no order\n\n# Single trade (dry-run first, then confirm)\nperp --json -e \u003Cex> trade close \u003CSYM>                           # close one symbol\nperp --json -e \u003Cex> trade close-all                             # close all positions on this exchange\nperp --json -e \u003Cex> trade flatten                               # cancel ALL orders, then close ALL positions\n```\n\n`trade close` \u002F `close-all` close positions only — perp-cli does not cancel resting TP\u002FSL \u002F stop \u002F limit orders (QFEX lists the leftovers as a WARNING). After a close, run `account orders` and cancel what is left (`trade cancel \u003CSYM> \u003Cid>`), or use `trade flatten`, which cancels every order on the venue first.\n\n### Pacifica Print and vaults (`perp print`, `perp vault`)\n\nPacifica-only, details in `references\u002Fcommands.md`. Reads first (`print games`, `print quote`, `print positions`, `vault list|info|positions`); every write is `--dry-run` first and needs the user's confirmation:\n- **Print** (`print deposit \u003Cgame> long|short \u003Cusd> --strike \u003Cpx> --leverage \u003Cn> [--cycles 1-1000]`) locks the deposit until a fill or until a cancel settles at the END of the running cycle (up to 30 days on `BTC_1M`). Before asking, show the user: cycle length, `--cycles`, leverage, `maxLoss` (deposit + premiums), and that `docsLiquidationPrice` is only an outer bound (a liquidation was observed earlier in one live case; the venue trigger is unpublished). Checkpoint-only evaluation applies while resting; after a fill it is an ordinary position in the main account (continuous liquidation, nets with an existing position) — `account positions`. The premium is not quoted by perp-cli. `print cancel` uses an UNOFFICIAL endpoint: live runs need `--unverified-endpoint`.\n- **Vaults** (`vault deposit \u003Cvault> \u003Cusd>`, `vault withdraw \u003Cvault> \u003Cshares>|--all`): third-party trading pools (can lose the whole deposit); every deposit restarts the lock-up for the whole balance; withdrawals only go to the own account, inside the vault's window. **`vault deposit` is master-only** (never an agent key). Pass the vault ADDRESS and confirm the shown manager with the user — nicknames are not unique (an ambiguous one is refused with the candidates).\n- `ORDER_PENDING` on any of them → NEVER resubmit with a new key; check `print positions` \u002F `vault positions` against `error.details.before`. The only safe retry is the same command with `--idempotency-key \u003Creported key>` (dedupe window unverified).\n\n### Funds workflow (deposit \u002F withdraw \u002F transfer \u002F bridge \u002F rebalance)\n\nAll money movement lives under `perp funds`:\n\n```bash\n# Exchange in\u002Fout\nperp --json funds deposit hyperliquid 100\nperp --json funds deposit pacifica 100\nperp --json funds deposit lighter ethereum 100              # L1 direct\nperp --json funds deposit lighter cctp arbitrum 100         # via CCTP\nperp --json funds withdraw hyperliquid 100 [--chain arbitrum|ethereum|base]   # CCTP to your own wallet\nperp --json funds transfer 100 \u003CADDRESS>                    # HL internal (instant) — allowlisted destinations only\n\n# Cross-chain bridge (auto-cheapest cctp\u002Frelay\u002Fdebridge)\nperp --json funds bridge quote --from solana --to arbitrum --amount 100\nperp --json funds bridge send  --from solana --to arbitrum --amount 100\nperp --json funds bridge status \u003CorderId>                   # poll until success\n\n# Inter-exchange rebalance\nperp --json funds rebalance check\nperp --json funds rebalance plan\nperp --json --dry-run funds rebalance execute --auto-bridge   # status \"simulated\" (moves[].status \"dry_run\"), or \"balanced\" (nothing to move)\nperp --json funds rebalance execute --auto-bridge             # withdraw → bridge ONLY; no deposit\n```\n\nAlways run `funds bridge quote` before `funds bridge send` so the user sees fees + ETA.\n\n- `funds rebalance execute` returns `ok:true` even when a move failed: check EVERY `moves[].status` (`withdrawn`, `bridged`, `same_chain`, `needs_bridge`, `withdraw_failed`, `bridge_failed`). It never deposits — after the bridge arrives, deposit manually (`funds deposit \u003Cvenue> \u003Camt>`).\n- `funds transfer \u003Camt> \u003Caddr>` (HL) and `funds withdraw hyperliquid --to \u003Cother address>` require the destination on the `settings withdraw.hyperliquid` allowlist (`POLICY_DENIED` otherwise). Only the user can set it, in an interactive terminal (`--json` \u002F piped → `POLICY_DENIED`). NEVER try to set or change `withdraw.\u003Cvenue>` yourself.\n- HL withdraw goes over CCTP (native USDC); on Arbitrum a 0.2 USDC forwarding fee is deducted (an amount ≤ the fee → `SIZE_TOO_SMALL`).\n- Bridges: exactly `--amount` leaves the wallet (fees come out of it); a deBridge `nativeFee` is shown separately and is paid in the source chain's native token. Solana-origin deBridge is refused (`NO_BRIDGE_ROUTE`) → `--provider cctp`. `--fast` = fast CCTP finality (higher fee).\n- `funds bridge exchange --from \u003Cex> --to \u003Cex>` bridges the master wallet's OWN USDC between the venues' chains (pacifica → solana, lighter → arbitrum); it does NOT withdraw from \u002F deposit into Pacifica or Lighter. Exception hyperliquid: `--from hyperliquid` spends HyperCore spot USDC, `--to hyperliquid` credits HyperCore perps. HyperCore → Solana is refused (`NO_BRIDGE_ROUTE`).\n\nRelay swaps between assets (`--from-asset` \u002F `--to-asset`, chains `robinhood`, `arbitrum`, `bsc`, `base`, destination `solana`): run `perp --json --dry-run funds bridge send ...` first — it prints the locally verified quote (amount in, expected out, protocol-guaranteed minimum, fees, ETA) and the min-out verdict without loading a key. Stable → native (e.g. USDG → SOL \u002F ETH) needs `--min-out`. The recipient is always the master wallet's own address; an `ORDER_PENDING` result carries the Relay request id — never bridge again before checking it.\n\n### Strategy engine (20 algorithms + scripted plans)\n\n```bash\nperp strategy list-strategies                                 # 20 registered\nperp strategy run \u003Cstrategy> [symbol]                         # run any strategy (multi-venue: --exchanges must include the -e venue)\nperp --json --dry-run strategy run \u003Cstrategy> [symbol]        # simulate: actions logged, never sent\nperp strategy apex [symbol]                                   # APEX orchestrator\nperp strategy reflect                                         # performance analysis\nperp --json strategy plan validate \u003CFILE>                     # validate scripted plan\nperp --json strategy plan execute \u003CFILE> --dry-run            # dry-run scripted plan\n```\n\n**Strategies:** `grid`, `dca`, `simple-mm`, `engine-mm`, `avellaneda-mm`, `regime-mm`, `grid-mm`, `liquidation-mm`, `momentum-breakout`, `mean-reversion`, `aggressive-taker`, `funding-arb`, `funding-arb-v2`, `funding-auto`, `basis-arb`, `spot-perp-arb`, `hedge-agent`, `rfq-agent`, `claude-agent`, `apex`.\n\nBackground daemon (tmux):\n\n```bash\nperp --json --dry-run arb auto --min-spread 30 --size 100     # simulate first (--background inherits --dry-run)\nperp --json arb auto --min-spread 30 --size 100 --background\nperp --json background list\nperp --json background logs \u003Cid> -f\nperp --json background stop \u003Cid> [--timeout 90]   # graceful: SIGINT, job cancels its orders, waits, reports what is left on the venue\n```\n\n`strategy funding-arb` is monitor-only unless `--auto-execute`. Bots: `equity` is `null` when a balance read fails — arb strategies then skip new entries and the bot stops after 10 consecutive unknown ticks; `ordersPlaced` counts orders sent, `fills` only venue-reported fills — a resting order is placed, not filled.\n\nBackground jobs inherit the parent's `-n`, `--dry-run`, `-e`, `--ows`, `-w`, `--no-agent`, `--dex`, and never receive key material (argv\u002Fenv): they resolve credentials from the OWS vault \u002F agent keystores \u002F `~\u002F.perp\u002F.env` themselves. `--background` with `-k`, `--passphrase`, `--ows-key` or a shell-exported key \u002F `OWS_PASSPHRASE` → `INVALID_PARAMS` — register an agent (`perp wallet agent approve \u003Cvenue>`), which signs without the master passphrase.\n\n### Position sizing & safety\n\n- Single position notional \u003C **80%** of that exchange's available balance.\n- Leverage 1–3x for arb; never above 5x for arb positions.\n- `arb exec` sizes the short to the verified long fill and always reconciles; still check `arb status` (`unconfirmedPairs`, `staleStateEntries`) afterwards.\n- ALWAYS follow `longExch`\u002F`shortExch` (perp-perp) or `longExchange`\u002F`shortExchange` (`--rates` \u002F `--compare`) — NEVER reverse direction. Spot-perp: only `direction == \"long-spot-short-perp\"`.\n- NEVER enter if `netSpread \u003C= 0` or `netSpread \u003C estimated round-trip slippage`.\n- Capital that's mid-bridge is \"at risk\" and unhedged — factor it in.\n\nFor deeper risk-management framework, read `references\u002Fstrategies.md`.\n\n## Examples\n\n### Example 1: \"Find funding-rate arb opportunities\"\n\n```bash\n# 1. Discover\nperp --json arb scan --min 10 --top 10\n# 2. Show top 3 to user; ask which to evaluate\n# 3. Check balances on the two exchanges\nperp --json portfolio -e \u003ClongEx>\nperp --json portfolio -e \u003CshortEx>\n# 4. Recommend size + dry-run\nperp --json --dry-run arb exec BTC \u003ClongEx> \u003CshortEx> 100\n# 5. After user confirmation:\nperp --json arb exec BTC \u003ClongEx> \u003CshortEx> 100 --smart\nperp --json arb status\n```\n\n### Example 2: \"ETH spot+perp arb, $100\"\n\n```bash\nperp --json arb scan --mode spot-perp --min 0       # ETH row must say direction \"long-spot-short-perp\"\nperp --json --dry-run arb exec ETH spot:hl hl 100\n# → show dry-run, ask confirmation\nperp --json arb exec ETH spot:hl hl 100\nperp --json arb status\n# Later, to close both legs:\nperp --json arb close ETH --spot-exch hl --perp-exch hl\n```\n\n### Example 3: \"Long SOL 0.5 on Hyperliquid with 2x leverage\"\n\n```bash\nperp --json -e hl trade check SOL buy 0.5 --leverage 2\nperp --json --dry-run -e hl trade leverage SOL 2 --isolated\nperp --json --dry-run -e hl trade buy SOL 0.5 --smart\n# → show both dry-runs (isolated 2x + the order), ask confirmation; only then:\nperp --json -e hl trade leverage SOL 2 --isolated\nperp --json -e hl trade buy SOL 0.5 --smart\nperp --json -e hl account positions\n```\n\n### Example 4: \"Move 500 USDC from Pacifica to Hyperliquid\"\n\n```bash\nperp --json --dry-run funds withdraw pacifica 500\nperp --json funds bridge quote --from solana --to arbitrum --amount 500\n# → show the withdraw plan + bridge fee \u002F ETA, ask confirmation; only then:\nperp --json funds withdraw pacifica 500\nperp --json funds bridge send  --from solana --to arbitrum --amount 500\nperp --json funds bridge status \u003CorderId>             # poll until completed\nperp --json funds deposit hyperliquid 500\n```\n\n`funds rebalance execute --auto-bridge` only withdraws and bridges — check every `moves[].status`, then deposit by hand (`funds deposit hyperliquid \u003Camt>`) after the bridge arrives.\n\n### Example 5: \"Run a delta-neutral funding bot in background\"\n\n```bash\nperp --json --dry-run arb auto --min-spread 30 --close-spread 5 --size 100 --max-positions 5\n# → show the simulation, ask confirmation\nperp --json arb auto --min-spread 30 --close-spread 5 --size 100 --max-positions 5 --background\nperp --json background list\nperp --json background logs \u003Cid> -f\n# To stop:\nperp --json background stop \u003Cid>\n```\n\n## Troubleshooting\n\nEvery response is `{ \"ok\": true, \"data\": ... }` or `{ \"ok\": false, \"error\": { \"code\": \"...\", \"retryable\": true|false, \"remediation\"?: \"...\" } }`; `ok:false` exits 1. Always check `ok` first and follow `error.remediation`. `retryable: true` → wait and retry ONCE, and only for read-only commands — a write is never blindly retried.\n\n| Error code | Meaning | Action |\n|---|---|---|\n| `ORDER_PENDING` | A write was sent, outcome unknown | NEVER resubmit. See \"Safety rules\". |\n| `ORDER_PARTIAL` | Part of a multi-leg \u002F close succeeded | Don't retry; check positions per venue, close residuals by hand (may be quarantined). |\n| `ORDER_REJECTED` \u002F `ACTION_REJECTED` | Definitely not placed \u002F not executed | Fix the cause from `error.message`; a new attempt is a new decision (ask the user). |\n| `RISK_VIOLATION` | Local risk limit breached, or symbol quarantined | Report to the user. `--force` only with explicit user consent, and never bypasses quarantine. |\n| `CAPABILITY_UNSUPPORTED` | Venue\u002Ffeature combination not offered | Do NOT work around it (no emulation via other orders\u002Fvenues); tell the user. |\n| `INVALID_TICK` | Limit\u002Ftrigger price off the venue grid (HL: ≤ 5 significant figures) | Refused, never rounded — re-price on the grid and confirm with the user. |\n| `INVALID_PARAMS` | Bad argument (incl. strict sizes: `1,000` \u002F `1e3` \u002F `10abc` refused; `--dry-run` on a command without dry-run) | Fix the argument. |\n| `CLI_ERROR` | Command parse error (unknown command \u002F missing option) | Check `\u003Ccmd> --help`. |\n| `NO_SIGNER_AVAILABLE` | No key that may sign this (e.g. imported agent key for a master-only action) | User does it on the website, or `perp wallet import`s the master. |\n| `AGENT_NOT_REGISTERED` \u002F `AGENT_EXPIRED` | Agent key missing, on the other network, or expired | Follow `remediation`: master on this computer → `perp wallet agent approve \u003Cvenue> [--rotate]` (master-signed: user consent); imported key → new key on the website, `wallet agent import \u003Cvenue> --replace`. |\n| `POLICY_DENIED` | Local withdraw gate \u002F OWS policy refused | Never change `withdraw.\u003Cvenue>` — only the user can, in a terminal. |\n| `PASSPHRASE_REQUIRED` | Vault passphrase needed | Ask the user to provide `OWS_PASSPHRASE` (or stdin); never put it on argv. |\n| `LOCK_HELD` | Another perp process holds a state lock | Wait ~5s and retry once; check `background list`. |\n| `NO_BRIDGE_ROUTE` | No supported bridge route (e.g. deBridge from Solana, HyperCore → Solana) | Use the route in `remediation` (e.g. `--provider cctp`). |\n| `RATE_LIMITED` \u002F `EXCHANGE_UNREACHABLE` | Throttled \u002F API down (reads) | Wait 5–10s (or `retryAfterMs` when present — Pacifica sets it from its credit headers), retry once; then skip that venue. |\n| `INSUFFICIENT_BALANCE` | Not enough collateral on that venue | Reduce size or move funds first (user-confirmed). |\n| `SYMBOL_NOT_FOUND` | Not listed on this venue | `market list`. Don't add `-PERP`. |\n| `SIZE_TOO_SMALL` | Below venue minimum (HL TWAP: $100 total) | Compute `size × price`; raise size (minimum table in Step 4). |\n| `UNKNOWN` | Unclassified failure (the message matched no known code) | Read `error.message`. After a write: treat the outcome as unknown — check `account orders` \u002F `account positions` \u002F `portfolio` before anything else, never resubmit blindly; report to the user. |\n\nLighter \u002F Lighter RH \"account not found\" (venue code `21100`): the address has no account on that venue \u002F network — the user must fund (create) the account first, then `perp wallet agent approve lighter` (or `lighter-rh`).\n\n`--client-id` (`trade market\u002Fbuy\u002Fsell\u002Flimit`): an id already recorded in `~\u002F.perp\u002Fclient-ids.jsonl` (and not marked failed) returns `ok:true` with `data.duplicate: true` and sends nothing — local tracking only, not a venue check (it is NOT a `DUPLICATE_ORDER` error). Formats: Pacifica a full UUID, Hyperliquid `0x` + 32 hex; QFEX refuses `--client-id` (use `--auto-id`); `--smart` + client id → `CAPABILITY_UNSUPPORTED`.\n\n## Safety rules\n\n- **Unknown outcome (`ORDER_PENDING`) on ANY write** — orders, cancels, edits, leverage, withdraw \u002F deposit \u002F bridge \u002F transfer: do NOT resubmit. Check `perp --json -e \u003Cex> trade status c:\u003Cid> --symbol \u003CS>` (the id in `remediation`), `account orders` \u002F `account positions` \u002F `portfolio`, and the tx hash \u002F request id in `error.details` (`funds bridge status \u003Cid>` for bridges). Report to the user.\n- **Quarantine**: an unknown or unhedged outcome (arb, bots, `trade close`, `trade multi`, `trade atomic`) quarantines the symbol — global per symbol, scoped by network. It blocks opening orders, `arb exec`, `arb auto` and bots (`RISK_VIOLATION`); reduce-only orders pass. List: `perp --json strategy quarantine`. Clear only after the USER has verified the positions on the venues: `perp --json strategy quarantine-clear \u003CSYM>`. `arb close` on a quarantined symbol needs `--force`.\n- **Risk gate**: `trade market \u002F buy \u002F sell \u002F limit \u002F split \u002F market --split \u002F scale-in \u002F twap \u002F multi \u002F atomic \u002F stop --no-reduce-only` check `~\u002F.perp\u002Frisk.json` (`perp risk limits ...`); reduce-only is exempt. `--force` bypasses the limits (never quarantine) — only with explicit user consent.\n- **Stops** (`trade stop`, `tpsl`) are reduce-only by default; `--no-reduce-only` is refused on ondo and qfex. `trade tpsl \u003CSYM> long|short` = the OPEN position's side; legs are sized to the live position.\n- **Dry-run is default-deny**: commands that cannot simulate refuse `--dry-run` with `INVALID_PARAMS` (e.g. `trade twap`, `trade multi`, `trade cancel-stop`, `trade cancel-twap`, `strategy start \u002F preset \u002F grid \u002F dca \u002F quick-* \u002F funding-arb`, `wallet agent approve`, `wallet rotate`). Simulate bots with `perp --json --dry-run strategy run \u003Cstrategy>` \u002F `perp --json --dry-run arb auto`.\n- **A dry-run is not a full venue check**: it validates arguments, the risk gate and quarantine, but some venue rules are enforced only on the live send — e.g. an off-grid limit price (`INVALID_TICK`) or `--no-reduce-only` on ondo \u002F qfex (`CAPABILITY_UNSUPPORTED`). Those refusals happen before anything is sent.\n- **`wallet rotate`** creates a new wallet and transfers assets, with no dry-run — only on the user's explicit request.\n\n### Common mistakes\n\n- **Forgetting `--json`** → output becomes unparseable human text. The very first thing to check when parsing fails.\n- **Using legacy command names** — `arb rates`\u002F`arb prices`\u002F`arb dex`\u002F`arb spot-exec`\u002F`arb spot-close` are removed. Use `arb scan --rates|--gaps|--hip3` and `arb exec spot:\u003Cexch>` \u002F `arb close \u003CSYM> --spot-exch \u003Cex>`.\n- **Calling `trade check` without `--leverage`** → cost estimate doesn't match what the exchange applies.\n- **Retrying a non-idempotent trade** without checking `account positions` → opens a duplicate position.\n- **Bridging without quoting first** → user sees no fee\u002FETA and can't approve cleanly.\n- **Treating `bridge send` as instant** → always `funds bridge status \u003CorderId>` before depositing on the destination.\n- **Manually adding `-PERP` suffix** → CLI auto-resolves; let it.\n\nFor a full troubleshooting + non-interactive flow guide, read `references\u002Fagent-operations.md`.\n\n## Referrals (optional, ask once per setup)\n\n```bash\nperp --json --dry-run -e hyperliquid wallet manage referral set   # preview (nothing signed)\nperp --json -e hyperliquid wallet manage referral set [code]      # signs + sends ONE referral action\nperp --json -e lighter wallet manage referral set [code]          # Lighter (needs an agent key)\n```\n\nReferral codes are never applied implicitly (adapter creation signs nothing). When the user first sets up a wallet, ask:\n> \"perp-cli development is supported by optional referrals. Apply the referral code? It signs one referral action on the venue; no extra fees — only exchange rebates are used.\"\n\n## Builder fees (OFF by default — never enable on your own)\n\nBuilder fees are extra fees on the USER's perp orders, paid to a third-party builder. perp-cli attaches none unless the user explicitly set `settings builder.\u003Cvenue>` AND the venue approval is confirmed. Do not configure or approve a builder unless the user asks for it.\n\n```bash\nperp --json wallet builder status [venue]                 # support, config, approval, attaches?\nperp --json --dry-run wallet builder approve \u003Cvenue>      # plan only — show it to the user\nperp --json wallet builder approve \u003Cvenue> --yes          # only after explicit user consent (master-signed)\nperp --json --no-builder -e \u003Cex> trade market BTC buy 0.1   # one run without the fee\n```\n\nqfex: `builder.qfex \u003Cuuid>` is a fee share (no extra fee, no approval; mainnet only). Unsupported: lighter, lighter-rh, arcus (`CAPABILITY_UNSUPPORTED`). An order whose approval is missing or unknown is sent without the fee (`execution.notes`); `execution.builderFee` records what was attached.\n\n## MCP Server\n\nThe package also ships a 30-tool MCP server (no API keys required for read-only market data — `get_markets`, `get_orderbook`, `get_funding_rates`, `get_prices`, `get_outcome_markets`, `get_outcome_view`, `get_outcome_book`, `get_option_expiries`, `get_option_chain`, `get_option_quote` (Derive options), the read-only Pacifica Print \u002F vault tools `pacifica_print_products`, `pacifica_print_quote`, `pacifica_print_positions`, `pacifica_vaults`, plus 16 account\u002Fadvisor tools, incl. keyless `get_positions_by_address`):\n\nMCP `portfolio` totals (`totalEquity`, `totalAvailable`, `totalMarginUsed`, `totalUnrealizedPnl`, `riskMetrics.marginUtilization`) are `null` when no balance was read — check `accountState` (`\"ok\"` | `\"unread\"` = credentials but no balance read | `\"noAccount\"`) and `totalsCover` (the venues the totals include) before quoting a total. The CLI `portfolio` shape differs: `totals.{equity,marginUsed,marginPct,funding24h,fundingIncomplete}`, `risk.{level,marginPct}`.\n\nMCP network: `PERP_NETWORK=mainnet|testnet` (validated; unset = mainnet); every result's `meta.network` says which. The only write tools, `trade_execute` \u002F `trade_close`, run the same local risk gate as `perp trade` (no override over MCP), refuse non-reduce-only orders on quarantined symbols, and log every order.\n\n```json\n{\n  \"mcpServers\": {\n    \"perp-cli\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"-p\", \"perp-cli\", \"perp-mcp\"]\n    }\n  }\n}\n```\n\n**`perp-guardrail`** (third binary): not run by hand — the OWS Policy Engine spawns it before an agent API key signs anything; it allows \u002F denies by chain + contract whitelist, per-tx and daily USD limits, withdrawal limits and blocked selectors. Set it up through `perp wallet setup` or `perp wallet policy create --perp-defaults`; it is a second line of defence, not a replacement for perp-cli's risk gate.\n\n[![Glama MCP server](https:\u002F\u002Fglama.ai\u002Fmcp\u002Fservers\u002Fhypurrquant\u002Fperp-cli\u002Fbadges\u002Fscore.svg)](https:\u002F\u002Fglama.ai\u002Fmcp\u002Fservers\u002Fhypurrquant\u002Fperp-cli)\n",{"name":5,"license":15,"metadata":45,"description":7,"allowed-tools":48,"compatibility":49},{"author":46,"version":47},"hypurrquant","0.17.0","Bash(perp:*), Bash(bash scripts\u002Fpreflight.sh:*), Bash(bash scripts\u002Farb-monitor.sh:*), Bash(bash scripts\u002Ffunding-analysis.sh:*), Bash(bash scripts\u002Fspot-perp-scan.sh:*), Bash(bash scripts\u002Fvalidate-arb.sh:*)","Requires Node.js 20 or newer and the perp-cli npm package installed by the user (version must be >= 0.17.0; the user runs `npm install -g perp-cli` — never install it yourself). Network access required for exchange APIs and bridge providers. Mutating commands need a wallet key imported into the OWS vault via 'perp wallet set EXCHANGE' (key on stdin or hidden prompt — never argv). Skill is portable across Claude Code, Claude.ai, Cursor, Codex, and Gemini CLI — no platform-specific features.","main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fexchanges\u002Fperp-cli",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill perp-cli",{"tool":65,"command":66},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill perp-cli",{"tool":68,"command":69},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill perp-cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002FSKILL.md",true,[73,77,83,87,91,95,99,105,109,113,117,121,125],{"path":74,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":16},"LICENSE","许可证",1073,{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"package.json","REFERENCE","参考文档",931,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Fpackage.json",{"path":84,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fagent-operations.md",23283,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Freferences\u002Fagent-operations.md",{"path":88,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fcommands.md",56733,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Freferences\u002Fcommands.md",{"path":92,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fstrategies.md",25311,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Freferences\u002Fstrategies.md",{"path":96,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fws-library.md",35277,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Freferences\u002Fws-library.md",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"scripts\u002Farb-monitor.sh","SCRIPT","脚本",2955,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Fscripts\u002Farb-monitor.sh",{"path":106,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":107,"sourceHtmlUrl":108},"scripts\u002Ffunding-analysis.sh",5336,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Fscripts\u002Ffunding-analysis.sh",{"path":110,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":111,"sourceHtmlUrl":112},"scripts\u002Fpreflight.sh",4370,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Fscripts\u002Fpreflight.sh",{"path":114,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":115,"sourceHtmlUrl":116},"scripts\u002Fspot-perp-scan.sh",4176,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Fscripts\u002Fspot-perp-scan.sh",{"path":118,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":119,"sourceHtmlUrl":120},"scripts\u002Fvalidate-arb.sh",6455,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002Fscripts\u002Fvalidate-arb.sh",{"path":122,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":123,"sourceHtmlUrl":124},"SOURCE.md",194,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002FSOURCE.md",{"path":126,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":127,"sourceHtmlUrl":128},"TRUST.auto.yaml",2242,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fperp-cli\u002FTRUST.auto.yaml",[130,139,147,155,163,171],{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":134,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":138},"01M7DTKCERMV0RNX3HZJP4CZ26","troves","Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say \"Troves\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":143,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":138},"01M7DTK6CJSMGC8KCQHGNYFZBD","trade","Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say \"swap\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FSKILL.md",[],[],{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":151,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":138},"01M7DTJZ6A0X4PAW3Y8W4J9K64","staking","Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say \"stake\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FSKILL.md",[],[],{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":159,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":138},"01M7DTJSDZJKCDMW7GHRF4BRH5","send","Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say \"pay 10 STRK to 0x...\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FSKILL.md",[],[],{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":167,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":138},"01M7DTJG1E480D51ZQ7WKDQ26K","portfolio","View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks \"what do I have\", \"show me everything\", \"how much am I worth\", \"my positions\", \"my investments\", \"rebalance my portfolio\", \"I want 50% ETH\", \"optimize my holdings\", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say \"portfolio\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FSKILL.md",[],[],{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":175,"sourceHtmlUrl":176,"categories":177,"keywords":178,"publishedAt":138},"01M7DTJ7M8TE9R2N36HFBZDGVD","multi-swap","Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions \"two swaps\", \"three swaps\", \"swap X and Y at the same time\", or wants to convert multiple tokens in a single call.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FSKILL.md",[],[]]