perp-cli
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PACIFICA_PRIVATE_KEY | Yes | Private key for Pacifica (Solana key). | |
| LIGHTER_API_KEY_INDEX | No | Override for Lighter API key index. Indexes 0–3 are reserved by Lighter's frontend. perp-cli defaults to index 4. Valid range: 4–254. | |
| HYPERLIQUID_PRIVATE_KEY | Yes | Private key for Hyperliquid (EVM-compatible key). Also used for Lighter. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_marketsA | Get all available perpetual futures markets on an exchange, including price, funding rate, volume, and max leverage. Works without API keys. |
| get_orderbookA | Get the order book (bids and asks) for a symbol on an exchange. Works without API keys. |
| get_funding_ratesA | Compare funding rates across all 4 exchanges (Pacifica, Hyperliquid, Lighter, Aster). Returns rates per symbol with spread analysis |
| get_pricesA | Get cross-exchange prices for symbols. Fetches mark prices from all 4 exchanges for comparison |
| get_balanceA | Get account balance (equity, available margin, margin used, unrealized PnL) on an exchange |
| get_positionsA | Get all open positions on an exchange, including size, entry price, PnL, leverage |
| get_open_ordersB | Get all open/pending orders on an exchange |
| portfolioA | Cross-exchange portfolio summary: balances, positions, and risk metrics across all 4 exchanges |
| suggest_commandA | 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 |
| explain_commandA | Explain what a perp CLI command does, its parameters, and any risks. Helps the user understand a command before running it |
| arb_scanA | Scan for funding rate arbitrage opportunities across exchanges. Finds symbols with the largest funding rate spreads |
| health_checkA | Ping all 4 exchanges and return connectivity status and latency |
| trade_previewA | 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. |
| trade_executeA | Execute a trade. IMPORTANT: Always call trade_preview first and get explicit user confirmation before calling this tool. Supports market and limit orders. |
| trade_closeA | Close an existing position. IMPORTANT: Call trade_preview first with the opposite side to show impact, then get user confirmation. |
| get_funding_analysisA | Analyze funding income across exchanges — cumulative totals, annualized rates, and per-arb-position breakdown. Great for tracking funding arb profitability. |
| get_pnl_analysisA | P&L analysis combining trading fees and funding income — shows net profit/loss by exchange with daily breakdown |
| get_arb_compareA | Compare active arbitrage positions side by side — ROI, funding income, price PnL, and annualized returns for each position |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| trading-guide | Step-by-step guide for trading with perp-cli via this MCP server. Covers market data lookup, trade preview, execution, and position management. |
| arb-strategy | Funding rate arbitrage strategy guide. How to find, execute, and manage cross-exchange arbitrage positions using perp-cli. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| cli_schema | Full CLI command schema — all commands, args, options, exchanges, and error codes |
| market_prices | Live cross-exchange prices for all perpetual futures markets |
| funding_rates | Current funding rates across all exchanges with spread analysis |
TDQS
Scored across 18 tools
Each tool targets a distinct operation or data type: scanning, comparison, analysis, trading steps, health check, etc. Even related tools like arb_scan and get_arb_compare have clearly separated purposes (opportunities vs active positions), and get_balance vs portfolio differ by scope (single exchange vs cross-exchange summary). No harmful overlap.
The naming mixes conventions: most retrieval tools use the verb get_ (e.g., get_balance, get_markets), but some use noun-first patterns (arb_scan, health_check, portfolio) or verb-noun with trade_ prefix (trade_close, trade_execute, trade_preview). While readable, the inconsistency can cause an agent to mispredict tool names.
18 tools cover a broad but focused domain: cross-exchange trading, arbitrage, portfolio management, and health checks. Each tool serves a clear purpose, and the count is well-scoped—neither sparse nor overwhelming for the intended functionality.
The tool surface covers the full trading lifecycle (preview, execute, close) and provides rich analysis (funding, P&L, arbitrage) and monitoring (health, portfolio). A notable gap is the absence of a cancel_order tool, which could break workflows when the user needs to cancel an open order. Otherwise, it is comprehensive.