CLI and core library for trading on Pacifica — the #1 Solana perps DEX. 36 tools for market data, trading, positions, and account management.
Package Exports
@pacifica-dev/cli
Readme
@pacifica-dev/cli
CLI and core library for trading on Pacifica — the #1 Solana perps DEX. 36 tools for market data, trading, account management, and real-time monitoring.
Install
npminstall-g @pacifica-dev/cli
CLI Usage
Market Data
# All market prices
pacifica prices
# Single market
pacifica prices --symbol BTC
# Orderbook depth
pacifica orderbook --symbol ETH
# Candles
pacifica candles --symbol SOL --interval 1h --limit20# Funding rates
pacifica funding-rates --symbol BTC --limit5
Account Monitoring
# Account overview
pacifica account --account Hwv9DcDacBD3NPGPvkppSQ8bzGQv1AdxfVMF538fh63e
# Open positions
pacifica positions
# Trade history
pacifica trade-history --limit10# Portfolio equity curve
pacifica portfolio --time-range 7d
# Open orders
pacifica orders
Trading
# Market order — bid = long, ask = short
pacifica market-order --symbol ETH --side bid --amount0.1# Limit order
pacifica limit-order --symbol BTC --side ask --amount0.001--price80000# Set stop loss
pacifica set-tpsl --symbol ETH --side bid --sl2100# Cancel an order
pacifica cancel --symbol ETH --order-id 306672002# Cancel all orders
pacifica cancel --all-symbols
# Set leverage
pacifica set-leverage --symbol SOL --leverage10
Subaccounts
# Create a subaccount (key saved locally)
pacifica create-subaccount
# List subaccounts
pacifica list-subaccounts
# Transfer funds
pacifica transfer-funds --to<address>--amount100
# Show wallet address, balance, subaccounts
pacifica wallet
# List all commands
pacifica tools
# Full help
pacifica --help
Library Usage
This package also exports createMcpServer() for building custom MCP server wrappers:
import{ createMcpServer }from"@pacifica-dev/cli";import{ StdioServerTransport }from"@modelcontextprotocol/sdk/server/stdio.js";const server =createMcpServer();const transport =newStdioServerTransport();await server.connect(transport);
All 36 Tools
Market Data (7)
Command
Description
markets
List all perpetual markets with specs
prices
Real-time mark/oracle prices, funding, OI, volume
orderbook
Order book bids & asks
candles
OHLCV candlestick data
mark-candles
Mark price OHLCV candles
recent-trades
Recent trades for a market
funding-rates
Historical funding rate data
Account Monitoring (9)
Command
Description
account
Balance, equity, margin, positions count
account-settings
Leverage & margin mode per market
positions
Open positions with entry price
trade-history
Historical trades with P&L and fees
portfolio
Equity history over time
balance-history
Deposits, withdrawals, funding events
orders
All open orders
order-history
Historical orders
order-by-id
Full event history for a specific order
Trading (11)
Command
Description
market-order
Place a market order (bid=long, ask=short)
limit-order
Place a limit order with TIF options
stop-order
Place a stop order
edit-order
Edit an existing order's price/amount
batch-order
Submit up to 10 create/cancel actions
set-tpsl
Set take-profit / stop-loss
cancel
Cancel order(s)
cancel-stop
Cancel a stop order
set-leverage
Set leverage for a market
set-margin-mode
Switch cross / isolated margin
withdraw
Withdraw USDC from Pacifica
Subaccounts (3)
Command
Description
create-subaccount
Create subaccount (key saved locally)
list-subaccounts
List all subaccounts
transfer-funds
Transfer USDC between accounts
Real-Time (4)
Command
Description
watch
Snapshot: collect data for N seconds
watch-start
Start persistent background subscription
watch-read
Read buffered events
watch-stop
Stop a subscription
System (2)
Command
Description
wallet
Wallet address, balance, subaccounts
tools
List all available commands
Configuration
On first run, a Solana wallet is auto-generated at ~/.pacifica-mcp/config.json (mode 0600). Subaccount keys are saved to ~/.pacifica-mcp/subaccounts/. Private keys never leave your machine.