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

@solpredict/cli

v0.2.1

Published

Command-line interface and Claude/MCP plugin for trading on SolPredict prediction markets on Solana.

Readme

@solpredict/cli

Command-line interface and Claude/MCP plugin for trading on SolPredict prediction markets on Solana.

npm version Node 20.19.x Solana MCP Local signing

SolPredict CLI lets you inspect markets, quote trades, manage funds and margin, place orders, and bootstrap Claude/MCP agents from one local-signing command line.

Install

npm install -g @solpredict/cli

Requires Node >=20.19.0 <21.

Quickstart

solpredict --info
solpredict wallet show --network devnet
solpredict markets list --network devnet --limit 10
solpredict markets quote 1 --side buy --outcome yes --size 100 --price 5500

For state-changing commands, add the flags you want and review the confirmation prompt:

solpredict trade buy 1 --outcome yes --size 100 --price 5500 --network devnet

What You Can Do

| Area | Commands | | --- | --- | | Discovery | solpredict --info, solpredict info, solpredict instructions, solpredict banner | | Setup | setup status, setup cash, setup margin | | Wallet and funding | wallet show, wallet airdrop, balance, funding deposit, funding withdraw, funding show | | Markets | markets list, markets show, markets quote, markets orderbook, markets trades, markets create | | Trading | trade buy, trade sell, trade cancel, trade match, orders list, orders show, orders cleanup, orders close | | Positions and PnL | positions list, positions show, positions close, leaderboard top | | Liquidity | liquidity provide, liquidity remove, liquidity claim-fees, liquidity close, liquidity show | | Margin | margin init, margin status, margin deposit, margin withdraw, margin provide-liquidity, margin remove-liquidity, margin close-position, margin close-order, margin cancel-close-order, margin close-liquidity, margin close-account | | Resolution | resolution show, resolution challenge, resolution claim-bond, resolution settle-batch, resolution claim-creator | | Protocol | protocol show |

Safety Model

  • Keys stay local. The CLI loads a Solana keypair from your configured path or environment and signs on your machine.
  • State-changing commands prompt before submitting. --yes is available only when you intentionally want non-interactive execution.
  • Mainnet requires an additional typed mainnet confirmation.
  • wallet airdrop refuses to run on mainnet.
  • Use markets quote before trade buy or trade sell so cost/proceeds are explicit before signing.

Configuration

Global flags:

| Flag | Description | | --- | --- | | --keypair <path> | Path to a Solana keypair JSON file. | | --network <net> | devnet (default), mainnet-beta, or testnet. | | --rpc-url <url> | Override the network RPC endpoint. | | --api-url <url> | Override the off-chain API endpoint for API-backed commands. | | --output text\|json | Output format. Default: text. | | --yes | Skip the confirmation prompt on state-changing commands. | | --collateral-mint <pk> | Override the collateral mint where applicable. |

Wallet resolution order:

  1. --keypair <path>
  2. SOLPREDICT_KEYPAIR
  3. ANCHOR_WALLET
  4. SOLPREDICT_KEYPAIR_BASE64
  5. ~/.config/solana/id.json

Network and RPC defaults:

| Source | Default | | --- | --- | | --network / SOLPREDICT_NETWORK / NEXT_PUBLIC_SOLANA_NETWORK | devnet | | --rpc-url / SOLPREDICT_RPC_URL / NEXT_PUBLIC_SOLANA_RPC_URL | network default RPC | | --api-url / SOLPREDICT_API_URL / NEXT_PUBLIC_API_URL | unset |

AI Agent Setup

The package supports three AI setup paths:

claude plugin install solpredict
solpredict instructions | pbcopy
node ./node_modules/@solpredict/cli/dist/mcp/server.js

Use solpredict instructions --format=json when a client wants a structured setup contract. The contract includes safety rules, unit conversions, workflows, command metadata, and MCP details.

