npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pacifica-cli

v0.1.0

Published

Agent-native trading terminal for Pacifica DEX

Downloads

10

Readme

⚡ Pacifica CLI

Agent-native trading terminal for Pacifica DEX

Version Node License MCP Network

One codebase. Three interfaces. Full agent control.

Architecture


What is Pacifica CLI?

A terminal-first trading suite for the Pacifica perpetuals DEX — built for traders who live in the terminal and AI agents that need programmatic market access.

┌─────────────────────────────────────────────────────────────────┐
│                        pacifica scan                            │
├──────────┬──────────┬────────┬──────────────┬────────┬─────────┤
│ Symbol   │   Price  │  24h % │    Volume    │   OI   │ Funding │
├──────────┼──────────┼────────┼──────────────┼────────┼─────────┤
│ BTC-PERP │ 69,420   │ +2.4%  │  $48.2M      │ $120M  │ +0.01%  │
│ ETH-PERP │  3,852   │ +1.1%  │  $21.6M      │  $58M  │ +0.008% │
│ SOL-PERP │    182   │ -0.8%  │   $9.4M      │  $24M  │ -0.003% │
│ JTO-PERP │   4.21   │ +5.2%  │   $3.1M      │   $8M  │ +0.021% │
└──────────┴──────────┴────────┴──────────────┴────────┴─────────┘
                              Live  ●  testnet

Three Interfaces, One Codebase

| Interface | Command | Purpose | |-----------|---------|---------| | CLI / TUI | pacifica <cmd> | Rich terminal UI — live markets, orders, positions, PnL | | MCP Server | pacifica-mcp | 28 tools for AI agents (Claude, Cursor, any MCP client) | | Claude Skills | /scan, /trade, /journal | Slash commands for agent-assisted workflows |


Quick Start

Step 1 — Activate your wallet

Before using the CLI, activate your wallet on the Pacifica testnet app:

  1. Go to test-app.pacifica.fi
  2. Connect your Solana wallet (Phantom, Backpack, etc.)
  3. Enter access code: Pacifica
  4. Use the Faucet to mint test USDP

Step 2 — Install & configure

npm install -g pacifica-cli
pacifica init --testnet

The init wizard will ask for your private key and set safe defaults for leverage, slippage, and agent guardrails.

Step 3 — Start trading

pacifica scan                          # live market feed
pacifica trade buy ETH 0.5 --lev 5    # place a market order
pacifica positions                     # view open positions
pacifica journal                       # PnL history & stats

Command Reference

Markets

pacifica scan                          # live prices, volume, funding, OI
pacifica funding                       # funding rates sorted by APR

Trading

pacifica trade buy  <symbol> <size>    # market buy
pacifica trade sell <symbol> <size>    # market sell
pacifica trade buy  <symbol> <size> --limit <price>   # limit order
pacifica trade buy  <symbol> <size> --lev 10 --tp 4200 --sl 3600

Orders & Positions

pacifica orders                        # list open orders
pacifica orders cancel <id>            # cancel one order
pacifica orders cancel-all [symbol]    # cancel all (or by symbol)

pacifica positions                     # open positions with PnL
pacifica positions close <symbol>      # close at market
pacifica heatmap                       # risk heatmap (live, color-coded)

Smart Orders (Automation)

pacifica smart add-trailing <symbol> <distance%>     # trailing stop
pacifica smart add-partial-tp <symbol>               # multi-level take-profit
pacifica smart list                                   # active automations
pacifica smart cancel <id>                            # remove automation

Journal & Analytics

pacifica journal                       # full trade history
pacifica journal --symbol ETH          # filter by market
pacifica journal --period week         # today / week / month / all

Agent Control

pacifica agent status                  # guardrails, budget, recent actions
pacifica agent config                  # edit limits interactively
pacifica agent log                     # full audit trail
pacifica agent stop / start            # disable / enable agent trading

Alerts

pacifica alerts add --symbol BTC --above 100000
pacifica alerts add --symbol ETH --funding-above 0.001 --note "funding squeeze"
pacifica alerts check
pacifica alerts list
pacifica alerts remove <id>

Scan with Filters

pacifica scan --gainers                          # sort by 24h gain
pacifica scan --losers                           # sort by 24h loss
pacifica scan --gainers --min-volume 5000000     # gainers with >$5M volume
pacifica scan --json | jq '.[0]'                 # pipe-friendly JSON output

