Purpose: perp-cli is a perpetual contract command-line tool for multiple decentralized exchanges (DEXs), and it also provides an MCP server so that MCP clients such as Claude Desktop and Cursor can invoke trading capabilities in an AI-driven way. It supports 8 venues in total: Pacifica (Solana), Hyperliquid (HyperEVM), Lighter (Ethereum), Aster (BNB Chain), Lighter RH, Ondo Perps, Arcus, and QFEX.
Main capabilities: market data allows querying prices, order books, funding rates, and arbitrage opportunities without an API Key; it supports funding rate arbitrage scanning (perp-perp and spot-perp) and one-click two-leg execution; a single call can return cross-exchange balances, positions, and risk levels; the funding group supports deposits, withdrawals, transfers, multi-provider cross-chain bridges (cctp/relay/debridge), and rebalancing between exchanges; built-in bots such as TWAP, grid, DCA, and trailing stop, plus background task management. The design emphasizes Agent-first, providing --json, --fields, --ndjson, --dry-run, and runtime schema introspection, and includes safety mechanisms such as pre-order validation, response sanitization, and client-id deduplication.
Usage: execute subcommands for trading, funding, bots, etc. via the command line; global flags include --json, --fields, --ndjson, --dry-run, --dex, and -w/--wallet. Exchanges can be selected with -e hyperliquid / -e pacifica / -e lighter / -e aster (aliases hl, pac, lt). The MCP server contains 18 tools, 3 resources, and 2 prompts. Setting PERP_NETWORK=testnet switches to testnet, and the result reports meta.network.
Limitations: some venues (Lighter RH, Ondo Perps, Arcus, QFEX) have no wallet private key path and require creating an agent/API Key on the official website and then importing it; operations such as withdrawals, transfers, and cross-chain bridges require the main wallet, otherwise NO_SIGNER_AVAILABLE is reported. Unsupported operations are explicitly rejected with CAPABILITY_UNSUPPORTED. QFEX is custodial and uses only an API Key; withdrawals require setting a local whitelist threshold in an interactive terminal. Some features (withdrawals, funding transfers, subaccounts, builder fees, claude-agent strategies, alerts/dashboards) have not yet been verified on mainnet.