Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 35 additions & 13 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ description: >
compute units, and dry-run simulation. Also covers token launch, migration,
wallet management, and token discovery. Use when the user wants to trade,
swap, buy, sell, launch, or manage pump.fun tokens.
compatibility: "Requires uv and pumpfun-cli (install via uv from github.com/chainstacklabs/pumpfun-cli)"
compatibility: "Requires uv and pumpfun-cli 0.2 or later (install via uv from github.com/chainstacklabs/pumpfun-cli)"
metadata:
author: chainstacklabs
version: "0.1"
version: "0.2"
category: crypto-trading
requires:
bins: ["uv", "pumpfun"]
Expand All @@ -32,16 +32,16 @@ uv tool install git+https://github.com/chainstacklabs/pumpfun-cli.git
uv tool install --force git+https://github.com/chainstacklabs/pumpfun-cli.git
```

This installs `pumpfun` globally — available from any directory.
This installs `pumpfun` globally — available from any directory. `pumpfun --version` should report 0.2 or later; older versions build transactions the current pump.fun program rejects.

## Pre-Trade Checklist

Before any trade, verify:

1. **Wallet exists**: `pumpfun wallet show` — confirms keystore is set up
2. **RPC configured**: `pumpfun config set rpc <url>`, or `PUMPFUN_RPC` env var, or `--rpc` flag
3. **Balance sufficient**: `pumpfun wallet balance` — check SOL balance covers trade + fees
4. **Token status**: `pumpfun info <mint>` — check if token is on bonding curve or graduated to PumpSwap AMM
3. **Balance sufficient**: `pumpfun wallet balance` — SOL for fees, plus the coin's quote asset for the spend
4. **Token status**: `pumpfun info <mint>` — bonding curve or graduated to PumpSwap AMM, and which quote asset it is priced in (`quote_symbol`)

## Smart Routing

Expand All @@ -53,14 +53,26 @@ The CLI automatically routes trades based on token status:

Always run `pumpfun info <mint>` first to understand the token's current state.

## Quote Assets

Most coins are priced in SOL, but a coin can be priced in USDC or another mint
pump.fun admits. `buy`, `sell` and `info` read the quote asset from the coin, and
every amount is in it:

- `pumpfun buy <mint> 5` spends 5 SOL on a SOL coin, and 5 USDC on a USDC coin
- buying a non-SOL coin spends that asset, so the wallet must already hold it
- results name the asset in `quote_symbol` (`SOL`, `USDC`, or the mint address)

Check `quote_symbol` in `pumpfun info <mint>` before choosing an amount.

## Core Trading Commands

### Buy tokens
```bash
pumpfun buy <mint> <sol_amount> [--slippage 15] [--force-amm] [--confirm] [--dry-run]
pumpfun buy <mint> <amount> [--slippage 15] [--force-amm] [--confirm] [--dry-run]
```
- `mint`: token mint address
- `sol_amount`: SOL to spend (float)
- `amount`: exact amount to spend, in the coin's quote asset (float)
- `--slippage`: tolerance percent (default: 15)
- `--dry-run`: simulate without sending — **always use this first for new tokens**

Expand All @@ -75,19 +87,28 @@ pumpfun sell <mint> <amount|all> [--slippage 15] [--force-amm] [--confirm] [--dr
```bash
pumpfun info <mint> [--timeout 30]
```
Shows price, bonding curve progress, reserves, graduation status.
Shows price, quote asset, bonding curve progress, reserves, graduation status, and whether the coin is mayhem, cashback or holder-reward.

### Launch a token
```bash
pumpfun launch --name <name> --ticker <ticker> --uri <metadata-json-url> [--buy <amount>] [--quote-mint <mint>] [--creator-fee-bps N] [--holder-reward] [--mayhem] [--confirm]
```
- `--uri` is a metadata JSON (`name`, `symbol`, `description`, `image`) the user already hosts; pump.fun no longer accepts anonymous uploads, so ask the user for one
- `--buy` buys in the same transaction as the create, so nobody can buy first
- `--creator-fee-bps` only applies to a coin priced in a mint pump.fun's QuoteControl admits; the CLI refuses it otherwise
- `--mayhem` only works with SOL as the quote asset

## Safety Guardrails

1. **Always dry-run first**: Use `--dry-run` on buy/sell before committing real SOL
1. **Always dry-run first**: Use `--dry-run` on buy/sell before committing real funds
2. **Check slippage**: Default 15% is generous — tighten for large trades
3. **Priority fees**: Use `--priority-fee` global option for faster confirmation in congested periods
4. **Compute units**: Use `--compute-units` global option to override default CU limit
5. **Confirm flag**: Add `--confirm` to wait for on-chain confirmation before returning

## Common Workflows

### "Buy X SOL of token Y"
### "Buy X of token Y" (X in the coin's quote asset)
```bash
pumpfun info <mint> # Check status & price
pumpfun buy <mint> <X> --dry-run # Simulate
Expand All @@ -110,14 +131,15 @@ pumpfun buy <mint> <amount> --confirm # Buy before graduation