AI Agent Integration (MCP)

Add to your Claude Desktop or Cursor config to give Claude full trading access with built-in guardrails:

{
  "mcpServers": {
    "pacifica": {
      "command": "npx",
      "args": ["-y", "pacifica-cli", "--mcp"]
    }
  }
}

Available MCP Tools

Intelligence Tools (5 — agent-readable data)

| Tool | Purpose | |------|---------| | pacifica_top_markets | Ranked markets by gainers/losers/volume/OI/funding with optional liquidity gate | | pacifica_liquidity_scan | Order book depth, spread%, slippage estimates at $10k/$50k/$100k | | pacifica_trade_patterns | Buy pressure, VWAP, whale order detection, momentum signal | | pacifica_alert_triage | Prioritized alert list: triggered first, near-trigger second | | pacifica_market_snapshot | Full market intelligence snapshot (schemaVersion: "1.0") |

All write tools pass through the guardrail system — order size limits, leverage caps, daily spending budget, and action whitelist are enforced on every agent call.


Agent Safety Guardrails

Every agent action is checked before execution:

Agent call
   │
   ├─ ① Agent enabled?
   ├─ ② Action in blocked list?        → reject
   ├─ ③ Action in allowed list?        → reject if not
   ├─ ④ Order size ≤ max_order_size?   → reject if over
   ├─ ⑤ Leverage ≤ max_leverage?       → reject if over
   └─ ⑥ Daily spend + order ≤ budget?  → reject if over
          │
          └─ amount > confirm_threshold? → ask for confirmation

Configure limits in ~/.pacifica.yaml:

agent:
  enabled: true
  daily_spending_limit: 5000   # USD
  max_order_size: 2000         # USD per order
  max_leverage: 5
  allowed_actions:
    - place_order
    - close_position
    - cancel_order
    - set_tpsl
  require_confirmation_above: 1000

Architecture

┌─────────────────────────────────────────────────────────────┐
│                        User / Agent                         │
└──────────────────┬───────────────────┬──────────────────────┘
                   │                   │
         ┌─────────▼──────┐   ┌────────▼────────┐
         │   CLI (TUI)    │   │   MCP Server    │
         │  Commander.js  │   │  stdio / tools  │
         │  Ink (React)   │   │   28 tools      │
         └─────────┬──────┘   └────────┬────────┘
                   │                   │
         ┌─────────▼───────────────────▼──────┐
         │             Core Layer              │
         │                                     │
         │  ┌───────────┐  ┌───────────────┐  │
         │  │  SDK      │  │   Agent       │  │
         │  │  Client   │  │   Guardrails  │  │
         │  │  Signer   │  │   Spending    │  │
         │  │  WS       │  │   Logger      │  │
         │  └─────┬─────┘  └───────────────┘  │
         │        │                            │
         │  ┌─────┴──────────────────────┐     │
         │  │  Smart Orders · Risk Calc  │     │
         │  │  Journal · Config          │     │
         │  └────────────────────────────┘     │
         └────────────────┬────────────────────┘
                          │
         ┌────────────────▼────────────────────┐
         │          Pacifica DEX API            │
         │   REST (signed Ed25519) + WebSocket  │
         │   Testnet: test-api.pacifica.fi      │
         │   Mainnet: api.pacifica.fi           │
         └─────────────────────────────────────┘

Local Data Files

All data is stored locally — no external database required:

| File | Purpose | |------|---------| | ~/.pacifica.yaml | Config: network, keys, agent limits | | ~/.pacifica/spending.json | Daily budget ledger (auto-resets midnight) | | ~/.pacifica/agent-log.json | Append-only audit trail of all agent actions | | ~/.pacifica/journal.json | Trade log: fills, closes, smart order triggers | | ~/.pacifica/smart-orders.json | Active trailing stops & partial take-profits |

All files are created with chmod 0o600 (owner read/write only).


Built for The Synthesis Hackathon

| Track | Tech | |-------|------| | Pacifica DEX | Perpetuals trading, Ed25519 signing, WebSocket feeds | | Claude MCP | 28 tools with full guardrail enforcement | | Solana | Keypair auth, base58 encoding | | Terminal UI | Ink (React-in-terminal), Commander.js |


Pacifica DEX · Report an Issue · The Synthesis Hackathon