PerpBLOCK
Multi-DEX perpetual futures CLI + MCP server — Pacifica (Solana), Hyperliquid, Lighter (Ethereum). 18 MCP tools for AI-powered trading
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://www.npmjs.com/package/perp-cli) [](https://www.npmjs.com/package/perp-cli) [](https://github.com/hypurrquant/perp-cli/blob/main/LICENSE)
Multi-DEX perpetual futures CLI — Pacifica (Solana), Hyperliquid (HyperEVM), Lighter (Ethereum), Aster (BNB Chain).
npm install -g perp-cli # global install perp --json portfolio # Or without global install (restricted environments) npx -y perp-cli --json portfolio
Features
- 4 Exchanges — trade, bridge, arbitrage across Pacifica, Hyperliquid, Lighter, Aster
- Funding Rate Arb — perp-perp + spot-perp scan & one-command dual-leg execution
- Portfolio — single call returns balances, positions, risk level across all exchanges
- Funds — deposit, withdraw, transfer, multi-provider bridge (cctp/relay/debridge), inter-exchange rebalance — all in one group
- Bots — TWAP, grid, DCA, trailing-stop with background job management
- Agent-First Design —
--json,--fields,--ndjson,--dry-run, runtime schema introspection - Safety — pre-trade validation, response sanitization, client-id deduplication
Setup
# Set exchange keys perp wallet set pac # Pacifica perp wallet set hl # Hyperliquid perp wallet set lt # Lighter (API key auto-generated) perp wallet set aster # Aster (BNB Chain) # Or interactive setup wizard perp setup # Verify perp wallet show
Same EVM key works for both Hyperliquid and Lighter.
Lighter API Key Index: Indexes 0–3 are reserved by Lighter's frontend (web/mobile). perp-cli defaults to index4. Override withLIGHTER_API_KEY_INDEXenv var, or useperp wallet agent approve lighter --api-key-indexfor managed agent slots. Valid range: 4–254.
Command Groups
7f12f6537268OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add perp-cli-skill --env ASTER_PRIVATE_KEY=${ASTER_PRIVATE_KEY} --env HL_PRIVATE_KEY=${HL_PRIVATE_KEY} --env HYPERLIQUID_PRIVATE_KEY=${HYPERLIQUID_PRIVATE_KEY} --env LIGHTER_API_KEY=${LIGHTER_API_KEY} -- npx -y @hypurrquant/[email protected]{
"mcpServers": {
"perp-cli-skill": {
"command": "npx",
"args": [
"-y",
"@hypurrquant/[email protected]"
],
"env": {
"ASTER_PRIVATE_KEY": "${ASTER_PRIVATE_KEY}",
"HL_PRIVATE_KEY": "${HL_PRIVATE_KEY}",
"HYPERLIQUID_PRIVATE_KEY": "${HYPERLIQUID_PRIVATE_KEY}",
"LIGHTER_API_KEY": "${LIGHTER_API_KEY}"
}
}
}
}Exposed tools (37)
34 read · 3 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
--sl | write | Stop-loss price |
--tp | read | Take-profit price |
Recurring | read | class:priceBinary|underlying:BTC|expiry:20260505-0600|targetPrice:79980|period:1d |
arb-aggressive | read | Low spread (10%), $100/leg, 5 positions — captures smaller opportunities |
arb-conservative | read | High spread threshold (30%), small size ($30/leg), 2 max positions |
arb-standard | read | Medium spread (20%), $50/leg, 3 positions, 3 exchanges |
arb_scan | read | Scan for funding rate arbitrage opportunities across exchanges. Finds symbols with the largest funding rate spreads |
dca-daily | read | Buy once per day, 30 orders — steady accumulation over 1 month |
dca-dip-buyer | read | Buy only when volatility is high — accumulate during dips |
dca-hourly | read | Buy every hour, 24 orders — short-term aggressive accumulation |
dca-seller | read | Sell (short) periodically — dollar-cost average out of a position |
explain_command | read | Explain what a perp CLI command does, its parameters, and any risks. Helps the user understand a command before running it |
get_arb_compare | read | Compare active arbitrage positions side by side — ROI, funding income, price PnL, and annualized returns for each position |
get_balance | read | Get account balance (equity, available margin, margin used, unrealized PnL) on an exchange |
get_funding_analysis | read | Analyze funding income across exchanges — cumulative totals, annualized rates, and per-arb-position breakdown. Great for tracking funding arb profitability. |
get_funding_rates | read | Compare funding rates across all 4 exchanges (Pacifica, Hyperliquid, Lighter, Aster). Returns rates per symbol with spread analysis |
get_markets | read | Get all available perpetual futures markets on an exchange, including price, funding rate, volume, and max leverage. Works without API keys. |
get_open_orders | read | Get all open/pending orders on an exchange |
get_orderbook | write | Get the order book (bids and asks) for a symbol on an exchange. Works without API keys. |
get_outcome_book | read | Get the orderbook for one outcome side. Public read — no API key needed. |
get_outcome_markets | read | List active Hyperliquid Outcome markets (HIP-4). Each market has parsed metadata (underlying asset, target price, expiry, period) and per-side info (Yes/No name, encoding, asset id, current mid). Public read — no API key needed. |
get_outcome_positions | read | Get the active account |
get_outcome_view | read | Get a combined view of one outcome market: all sides |
get_pnl_analysis | read | P&L analysis combining trading fees and funding income — shows net profit/loss by exchange with daily breakdown |
get_positions | read | Get all open positions on an exchange, including size, entry price, PnL, leverage |
get_prices | read | Get cross-exchange prices for symbols. Fetches mark prices from all 4 exchanges for comparison |
grid-aggressive | read | Tight range (±1.5%), 20 grids, 5x leverage — high frequency, high risk |
grid-conservative | read | Wide range (±5%), 8 grids, small size, no leverage — low risk sideways strategy |
grid-long-bias | read | Long-biased grid (±3%), 10 grids — profit from uptrend + range trading |
grid-standard | read | Medium range (±3%), 12 grids, moderate size — balanced grid trading |
health_check | read | Ping all 4 exchanges and return connectivity status and latency |
perp | read | Multi-DEX Perpetual Futures CLI (Pacifica, Hyperliquid, Lighter, Aster) |
portfolio | read | Cross-exchange portfolio summary: balances, positions, and risk metrics across all 4 exchanges |
suggest_command | read | Given a natural language trading goal, suggest the exact perp CLI commands to run. Does NOT execute anything — only returns commands for the user to review and run manually |
trade_close | read | Close an existing position. IMPORTANT: Call trade_preview first with the opposite side to show impact, then get user confirmation. |
trade_execute | write | Execute a trade. IMPORTANT: Always call trade_preview first and get explicit user confirmation before calling this tool. Supports market and limit orders. |
trade_preview | read | Preview a trade WITHOUT executing. Returns estimated fill price, fees, margin impact, and risk checks. ALWAYS call this before trade_execute and show the result to the user for confirmation. |
Trust audit
BLOCKgrade F · trust 41/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | FAIL |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (2 observation(s))
- Network
- declared (9 observation(s))
- Shell
- declared (2 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- found
Findings (25)
if (process.platform === "darwin") exec(`open ${url}`);else if (process.platform === "linux") exec(`xdg-open ${url}`);Get the orderbook for one outcome side. Public read — no API key needed.
List active Hyperliquid Outcome markets (HIP-4). Each market has parsed metadata (underlying asset, target price, expiry, period) and per-side info (Yes/No name, encoding, asset id, current mid). Publ
console.log(` Token: USDC | Min: $10 | Gas: ${hasRelay ? chalk.green("FREE") : "SOL ~0.005"}`);console.log(` Token: USDC | Min: $5 | Gas: ${hasRelay ? chalk.green("FREE") : "ETH ~0.0001"}`);console.log(` Token: USDC | Min: 1 (L1), 5 (CCTP)`);
console.log(` ${b.token.padEnd(10)} ${b.total.padEnd(15)} available: ${b.available}`);async ({ period, exchange: exFilter, symbol: symFilter }) => {const exchanges = exFilter ? [exFilter] : ["pacifica", "hyperliquid", "lighter", "aster"];
async ({ period, exchange: exFilter }) => {const exchanges = exFilter ? [exFilter] : ["pacifica", "hyperliquid", "lighter", "aster"];
mockOws.createApiKey.mockReturnValue({ id: "key-hl-001", token: "ows_key_NEVER_STORED", name: "api-hl-perp-cli-hl" });mockOws.createApiKey.mockReturnValue({ id: "key-lt-001", token: "ows_key_NEVER_STORED" });mockOws.createApiKey.mockReturnValue({ id: "key-001", token: "ows_key_NEVER_STORED", name: "api-aster-perp-cli-aster" });mockOws.createApiKey.mockReturnValue({ id: "key-partial", token: "ows_key_NEVER_STORED", name: "api" });console.log(`${token}: spot=$${spotMid.toFixed(4)} perp=$${perpPrice.toFixed(4)} deviation=${deviation.toFixed(0)}% (correctly rejected)`);import { classifyError } from "../../errors.js";import { isExpired, daysUntilExpiry, formatExpiry } from "../../agent-wallet/expiry.js";import type { AgentMeta } from "../../settings.js";} = await import("../../agent-wallet/lighter-keystore.js");const { resolvePassphrase } = await import("../../agent-wallet/passphrase.js");".env" ... fetch(
@modelcontextprotocol/sdk, @msgpack/msgpack, @solana/web3.js, @types/react, bs58, chalk, cli-table3, commander
### OWS (Open Wallet Standard) API key + policy — optional, scoped agent tokens
Gates applied: no_behavioural_pass.
7f12f6537268full audit observations/trust-audit/mcp-server/hypurrquant__perp.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 7f12f6537268 | BLOCK | F | 41 | first audit |
Questions
What is the Perp MCP server?
Multi-DEX perpetual futures CLI + MCP server — Pacifica (Solana), Hyperliquid, Lighter (Ethereum). 18 MCP tools for AI-powered trading
What tools does Perp expose?
37 in total: 34 read-only, 3 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Perp safe to connect to an agent?
No — not without reading the findings first. The audit graded it F (41/100) and found 4 critical or high issues in the source. Each one is listed on this page with the file and line it is on.
What credentials does Perp need?
It reads ASTER_PRIVATE_KEY, HL_PRIVATE_KEY, HYPERLIQUID_PRIVATE_KEY, LIGHTER_API_KEY, LIGHTER_API_KEY_INDEX, LIGHTER_PRIVATE_KEY, LT_PRIVATE_KEY, OWS_API_KEY, OWS_PASSPHRASE, PACIFICA_PRIVATE_KEY, PRIVATE_KEY and SECRET from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Perp run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as @hypurrquant/perp-cli-skill at 0.5.3.
How current is this page?
The grade is for one exact copy of the source (7f12f6537268), read on 2026-10-08. The repository is watched and re-audited when it changes.