### "Check and collect fees"
```bash
pumpfun collect-creator-fee --confirm # Collect from pump.fun + PumpSwap
pumpfun collect-creator-fee --confirm # Collect SOL fees from pump.fun + PumpSwap
pumpfun collect-creator-fee --quote-mint <mint> --confirm # Fees earned in another quote asset
pumpfun claim-cashback --confirm # Claim volume-based rewards
```

## Global Options

These apply to ALL commands:
- `--json` — output as JSON (auto-detected when piping)
- `--json` — output as JSON (auto-detected when piping). Trade results carry `quote_symbol`, `quote_mint`, and amounts as `quote_spent` / `quote_received` (dry runs: `quote_in`, `expected_quote`, `min_quote_out`)
- `--rpc <url>` — override RPC endpoint
- `--keyfile <path>` — override wallet keystore path
- `--priority-fee <micro_lamports>` — priority fee override
Expand All @@ -128,7 +150,7 @@ These apply to ALL commands:
| Error | Cause | Fix |
|---|---|---|
| Wrong password | Wallet decryption failed | Re-enter correct password or set `PUMPFUN_PASSWORD` |
| Insufficient balance | Not enough SOL | Check `pumpfun wallet balance`, fund wallet |
| Insufficient balance | Not enough SOL, or not enough of the coin's quote asset | Check `pumpfun wallet balance`, fund wallet |
| Slippage exceeded | Price moved beyond tolerance | Increase `--slippage` or retry |
| RPC error | Network/endpoint issue | Check `PUMPFUN_RPC`, try different endpoint |
| Token not found | Invalid mint address | Verify mint via `pumpfun info` or `pumpfun tokens search` |
Expand Down
24 changes: 12 additions & 12 deletions assets/token-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
## Phase 1: Launch (Bonding Curve)

```
pumpfun launch --name "MyToken" --ticker "MTK" --desc "..." [--buy 0.1]
pumpfun launch --name "MyToken" --ticker "MTK" --uri <metadata-json-url> [--buy 0.1] [--quote-mint <mint>]
```

- Token is created on pump.fun with a bonding curve
- Price starts low and increases as more SOL is deposited
- Token is created on pump.fun with a bonding curve, priced in SOL unless `--quote-mint` names another asset
- Price starts low and increases as more of the quote asset is deposited
- All buys/sells go through the bonding curve formula
- Creator can optionally buy initial supply with `--buy`
- Creator can optionally buy initial supply with `--buy`, in the same transaction as the create

## Phase 2: Trading on Bonding Curve

```
pumpfun buy <mint> <sol> # Buy from bonding curve
pumpfun buy <mint> <amount> # Buy from bonding curve, amount in the quote asset
pumpfun sell <mint> <amount> # Sell to bonding curve
```

- Price is deterministic — follows the bonding curve formula
- As more SOL enters, price increases; as SOL exits, price decreases
- As the quote asset enters, price increases; as it exits, price decreases
- Check progress: `pumpfun info <mint>` shows bonding curve completion %
- Tokens appear in `pumpfun tokens graduating` as they approach completion

Expand All @@ -30,14 +30,14 @@ pumpfun migrate <mint> --confirm
```

- When bonding curve reaches 100%, the token is eligible for migration
- Migration moves liquidity from bonding curve to PumpSwap AMM
- This is a one-time, irreversible operation (24 accounts involved)
- Migration moves liquidity from bonding curve to a PumpSwap pool in the same quote asset
- This is a one-time, irreversible operation
- Anyone can trigger migration — not just the creator

## Phase 4: PumpSwap AMM Trading

```
pumpfun buy <mint> <sol> --force-amm # Buy from AMM
pumpfun buy <mint> <amount> --force-amm # Buy from AMM
pumpfun sell <mint> <amount> --force-amm # Sell on AMM
```

Expand All @@ -49,7 +49,7 @@ pumpfun sell <mint> <amount> --force-amm # Sell on AMM
## Phase 5: Fee Collection

```
pumpfun collect-creator-fee --confirm # Creator fees from both vaults
pumpfun collect-creator-fee --confirm # Creator fees from both vaults (add --quote-mint for non-SOL coins)
pumpfun claim-cashback --confirm # Volume-based rewards
pumpfun close-volume-acc # Recover rent from volume tracker
```
Expand All @@ -61,8 +61,8 @@ pumpfun info <mint>
```

Returns:
- Current price
- Current price, in the quote asset
- Bonding curve progress (if applicable)
- SOL and token reserves
- Quote and token reserves
- Whether token has graduated
- Which routing path buy/sell will use
32 changes: 21 additions & 11 deletions references/OPERATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Trading Operations

### `pumpfun buy <mint> <sol_amount>`
Buy tokens with SOL. Smart-routes between bonding curve and PumpSwap AMM.
### `pumpfun buy <mint> <amount>`
Spend exactly `amount` of the coin's quote asset (SOL for most coins). Smart-routes between bonding curve and PumpSwap AMM. A non-SOL coin spends that asset, which the wallet must hold.

