Talk, we need SWAP in here, multiple tokens armed with an insane transaction volume on the corner of pump.fun and bonk!
This command-line tool automatically buys and sells Solana tokens based on predefined profit and loss targets.
The tool leverages the Jupiter API for swaps, the Helius API for broadcasting transactions and fetching trade details, and the Birdeye API for price monitoring.
- Automatic Trading: buys a token and automatically sells it based on take-profit and stop-loss percentages;
- Manual Sell: allows for manual selling of the token by pressing the Enter key;
- Liquidity Protection: sells the token automatically if the liquidity drops below a certain threshold;
- Price Monitoring: continuously monitors the token's price and displays the profit/loss percentage;
Clone the repository & install the dependencies:
git clone https://github.com/ycgw/swap.git && cd swap && bun install- Create a
.envfile in the root of the project:
touch .env- Fill the
.envfile using.env.testas an example:
HELIUS_API_KEY=
BIRDEYE_API_KEY=
WALLET_PRIVATE_KEY=
- Run the tool with the token mint address as an argument:
bun run src/index.ts EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vThe following parameters can be configured in the src/config.ts file:
-
TAKE_PROFIT_PERCENTAGE: the percentage at which to take profit; -
STOP_LOSS_PERCENTAGE: the percentage at which to stop loss; -
LIQUIDITY_STOP_LOSS: the liquidity threshold at which to sell the token; -
POLLING_INTERVAL_MS: the interval at which to poll for the token's price; -
BUY_AMOUNT: the amount of SOL to use for buying the token; -
BUY_SLIPPAGE: the slippage to use for buying the token; -
SELL_SLIPPAGE: the slippage to use for selling the token;
Warning
This tool is for educational purposes only. Trading cryptocurrencies is risky, and you should never invest more than you can afford to lose. The author is not responsible for any financial losses you may incur by using this tool.
