This repository contains TypeScript scripts for interacting with the PumpSwap AMM protocol on Solana. The scripts allow you to create a pool, add liquidity, and withdraw liquidity using environment variables for configuration.
src/createPool.ts— Create a new PumpSwap pool with initial liquidity.src/addLiq.ts— Add liquidity to an existing pool.src/withdrawLiq.ts— Withdraw LP tokens from a pool.
Create a .env file in the project root with the following variables:
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
WALLET_SECRET_KEY=Your_Wallet_Privatekey
BASE_MINT=
QUOTE_MINT=
BASE_DECIMALS=9
QUOTE_DECIMALS=6
INITIAL_BASE=10 // UI amounts, not lamports
INITIAL_QUOTE=0.001 // UI amounts, not lamports
ADD_LIQ_AMOUNT=0.001 // UI amounts, not lamports
WITHDRAW_LP_AMOUNT=0.001 // UI amounts, not lamports
POOL_INDEX=0
Replace the values with your own configuration.
- Install dependencies:
yarn - Build the script
yarn run build - Create a pool
yarn run create - Add Liquidity to the created pool
yarn run deposit - Withdraw LP token from the pool
yarn run withdraw
BeFYKqPUwpJDbhHHG3ugFWexUPct3FNhpHdZPdbFEMd1
For a new feature integration, you can contact me on the Telegram