mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-12 07:42:39 +10:00
feat: add support for wsol swaps
This commit is contained in:
41
README.md
41
README.md
@ -1,17 +1,44 @@
|
||||
# Solana Sniper Bot
|
||||
Proof of concept - 2023-04-20
|
||||
|
||||
This code is written as proof of concept for demonstrating how we can buy new tokens immediately after liquidity pool is created.
|
||||
|
||||
Script listens to new raydium USDC pools and buys token for a fixed amount in USDC.
|
||||
Depending on speed of RPC node, the purchase usually happens before token is available on Raydium for swapping.
|
||||
Script listens to new raydium USDC/SOL pools and buys token for a fixed amount in USDC/SOL.
|
||||
Depending on speed of RPC node, the purchase usually happens before token is available on Raydium UI for swapping.
|
||||
|
||||
# Setup
|
||||
In order to run the script you need to:
|
||||
- Create a new empty Solana wallet
|
||||
- Transfer some SOL to it.
|
||||
- Convert some SOL to USDC.
|
||||
- We need USDC because the script is buying USDC pairs.
|
||||
- Set your PRIVATE_KEY, RPC_ENDPOINT and RPC_WEBSOCKET_ENDPOINT in the .env file (remove the .copy from the file name when done)
|
||||
- Convert some SOL to USDC or WSOL.
|
||||
- You need USDC or WSOL depending on configuration set below.
|
||||
- Set your
|
||||
- PRIVATE_KEY (your wallet private key)
|
||||
- RPC_ENDPOINT (https endpoint like helius/quicknode)
|
||||
- RPC_WEBSOCKET_ENDPOINT (websocket endpoint like helius/quicknode)
|
||||
- QUOTE_MINT (which pools to look at, USDC or WSOL)
|
||||
- QUOTE_AMOUNT (amount used to buy each new token)
|
||||
- COMMITMENT_LEVEL
|
||||
|
||||
in the .env file (remove the .copy from the file name when done).
|
||||
Make sure to replace default values.
|
||||
|
||||
- Install dependencies by typing: `npm install`
|
||||
- Run the script by typing: `npm run buy` in terminal
|
||||
|
||||
You should see following output:
|
||||

|
||||
|
||||
# Support
|
||||
|
||||
## Unsupported RPC node
|
||||
- If you see following error in your log file:
|
||||
`Error: 410 Gone: {"jsonrpc":"2.0","error":{"code": 410, "message":"The RPC call or parameters have been disabled."}, "id": "986f3599-b2b7-47c4-b951-074c19842bad" }`
|
||||
it means your RPC node doesn't support methods needed to execute script.
|
||||
- FIX: Change your RPC node. You can use Helius or Quicknode.
|
||||
|
||||
|
||||
- If you see following error in your log file:
|
||||
`Error: No SOL token account found in wallet: `
|
||||
it means that wallet you provided doesn't have USDC/WSOL token account.
|
||||
- FIX: Go to dex and swap some SOL to USDC/WSOL. For example when you swap sol to wsol you should see it in wallet as shown below:
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user