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

@blinks-labs/spm

v0.1.1

Published

Solana Portfolio Manager CLI — swap, invest, trade, and predict from the terminal with a local keypair.

Readme

@blinks-labs/spm

Solana Portfolio Manager CLI — swap, invest, trade, and predict from the terminal, signing with a local Solana keypair.

npm install -g @blinks-labs/spm
# or run without installing
npx @blinks-labs/spm swap --in SOL --out USDC --amount 0.01 --simulate

Requires Node.js 20+.

Commands

| Command | What it does | | --- | --- | | swap | Swap tokens via Jupiter | | trade | Phoenix Eternal perps — markets, positions, orders, collateral | | invest | Kamino Earn vaults — list, position, deposit, withdraw | | predict | Jupiter prediction markets — events, positions, bet, close, claim |

Swap

spm swap --in SOL --out USDC --amount 0.01 [--slippage-bps 50] [--simulate] [--yes] [--json]

--in / --out accept a known symbol (SOL, USDC, USDT, JUP, BONK, …) or any base58 mint address — decimals for unknown mints are read on-chain.

The CLI prints a preview (expected output, minimum received, price impact, route, priority fee) and asks for confirmation before signing. Use --simulate for a dry run that never broadcasts, or --yes to skip the prompt in scripts.

$ spm swap --in SOL --out USDC --amount 0.01 --simulate

Swap on mainnet-beta
  Wallet           CgKa8mrAHCJ1jPPMbyoUMG9i6wn79Ea6xHrmMkSWXBfU
  RPC              https://api.mainnet-beta.solana.com
  Pay              0.01 SOL (10000000 atomic)
  Receive ~        0.721099 USDC
  Min received     0.717494 USDC (slippage 50 bps)
  Price impact     0.0011%
  Route            GoonFi V2
  Priority fee     0.000065718 SOL

Trade

Perpetual futures on Phoenix Eternal. 60+ markets — crypto, equities and commodities.

spm trade markets [--filter SOL] [--limit 25]     # no wallet needed
spm trade positions [--address <pubkey>]
spm trade deposit  --amount 25                    # USDC wallet → collateral
spm trade open  --market SOL --side long --size 0.5 [--limit-price 70]
spm trade close --market SOL [--size 0.2]
spm trade cancel --market SOL
spm trade withdraw --amount 10

markets needs no keypair at all, and positions --address <pubkey> reads any wallet — handy for checking an account before you fund one.

$ spm trade markets --filter SOL

  SYMBOL    STATUS     MAX LEV   TAKER FEE
  SOL       active         25x      0.035%

$ spm trade open --market SOL --side long --size 0.1 --simulate

Market order — long 0.1 SOL
  Wallet           5sd6f47RF9EtacmZcsBbPx2DcDDePWN8JVWfycHj3rqd
  Market           SOL (max 25x)
  Size             0.1 SOL
  Mark price       73.9100
  Notional         ~7.39 USDC
  Taker fee        ~0.0026 USDC
  Margin           cross (subaccount 0)

Collateral is USDC, and you must deposit before your first order — that call also creates your Phoenix trader account. Orders use cross margin against that balance; isolated margin and TP/SL are only in the web app for now.

Phoenix perps are mainnet-only, so --cluster devnet is rejected rather than silently trading somewhere unexpected.

Invest

Kamino Earn vaults. Deposits earn yield as the vault's share price rises; withdrawing redeems shares back to the underlying token.

spm invest vaults [--token USDC] [--limit 8]       # no wallet needed
spm invest position --vault <address> [--address <pubkey>]
spm invest deposit  --vault <address> --amount 10
spm invest withdraw --vault <address> [--percent 50]
$ spm invest vaults --limit 3

  VAULT                            APY           TVL  HOLDERS  ADDRESS
  Ethena PYUSD Prime             2.63%      $250.69M       14  4TwKA9JX…
  Sentora PYUSD                  6.37%      $119.21M     3604  A2wsxhA7…
  Steakhouse High Yield USDG     7.21%       $35.17M      674  BoZDRc1R…

--percent defaults to 100, and withdrawals redeem shares directly rather than converting through a token amount, which avoids share/token rounding.

Predict

Jupiter prediction markets. Contracts settle at $1.00, so a YES bought at $0.62 pays $1.00 if the market resolves yes — the price is the implied probability.

spm predict events [--category crypto] [--filter bitcoin] [--limit 15]
spm predict market --market <id>            # or --event <id> for every market
spm predict positions [--address <pubkey>]
spm predict bet   --market <id> --side yes --amount 5 [--limit-price 0.62]
spm predict close --position <pubkey>       # sell back early
spm predict claim --position <pubkey>       # collect a settled win

Bets deposit USDC by default (--token SOL|JUPUSD for the others); the minimum order is $5. spm predict positions prints a ready-to-run claim line for any position that has settled in your favour.

Unlike the other commands, predict never talks to RPC: Jupiter returns an unsigned transaction, the CLI signs it locally, and Jupiter's keeper network submits it. There is nothing to simulate, so --simulate is rejected rather than silently ignored.

Signing

Transactions are signed locally. The keypair is resolved in this order:

  1. --keypair <path>
  2. $SPM_KEYPAIR — path to a keypair JSON file
  3. $SPM_SECRET_KEY — base58-encoded secret key
  4. ~/.config/solana/id.json

Your secret key is read from disk, used to sign in-process, and never sent anywhere — quotes go to Jupiter and only the signed transaction goes to the RPC endpoint you choose. There is no backend and no account: the CLI is non-custodial, and nothing happens on-chain without a signature from your key.

Prefer --simulate first on anything unfamiliar, and treat a keypair file used with --yes in a script the same way you would treat any other hot wallet.

Network

By default the CLI talks directly to Jupiter, Phoenix, Kamino and a Solana RPC node. Choose an endpoint with --rpc <url> or --cluster <mainnet-beta|devnet|testnet|localnet>. Without either, it uses RPCFAST_URL, then ALCHEMY_API_KEY, then HELIUS_API_KEY, then the public mainnet endpoint. Set JUPITER_API_KEY to use Jupiter's keyed host for higher rate limits.

Output

Human-readable output goes to stderr; --json emits a single JSON object on stdout, so spm swap … --json | jq works cleanly.

Exit codes: 0 success · 2 usage/arguments · 3 keypair · 4 quote/build · 5 on-chain.

License

MIT © Blinks Labs