perpcli

The Multi-DEX Perpetual Futures CLI

Trade perps across Pacifica, Hyperliquid, and Lighter from one command line.

Requires Node.js 18+. Works on macOS, Linux, and Windows.

What Does perp-cli Do?

perp-cli unifies perpetual futures trading across three decentralized exchanges. Instead of juggling different web UIs and APIs for each chain, you use one consistent set of commands.

Scan funding rate arbitrage

$ perp arb scan --min 5
Symbol Long Short Spread APR
ETH Pacifica Hyperliquid 12.3bp 45.1%
BTC Lighter Hyperliquid 8.7bp 31.9%
SOL Pacifica Lighter 6.2bp 22.8%

Execute a trade

$ perp -e hl trade market ETH buy 0.5
Market buy 0.5 ETH on Hyperliquid — filled @ $3,787.50

View unified portfolio

$ perp portfolio
Exchange Equity Positions Margin Ratio
Pacifica $12,340.50 3 0.08
Hyperliquid $28,102.97 5 0.12
Lighter $8,080.00 1 0.05
─────────────────────────────────────────────
Total $48,523.47 9 0.10

Bridge USDC cross-chain ($0 fee)

$ perp bridge 1000 solana arbitrum
Bridged 1,000 USDC from Solana → Arbitrum via CCTP V2
Tx: 0x3f8a...c2d1 | Fee: $0.00

Three Exchanges, One Interface

perp-cli abstracts away chain differences. The same commands and output format work across every supported exchange.

Pacifica

Solana

Native SOL margin, sub-second finality, deep SOL/ETH/BTC liquidity, cross-margin support.

$ perp -e pac trade market ETH buy 0.1

Hyperliquid

HyperEVM

150+ perpetual markets, sub-cent gas fees, native spot trading, vault and staking support.

$ perp -e hl trade market ETH buy 0.1

Lighter

Ethereum

Central limit order book, ETH-native settlement, tight spreads on majors, API key management.

$ perp -e lig trade market ETH buy 0.1

Built for AI Agents

Every design decision is optimized for programmatic consumption. Structured output, runtime introspection, and MCP integration make perp-cli a first-class tool for AI agents.

Structured JSON output

$ perp --json --fields totalEquity,risk portfolio
{
"ok": true,
"data": {
"totalEquity": 48523.47,
"risk": {
"level": "low",
"marginRatio": 0.12,
"liquidationDistance": 0.67
}
},
"meta": { "timestamp": "2026-03-14T..." }
}

MCP Server mode

$ perp agent mcp-server
MCP server listening — compatible with Claude, Cursor, and AI IDEs
  • --json Typed JSON envelope on every command
  • --fields Request only the fields you need
  • --dry-run Validate trades before execution
  • --ndjson Stream large result sets
  • agent schema Runtime command introspection
  • MCP Model Context Protocol server

Getting Started

Three commands to go from zero to your first trade.

$ npm install -g perp-cli
$ perp wallet set hl <YOUR_EVM_KEY>
Wallet saved for hyperliquid
$ perp --json portfolio
{ "ok": true, "data": { "totalEquity": 10000.00, ... } }

The same EVM key works for both Hyperliquid and Lighter. Keys are stored locally in ~/.perp/wallets.yaml.

Frequently Asked Questions