The package also ships a Claude plugin manifest (plugin/plugin.json), slash-command docs (plugin/commands), and skill guidance (plugin/skills/solpredict/SKILL.md). The MCP stdio server is exported as @solpredict/cli/mcp and exposes a read-only solpredict_instructions tool.

Safety rules for every assistant:

  • Never read, print, summarize, log, paste, or expose keypair file contents.
  • Use --output json for machine-readable reads.
  • Quote before trades.
  • Confirm every state-changing command before running it.
  • Surface mainnet before signing.
  • Relay on-chain error code and Anchor error name verbatim.

Command Examples

Discovery

solpredict --info
solpredict info margin
solpredict banner

Onboarding

solpredict wallet airdrop --sol 1 --network devnet
solpredict setup status
solpredict setup cash --amount 10.0
solpredict setup margin --amount 25.0

Markets and Trading

solpredict markets list --limit 10
solpredict markets show 1
solpredict markets orderbook 1 --depth 10
solpredict markets quote 1 --side buy --outcome yes --size 100 --price 5500

solpredict trade buy 1 --outcome yes --size 100 --price 5500
solpredict trade sell 1 --outcome yes --size 50 --price 6000
solpredict trade cancel 1 42
solpredict trade match 1 --yes-order 42 --no-order 43

Funding, Liquidity, and Margin

solpredict funding deposit --amount 1.0
solpredict funding withdraw --amount 0.5
solpredict funding show

solpredict liquidity provide 1 --amount 5.0
solpredict liquidity claim-fees 1
solpredict liquidity remove 1 --shares 2.0

solpredict margin status
solpredict margin deposit --amount 10.0
solpredict margin withdraw --amount 5.0
solpredict margin provide-liquidity --amount 5.0
solpredict margin remove-liquidity --shares 2.0
solpredict margin close-position 1 --outcome yes
solpredict margin close-order 1 --outcome yes --price 55 --size 1000000
solpredict margin cancel-close-order 1 42 --outcome yes
solpredict margin close-liquidity

Resolution and Protocol

solpredict resolution show 1
solpredict resolution challenge 1 --outcome no --evidence-url <url>
solpredict resolution claim-bond 1 --challenge-index 0
solpredict resolution settle-batch 1 --owner <pubkey> --owner <pubkey>

solpredict protocol show
solpredict leaderboard top --sort pnl --limit 20

Output Formats

All commands accept --output text|json. JSON output stringifies BigInt, BN, and PublicKey values so downstream tools can parse command output without precision loss.

Amount Parsing

Funding, liquidity, margin, and setup commands accept --amount and --shares in two forms:

  • Decimal, such as --amount 1.25, parsed against the collateral mint decimals.
  • Raw integer, such as --amount 1250000, interpreted as minor units.

Both interpretations are echoed in confirmation output before a transaction is submitted.

Development

From the monorepo:

pnpm install
pnpm --filter @solpredict/cli build
node packages/cli/dist/bin/solpredict.js --help

The build writes:

  • packages/cli/dist/bin/solpredict.js - executable CLI binary.
  • packages/cli/dist/mcp/server.js - MCP stdio server.

Development checks:

pnpm --filter @solpredict/cli test
pnpm --filter @solpredict/cli typecheck

Published Install Certification

The published npm package (not the repo dist) is certified end-to-end against an isolated Node 20.19.x install:

# NODE20_BIN points at a Node 20.19.x bin dir (see the runbook for the path).
export PATH="$NODE20_BIN:$PATH"
export SOLPREDICT_CLI_PUBLISHED_NODE20="$NODE20_BIN/node"
export SOLPREDICT_CLI_PUBLISHED_NPM20="$NODE20_BIN/npm"
export SOLPREDICT_CLI_PUBLISHED_KEYPAIR_A=/path/to/devnet-trader-a.json
pnpm test:e2e:cli:published:readonly

Evidence is written to artifacts/cli-published-install-certification/$RUN_ID/. See docs/runbooks/CLI_PUBLISHED_INSTALL_CERTIFICATION.md for read-only, full stateful, skip-install, and host-distribution modes.