This project includes a script that:
- Generates 10 wallets.
- Buys tokens using a parent wallet and distributes them equally among the 10 generated wallets in a single transaction.
- Sells tokens from each wallet back into SOL.
- Includes retry logic for the buy operation.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory and add the following variables:PARENT_WALLET_PRIVATE_KEY=<YOUR_PARENT_WALLET_PRIVATE_KEY> TOKEN_MINT_ADDRESS=<TOKEN_MINT_ADDRESS> TOTAL_SOL_TO_SPEND=1 PRIORITY_FEE_IN_SOL=0.001 SLIPPAGE_DECIMAL=0.25
- Create a
-
Run the script:
npm start
Generates and returns an array of count Keypairs.
Converts a private key string to a Keypair.
Fetches and returns the token balance of a given wallet.
pumpFunBuy(transactionMode: TransactionMode, payerPrivateKey: string, mintStr: string, solIn: number, priorityFeeInSol: number, slippageDecimal: number)
Buys tokens using the parent wallet with retry logic.
pumpFunSell(transactionMode: TransactionMode, payerPrivateKey: string, mintStr: string, tokenBalance: number, priorityFeeInSol: number, slippageDecimal: number)
Sells tokens from a wallet back into SOL.
Main function that:
- Generates 10 wallets.
- Buys tokens using the parent wallet and distributes them equally among the 10 wallets in a single transaction.
- Sells tokens from each wallet back into SOL.
npm start: Runs the main script.npm run build: Builds the project.