Getting solana-trading-bot on IPFS and Solana blockchain
|
1 gadu atpakaļ | |
---|---|---|
cache | 1 gadu atpakaļ | |
filters | 1 gadu atpakaļ | |
helpers | 1 gadu atpakaļ | |
listeners | 1 gadu atpakaļ | |
readme | 1 gadu atpakaļ | |
transactions | 1 gadu atpakaļ | |
.env.copy | 1 gadu atpakaļ | |
.gitignore | 1 gadu atpakaļ | |
.prettierrc | 1 gadu atpakaļ | |
LICENSE.md | 1 gadu atpakaļ | |
README.md | 1 gadu atpakaļ | |
bot.ts | 1 gadu atpakaļ | |
index.ts | 1 gadu atpakaļ | |
package-lock.json | 1 gadu atpakaļ | |
package.json | 1 gadu atpakaļ | |
snipe-list.txt | 1 gadu atpakaļ | |
tsconfig.json | 1 gadu atpakaļ |
This code is written as proof of concept to demonstrate how we can buy new tokens immediately after the liquidity pool is open for trading.
Script listens to new Raydium USDC or SOL pools and buys tokens for a fixed amount in USDC/SOL.
Depending on the speed of the RPC node, the purchase usually happens before the token is available on Raydium UI for swapping.
This is provided as is, for learning purposes.
To run the script you need to:
.env.copy
file (remove the .copy from the file name when done).
npm install
npm run start
in terminalYou should see the following output:
PRIVATE_KEY
- Your wallet's private key.RPC_ENDPOINT
- HTTPS RPC endpoint for interacting with the Solana network.RPC_WEBSOCKET_ENDPOINT
- WebSocket RPC endpoint for real-time updates from the Solana network.COMMITMENT_LEVEL
- The commitment level of transactions (e.g., "finalized" for the highest level of security).LOG_LEVEL
- Set logging level, e.g., info
, debug
, trace
, etc.ONE_TOKEN_AT_A_TIME
- Set to true
to process buying one token at a time.COMPUTE_UNIT_LIMIT
- Compute limit used to calculate fees.COMPUTE_UNIT_PRICE
- Compute price used to calculate fees.PRE_LOAD_EXISTING_MARKETS
- Bot will load all existing markets in memory on start.
CACHE_NEW_MARKETS
- Set to true
to cache new markets.
TRANSACTION_EXECUTOR
- Set to warp
to use warp infrastructure for executing transactions
WARP_FEE
- If using warp executor this value will be used for transaction fees instead of COMPUTE_UNIT_LIMIT
and COMPUTE_UNIT_LIMIT
Minimum value is 0.0001 SOL, but we recommend using 0.006 SOL or above
QUOTE_MINT
- Amount used to buy each new token.
QUOTE_AMOUNT
- Which pools to snipe, USDC or WSOL.
AUTO_BUY_DELAY
- Delay in milliseconds before buying a token.
MAX_BUY_RETRIES
- Maximum number of retries for buying a token.
BUY_SLIPPAGE
- Slippage %
AUTO_SELL
- Set to true
to enable automatic selling of tokens.MAX_SELL_RETRIES
- Maximum number of retries for selling a token.AUTO_SELL_DELAY
- Delay in milliseconds before auto-selling a token.PRICE_CHECK_INTERVAL
- Interval in milliseconds for checking the take profit and stop loss conditions.PRICE_CHECK_DURATION
- Time in milliseconds to wait for stop loss/take profit conditions.
TAKE_PROFIT
- Percentage profit at which to take profit.
STOP_LOSS
- Percentage loss at which to stop the loss.
SELL_SLIPPAGE
- Slippage %.USE_SNIPE_LIST
- Set to true
to enable buying only tokens listed in snipe-list.txt
.
SNIPE_LIST_REFRESH_INTERVAL
- Interval in milliseconds to refresh the snipe list.CHECK_IF_MINT_IS_RENOUNCED
- Set to true
to buy tokens only if their mint is renounced.CHECK_IF_BURNED
- Set to true
to buy tokens only if their liqudity pool is burned.MIN_POOL_SIZE
- Bot will buy only if the pool size is greater than the specified amount.
0
to disable.MAX_POOL_SIZE
- Bot will buy only if the pool size is less than the specified amount.
0
to disable.In case you experience a lot of failed transactions or transaction performance is too slow, you can try using warp
for executing transactions.
Warp is hosted service that executes transactions using integrations with third party providers.
Using warp for transactions supports the team behind this project.
When using warp, transaction is sent to the hosted service. Payload that is being sent will contain your wallet private key. This is needed to sign transactions. Each request is processed by hosted service and sent to third party provider. We don't store your transactions, nor we store your private key.
Note: Warp transactions are disabled by default.
When using warp for transactions, fee is distributed between developers of warp and third party providers. In case TX fails, no fee will be taken from your account.
If you have an error which is not listed here, please create a new issue in this repository.
To collect more information on an issue, please change LOG_LEVEL
to debug
.
Error: 410 Gone: {"jsonrpc":"2.0","error":{"code": 410, "message":"The RPC call or parameters have been disabled."}, "id": "986f3599-b2b7-47c4-b951-074c19842bad" }
Error: No SOL token account found in wallet:
If you want to leave a tip, you can send it to the following address:
7gm6BPQrSBaTAYaJheuRevBNXcmKsgbkfBCVSjBnt9aP
If you need custom features or assistance, feel free to contact the admin team on discord for dedicated support.
Use this script at your own risk.