| Option | Type | Default | Description |
|---|---|---|---|
Expand All @@ -13,7 +13,7 @@ Buy tokens with SOL. Smart-routes between bonding curve and PumpSwap AMM.
| `--dry-run` | FLAG | off | Simulate trade without sending transaction |

### `pumpfun sell <mint> <amount>`
Sell tokens for SOL. Amount can be a number or `all`.
Sell tokens for the coin's quote asset. Amount can be a number or `all`.

| Option | Type | Default | Description |
|---|---|---|---|
Expand All @@ -23,7 +23,7 @@ Sell tokens for SOL. Amount can be a number or `all`.
| `--dry-run` | FLAG | off | Simulate trade without sending transaction |

### `pumpfun info <mint>`
Display on-chain token info — price, bonding progress, reserves, graduation status.
Display on-chain token info — quote asset, price, bonding progress, reserves, graduation status, creator fee, and mayhem/cashback/holder-reward flags.

| Option | Type | Default | Description |
|---|---|---|---|
Expand All @@ -32,16 +32,24 @@ Display on-chain token info — price, bonding progress, reserves, graduation st
## Token Launch

### `pumpfun launch`
Launch a new token on pump.fun (create_v2 + extend_account).
Launch a new token on pump.fun (create_v2 + extend_account). With `--buy`, the opening buy goes in the same transaction.

| Option | Type | Required | Description |
|---|---|---|---|
| `--name` | TEXT | Yes | Token name |
| `--ticker` | TEXT | Yes | Token ticker/symbol |
| `--desc` | TEXT | Yes | Token description |
| `--image` | TEXT | No | Path to token image |
| `--buy` | FLOAT | No | Initial buy amount in SOL |
| `--mayhem` | FLAG | No | Enable mayhem mode |
| `--uri` | TEXT | Yes* | Hosted metadata JSON; pump.fun no longer accepts anonymous uploads |
| `--desc` | TEXT | No | Description, used only when uploading without `--uri` |
| `--image` | TEXT | No | Image, used only when uploading without `--uri` |
| `--buy` | FLOAT | No | Opening buy, in the quote asset |
| `--quote-mint` | TEXT | No | Price the coin in this mint instead of SOL; the wallet must hold it to buy |
| `--creator-fee-bps` | INTEGER | No | Creator fee; only applies to a coin priced in a QuoteControl mint |
| `--holder-reward` | FLAG | No | Pay the creator fee to holders instead of the creator |
| `--mayhem` | FLAG | No | Enable mayhem mode (SOL coins only) |
| `--slippage` | INTEGER | No | Slippage for the opening buy (default 15) |
| `--confirm` | FLAG | No | Wait for transaction confirmation |

\* Without `--uri` the CLI attempts pump.fun's upload, which is currently refused.

## Migration

Expand All @@ -55,10 +63,11 @@ Trigger migration from bonding curve to PumpSwap AMM. Only works when bonding cu
## Rewards & Fees

### `pumpfun claim-cashback`
Claim volume-based cashback rewards.
Claim volume-based cashback rewards in one quote asset.

| Option | Type | Default | Description |
|---|---|---|---|
| `--quote-mint` | TEXT | SOL | Quote asset the cashback accrued in |
| `--confirm` | FLAG | off | Wait for transaction confirmation |

### `pumpfun close-volume-acc`
Expand All @@ -69,10 +78,11 @@ Close volume accumulator account and recover rent SOL.
| `--confirm` | FLAG | off | Wait for transaction confirmation |

### `pumpfun collect-creator-fee`
Collect creator fees from pump.fun and PumpSwap vaults.
Collect creator fees from pump.fun and PumpSwap vaults. Vaults are per quote asset, so fees earned in USDC need a separate run.

| Option | Type | Default | Description |
|---|---|---|---|
| `--quote-mint` | TEXT | SOL | Quote asset to collect |
| `--confirm` | FLAG | off | Wait for transaction confirmation |

## Transaction Status
Expand Down
5 changes: 3 additions & 2 deletions references/SAFETY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Before Every Trade

1. **Dry-run first** — always simulate with `--dry-run` before committing SOL
1. **Dry-run first** — always simulate with `--dry-run` before committing funds
2. **Check token info** — run `pumpfun info <mint>` to understand current price, reserves, and graduation status
3. **Verify balance** — `pumpfun wallet balance` to confirm you can cover the trade + transaction fees
3. **Verify balance** — `pumpfun wallet balance` to confirm you can cover the trade (in the coin's quote asset) + transaction fees in SOL
4. **Know the routing** — bonding curve tokens and graduated AMM tokens behave differently

## Slippage Management
Expand Down Expand Up @@ -41,6 +41,7 @@
- Token that just graduated — liquidity may be thin on AMM initially
- Selling `all` of a large position — may move price significantly
- Multiple rapid trades — each one pays transaction fees
- A coin priced in something other than SOL — `buy` spends that asset, not SOL; check `quote_symbol` first

## Password Handling

Expand Down
Loading