@@ -24,12 +24,17 @@ A TypeScript SDK for Pump.fun built on **Solana Kit 5.0**. Designed for high-per
2424
2525- ** Solana Kit 5.0** – Built on the latest Solana development framework
2626- ** Modern transaction patterns** – Optimized for speed and reliability
27- - ** Human-readable API** – Work with SOL amounts and percentages instead of raw lamports
27+ - ** Unified swaps** – ` buy ` /` sell ` auto-route between bonding curves and AMM pools
28+ - ** Curve helpers** – Direct access to bonding-curve instructions when you need them (` curveBuy ` , ` curveSell ` )
29+ - ** AMM helpers** – Deterministic AMM operations with percentage-aware selling (` ammBuy ` , ` ammSell ` )
2830- ** Automatic slippage protection** – Built-in guards for buy/sell operations
29- - ** Launch capabilities** – Create and buy tokens in one atomic transaction
30- - ** Liquidity operations** – Add/remove liquidity with simple helpers
3131- ** Full TypeScript support** – Strongly typed throughout with complete type coverage
3232
33+ ### Coming Soon
34+
35+ - ** Launch & mint helpers** – Create and seed new Pump.fun tokens once integration is ready
36+ - ** Liquidity tooling** – Add/remove liquidity with tested helpers
37+
3338---
3439
3540## Installation
@@ -50,12 +55,12 @@ import { createSolanaRpc } from "@solana/kit";
5055const rpc = createSolanaRpc (" https://api.mainnet-beta.solana.com" );
5156```
5257
53- ### Buy Tokens
58+ ### Buy Tokens (Curve)
5459
5560``` ts
56- import { buy } from " pump-kit" ;
61+ import { curveBuy } from " pump-kit" ;
5762
58- await buy ({
63+ await curveBuy ({
5964 user: myWallet ,
6065 mint: " TokenMintAddress" ,
6166 solAmount: 0.5 , // 0.5 SOL
@@ -64,21 +69,21 @@ await buy({
6469});
6570```
6671
67- ### Sell Tokens
72+ ### Sell Tokens (Curve)
6873
6974``` ts
70- import { sell } from " pump-kit" ;
75+ import { curveSell } from " pump-kit" ;
7176
7277// Sell specific amount
73- await sell ({
78+ await curveSell ({
7479 user: myWallet ,
7580 mint: " TokenMintAddress" ,
7681 tokenAmount: 125_000 ,
7782 rpc ,
7883});
7984
8085// Sell percentage of wallet
81- await sell ({
86+ await curveSell ({
8287 user: myWallet ,
8388 mint: " TokenMintAddress" ,
8489 useWalletPercentage: true ,
@@ -87,68 +92,78 @@ await sell({
8792});
8893```
8994
90- ### Create and Buy Token
95+ ### Buy Tokens (AMM)
9196
9297``` ts
93- import { mintWithFirstBuy } from " pump-kit" ;
94- import { generateKeyPair } from " @solana/kit" ;
98+ import { ammBuy } from " pump-kit" ;
9599
96- const mintKeypair = await generateKeyPair ();
97-
98- const { createInstruction, buyInstruction } = await mintWithFirstBuy ({
100+ await ammBuy ({
99101 user: myWallet ,
100- mint: mintKeypair ,
101- mintAuthority: myWallet .address ,
102- name: " My Token" ,
103- symbol: " MTK" ,
104- uri: " https://arweave.net/metadata.json" ,
105- firstBuyTokenAmount: 1_000_000 ,
106- firstBuySolBudget: 1.0 ,
102+ mint: " TokenMintAddress" ,
103+ solAmount: 0.5 ,
104+ poolCreator: " CreatorAddress" , // optional if auto detection works
107105 rpc ,
108106});
109107```
110108
111- ### Quick Helpers
109+ ### Sell Tokens (AMM)
112110
113111``` ts
114- import { quickBuy , quickSell } from " pump-kit" ;
112+ import { ammSell } from " pump-kit" ;
115113
116- // Get buy instruction
117- const buyIx = await quickBuy (myWallet , " TokenMint" , 0.25 , { rpc });
118-
119- // Get sell instruction
120- const sellIx = await quickSell (myWallet , " TokenMint" , 100_000 , { rpc });
114+ await ammSell ({
115+ user: myWallet ,
116+ mint: " TokenMintAddress" ,
117+ useWalletPercentage: true ,
118+ walletPercentage: 100 ,
119+ poolCreator: " CreatorAddress" ,
120+ rpc ,
121+ });
121122```
122123
123124---
124125
125126## API Reference
126127
127- ### Core Functions
128+ ### Curve Swap Helpers
128129
129130``` ts
130- // Buy tokens
131- buy ({ user , mint , solAmount , slippageBps?, rpc , ... })
131+ // Buy tokens on the bonding curve
132+ curveBuy ({ user , mint , solAmount , slippageBps?, rpc , ... })
132133
133- // Sell tokens
134- sell ({ user , mint , tokenAmount?, useWalletPercentage?, walletPercentage?, rpc , ... })
134+ // Sell tokens on the bonding curve
135+ curveSell ({ user , mint , tokenAmount?, useWalletPercentage?, walletPercentage?, rpc , ... })
136+ ```
135137
136- // Quick helpers (return instructions only)
137- quickBuy (wallet , mint , solAmount , { rpc , ... options })
138- quickSell (wallet , mint , tokenAmount , { rpc , ... options })
138+ ### AMM Swap Helpers
139139
140- // Create token with initial buy
141- mintWithFirstBuy ({ user , mint , name , symbol , uri , firstBuyTokenAmount , firstBuySolBudget , rpc , ... })
140+ ``` ts
141+ // Buy tokens from the AMM pool using a SOL budget
142+ ammBuy ({ user , mint , solAmount , rpc , quoteMint?, poolCreator?, poolAddress? })
143+
144+ // Sell tokens into the AMM pool (supports percentage-based selling)
145+ ammSell ({
146+ user ,
147+ mint ,
148+ tokenAmount?,
149+ useWalletPercentage?,
150+ walletPercentage?,
151+ rpc ,
152+ quoteMint?,
153+ poolCreator?,
154+ poolAddress?,
155+ })
142156```
143157
144- ### Liquidity Management
158+ ### Coming Soon
145159
146160``` ts
147- // Add liquidity to pool
148- addLiquidity ({ user , baseMint , quoteMint?, maxBaseAmountIn , maxQuoteAmountIn , rpc , ... })
161+ // Create token with initial buy
162+ mintWithFirstBuy ({ ... })
149163
150- // Remove liquidity from pool
151- removeLiquidity ({ user , baseMint , quoteMint?, lpAmountIn , rpc , ... })
164+ // Liquidity helpers
165+ addLiquidity ({ ... })
166+ removeLiquidity ({ ... })
152167```
153168
154169### Transaction Utilities
0 commit comments