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 |
|---|---|
| pacifica_print_productsA | Pacifica Print products (read-only): game id (e.g. BTC_24H, BTC_7D, BTC_1M), cycle length in days, max leverage, deposit caps, allowed target distance from mark. Print = a strike order that earns a premium each cycle; while resting it fills / is liquidated only at a cycle checkpoint, after a fill it is an ordinary perp position (continuous liquidation). |
| pacifica_print_quoteA | Validate a Pacifica Print order and preview it (read-only, nothing signed): notional, size on fill, docs-formula liquidation price (an outer bound — a liquidation was observed earlier in one live case; venue trigger unpublished), max loss (deposit + premiums), lock period. The premium is not quoted (the venue's preview is a signed request). Placing the order is CLI-only: perp -e pacifica print deposit … (supports --dry-run). |
| pacifica_print_positionsB | Pacifica Print orders of an account (read-only): current orders, or with history=true every order (paginated: limit / cursor). Status printing | cancelling | filled | liquidated | cancelled | completed | ended. |
| pacifica_vaultsA | Pacifica vaults (API: lakes), read-only. Without vault: every vault (TVL, NAV per share, fee, lock-up, withdrawal window, config); with account: plus that account's shares. With vault (address, or a nickname matching exactly one vault — an ambiguous nickname is INVALID_PARAMS listing the candidates): one vault plus live account equity, positions, deposit whitelist (unofficial endpoint, advisory) and whether withdrawals are open now. APY is not published (null). Deposits / withdrawals are CLI-only: perp -e pacifica vault deposit|withdraw (supports --dry-run). |
| get_marketsA | Get all available perpetual futures markets on an exchange, including price, funding rate, volume, and max leverage. Works without API keys (public market data). Hyperliquid: native perps only (HIP-3 dexes via the CLI --dex). |
| get_orderbookA | Get the order book (bids and asks) for a symbol on an exchange. Works without API keys on every venue with an account API (configured credentials → the account adapter; none → the public endpoint / read-only adapter); market-data-only venues have no orderbook path. Hyperliquid: native perps only (HIP-3 dexes via the CLI --dex). |
| get_funding_ratesA | Compare funding rates across every market-data venue whose funding rate is verified. Returns rates per symbol with spread analysis. includeUnverified also returns venues whose rate is unverified (QFEX; TxFlow — rate not checked against settled payments; Variational — a predicted rate not checked against settled payments; GRVT — indicative rate; Extended — not checked against settled payments), each row tagged fundingVerified / apiStatus — display only, never a basis for trading (mirrors the CLI |
| get_pricesB | Get cross-exchange prices for symbols. Fetches mark prices from every market-data venue for comparison; a venue appears in a row only when it lists that symbol (e.g. QFEX lists no BTC). Each row's unofficialApiVenues names the venues in it read through an undocumented API (none at present) — like get_markets' venueApi tag. |
| get_outcome_marketsA | 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_viewA | Get a combined view of one outcome market: all sides' books in parallel + underlying mark price gap (vs targetPrice) + time to expiry + per-side implied probability (mid sum). For binary markets, the symmetric structure means Yes bid + No ask ≈ 1.0 — the view exposes both sides in a single round-trip and surfaces directional context (e.g., is BTC currently above the target). Public read. |
| get_outcome_bookB | Get the orderbook for one outcome side. Public read — no API key needed. |
| get_option_expiriesA | List the active option expiries of an underlying on an options venue (Derive): per expiry the UTC date (YYYY-MM-DD), expiry ms, strike and instrument counts, soonest first. Public read — no API key needed. |
| get_option_chainA | Option chain for one expiry (Derive): rows per strike with call and put quotes — bid / ask (price + size; null = empty side), mark, index, forward, IV (mark / bid / ask; null = not computable), greeks (delta, gamma, theta, vega, rho), open interest, 24h volume — plus the ATM strike. Decimals are strings. One venue request per expiry. Public read. |
| get_option_quoteA | Quote one option instrument (Derive name, e.g. ETH-20261225-3500-P): bid / ask (price + size), mark, index, forward, IV, greeks, open interest, 24h stats. Unknown instrument → SYMBOL_NOT_FOUND. Public read. |
| get_outcome_positionsA | Get the active account's open outcome positions (size, entry notional, mark price, unrealized PnL). Requires a configured Hyperliquid wallet or agent. |
| get_balanceA | Get account balance (equity, available margin, margin used, unrealized PnL) on an exchange. Hyperliquid: native perps only (HIP-3 dexes via the CLI --dex). |
| get_positionsA | Get all open positions on an exchange, including size, entry price, PnL, leverage. Hyperliquid: native perps only (HIP-3 dexes via the CLI --dex). |
| get_positions_by_addressA | Open positions of ANY account by its public address — keyless, read-only (public venue data; nothing is signed, no key is needed). Venues: pacifica (base58 Solana address), hyperliquid (0x address), lighter (0x address), lighter-rh (0x address), risex (0x address). Hyperliquid reads the native dex and every HIP-3 dex (rows carry dex: null | ""; a dex that fails is listed in meta.errors / meta.warnings — its rows are missing, not absent); Lighter reads every account of the address (rows carry accountIndex; accountIndex narrows). Other venues: CAPABILITY_UNSUPPORTED; a wrong address format: INVALID_PARAMS. Same rows as |
| get_balance_by_addressA | Balances of ANY account by its public address — keyless, read-only (public venue data; nothing is signed, no key is needed). Venues: pacifica (base58 Solana address), hyperliquid (0x address), lighter (0x address), lighter-rh (0x address), risex (0x address); omit exchange to read every one of them (a venue that fails, address format included, is listed in data.errors). data: { balance (equity / available / marginUsed / unrealizedPnl + venue extras; null on Lighter), spot (token balances; null where the venue does not publish them), accounts (Lighter: one row per account of the address; accountIndex narrows), dexes + accountMode (Hyperliquid: HIP-3 dexes with a non-zero account value; a dex that fails is in meta.errors / meta.warnings — unknown, not zero) }. Other venues: CAPABILITY_UNSUPPORTED; a wrong address format: INVALID_PARAMS. Same data as |
| get_open_ordersA | Get all open/pending orders on an exchange. Hyperliquid: native perps only (HIP-3 dexes via the CLI --dex). |
| portfolioA | Cross-exchange portfolio summary: balances, positions, and risk metrics across all exchanges with configured credentials |
| 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 every registered venue on the server's network and return connectivity status and latency. Pacifica / Hyperliquid / Lighter / Aster / QFEX: REST ping (status = HTTP status, 0 = no response); every other venue: its public market-data read (status null). A failure carries its error message. |
| trade_previewA | Preview a trade WITHOUT executing. Runs trade_execute's pre-send checks read-only (size parse, order validation incl. TIF, quarantine, local risk limits — never forced) and reports any refusal as valid:false with its code + remediation; also returns the estimated fill price from the book, notional, margin impact, the builder fee the order would carry, and the existing position. Venue trading fees are NOT estimated. ALWAYS call this before trade_execute and show the result to the user for confirmation. Hyperliquid: native perps only (HIP-3 dexes via the CLI --dex). |
| trade_executeA | Execute a REAL trade on the server's network (meta.network; PERP_NETWORK, default mainnet). IMPORTANT: Always call trade_preview first and get explicit user confirmation before calling this tool. Refused with RISK_VIOLATION when the order breaches the local risk limits (perp risk set; there is no override over MCP) or when the symbol is quarantined (only reduce-only orders pass). Every order is written to the execution log. Supports market and limit orders. Returns the uniform OrderResult (status, finality, filledSize, execution: slippage / protection price / TIF sent) with the raw venue response under |
| trade_closeA | Close an existing position. IMPORTANT: Call trade_preview first with the opposite side to show impact, then get user confirmation. Verified close: |
| 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 31 tools
Most tools target distinct resources, but several clusters overlap: get_funding_rates / get_funding_analysis / arb_scan / get_arb_compare all concern funding and arbitrage, and get_positions / get_positions_by_address / get_outcome_positions require careful reading to distinguish. The by-address variants and the outcome view/book/markets trio are also close enough to invite misselection.
All names are snake_case and most use a get_ or trade_ verb prefix, but conventions are mixed: pacifica_print_* and pacifica_vaults use a venue prefix, arb_scan and health_check reverse to noun_verb, and portfolio/suggest_command/explain_command break the pattern. Readable, but not a predictable verb_noun scheme throughout.
31 tools is heavy for a perpetual-futures CLI server and several sit in overlapping analysis or venue-specific niches (Pacifica Print has three tools alone). The surface could be consolidated without losing capability.
Core workflows are covered — market data, account/position reads, trade preview/execute/close, funding and PnL analysis, options and outcomes. However, there is no cancel_order tool despite get_open_orders, and no order-status/history or leverage/margin modification, which are notable gaps for a trading server.