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

pump-trader-v2

v0.1.3

Published

Unsigned Pump trade instruction builder.

Readme

pump-trader-v2

Build unsigned Pump buy/sell instructions with the official Pump SDKs.

Install

npm install

What it does

  • Accepts a token mint
  • Detects whether the token should trade on Pump bonding curve or Pump AMM
  • Uses @pump-fun/pump-sdk for bonding trades
  • Uses @pump-fun/pump-swap-sdk for AMM trades
  • Returns unsigned TransactionInstruction[] bundles for you to sign and submit yourself

What it does not do

  • It does not hold a private key
  • It does not sign transactions
  • It does not send transactions

Usage

import { Keypair, Transaction } from "@solana/web3.js";
import { PumpTradeInstructionBuilder } from "pump-trader-v2";

const owner = Keypair.generate().publicKey;

const builder = new PumpTradeInstructionBuilder("https://api.mainnet-beta.solana.com", {
  defaultSlippageBps: 500,
});

const buyResult = await builder.createBuyInstructions({
  mint: "TOKEN_MINT_ADDRESS",
  owner,
  quoteAmountIn: 100_000_000n,
});

const tx = new Transaction().add(...buyResult.chunks[0].instructions);

Sell example

const sellResult = await builder.createSellInstructions({
  mint: "TOKEN_MINT_ADDRESS",
  owner,
  tokenAmountIn: 1_000_000n,
});

Lower-level API

const context = await builder.getTradeContext("TOKEN_MINT_ADDRESS");
const marketInfo = await builder.getMarketInfo("TOKEN_MINT_ADDRESS");

console.log(context.mode); // "bonding" | "amm"
console.log(marketInfo.solAmount.toString());
console.log(marketInfo.tokenAmount.toString());

Notes

  • createBuyInstructions and createSellInstructions may return multiple chunks when maxAmountPerTx is set
  • Each chunk is already ordered for execution
  • For AMM trades, setup and cleanup instructions are currently returned inline in instructions
  • getMarketInfo() returns the current mode plus pool/bonding SOL and token reserves
  • PumpTradeInstructionBuilder accepts either a Connection instance or an RPC string

Quick market test

RPC_URL=https://api.mainnet-beta.solana.com \
MINT=TOKEN_MINT_ADDRESS \
npm run example:market

Or:

npm run example:market -- https://api.mainnet-beta.solana.com TOKEN_MINT_ADDRESS

This will print:

{
  "mint": "...",
  "mode": "bonding",
  "tokenAmount": "...",
  "solAmount": "...",
  "virtualTokenAmount": "...",
  "virtualSolAmount": "..."
}

Example scripts

Use these to isolate where a failure happens:

# 1. Only detect bonding / amm
npm run example:context -- <rpc> <mint>

# 2. Query market reserves
npm run example:market -- <rpc> <mint>

# 3. Diagnose context + market lookup
npm run example:diagnose -- <rpc> <mint>

# 4. Build buy instructions
npm run example:buy -- <rpc> <mint> <owner> <lamports> [slippageBps] [maxAmountPerTx]

# 5. Build sell instructions
npm run example:sell -- <rpc> <mint> <owner> <tokenBaseUnits> [slippageBps] [maxAmountPerTx]

All example scripts also support environment variables:

RPC_URL=... MINT=... OWNER=... AMOUNT=... npm run example:buy

The buy/sell examples print per-chunk diagnostics only:

{
  "mode": "amm",
  "chunks": [
    {
      "index": 0,
      "instructionCount": 3,
      "cleanupInstructionCount": 0,
      "signerCount": 0,
      "inputAmount": "100000000",
      "expectedOutputAmount": "123456789"
    }
  ]
}