Setup and Configuration
Last updated
Last updated
There are 3 files we will need to configure, we will first configure your .env
file.
After you open the file you should see this:
For PRIVATE_KEY you should enter your Solana wallet private key as a bs58 encoded string. Do not use quotes, brackets, braces, or anything else. It should look like this:
Next, enter your GRPC_ENDPOINT. This is the endpoint given to you by your Solana GRPC provider. Some providers may give you a port number or API key. Also, if your provider has given you a GRPC_TOKEN you can enter it here, otherwise you can leave the default value unchanged.
Next, enter your RPC_ENDPOINT and RPC_WEBSOCKET_ENDPOINT
If you would like to use NextBlock transaction executor, you can set your NEXTBLOCK_KEY. Currently, NextBlock is in beta, you can leave this area blank and can still use NextBlock. Once they officially end the beta and start charging for their service you will need to obtain an API key to use it.
TX_TIMEOUT is the maximum time your bot will wait for a transaction to confirm. If the transaction isn't confirmed within this timeframe, the bot assumes it has failed and stops waiting, allowing it to move on to the next task without unnecessary delays. Default = 10000 milliseconds
DUST_LAMPORTS: Sometimes after you have sold your tokens you may be left with some residual tokens known as dust in your wallet. This can be due to various factors such as slippage or the fixed output swap method used by Pump.fun. To ignore these dust tokens, you should set your DUST_LAMPORTS. This is the minimum SOL value in LAMPORTS for your token to not be ignored by the bot.
If you would like to receive notifications of trades made by your bot on discord, please set your DISCORD_WEBHOOK.
You can also set a custom Discord memo on your Discord webhook notifications by entering a string value for CUSTOM_DISCORD_MEMO
in the .env
file. For example, if you want it to tag you, just copy your Discord User ID in the menu shown below, and add it to your memo.
CUSTOM_DISCORD_MEMO=<@745994897101722187> Simply Copybot is the best!
Then, when your bot makes trades, you will be notified in Discord.
Next, will configure the copy_wallets.yaml where we can define the trade parameters for each wallet we copy, individually.
The copywallets are defined in the top level of the yaml file. For each group of wallets, you can define specific parameters used for trading on each dex. If you do not want to trade on a particular dex, you can omit it. In each group, you can add multiple wallets and the settings will apply to each wallet in that group. You can define multiple groups of wallets that follow different trading strategies.
The structure of the settings for each dex are the same, so we will only show Raydium here as an example:
on
: Options are true
or false
. Set this to true
to use this dex or false
to turn it off.
maxBuyAmount
: This is the maximum amount in Sol that you will spend on each trade. The bot will use the minimum of maxBuyAmount
and buyPercentage
.
oneBuyOnly
: Set this to true
if you only want to prevent additional buys on the same token until it is completely sold. The token can only be bought again after you have completely closed your position
minBuyFilter, maxBuyFilter, minSellFilter, maxSellFilter: Set these values to filter the trade size of the copywallet. The units are in Sol. You will only copy trades that the copywallet makes that are larger than minBuyFilter and smaller than maxBuyFilter. For example, if you set minBuyFilter=0.1
and maxBuyFilter=1000
, if the copywallet spams many 0.01 Sol buys, you will ignore all of those trades because it is less than your minBuyFilter value. You can also set a filter on sells if needed. To turn the filter off, set it to 0. For a more detailed explanation, click here.
buyPercentage
: This allows you to copy a percentage of the copywallet's trade size, but it is overridden by maxBuyAmount
. For example, if you set buyPercentage=10
and the copywallet buys 100 Sol of a token, then you will buy 10% of 100 Sol, which is 10 Sol. However, if you set maxBuyAmount=1
, then you will buy only 1 Sol worth of token.
buySlippage
& sellSlippage
: This is the amount of slippage in percent that you are willing to accept on a trade. For example, if you set buySlippage=50
, and you are quoted 100 tokens for 1 Sol, then the lowest amount of tokens you will accept for the trade is 50 tokens. If you get less than 50 tokens, then the transaction will fail due to exceeded slippage.
buyRetries
& sellRetries
: This is the number of times you will retry a transaction.
buyRetryDelay
& sellRetryDelay
: This is how long you will wait after each transaction before retrying the transaction if confirmation has not been received yet. Units are in milliseconds so if you set buyRetryDelay=1000
, you will wait 1 second before retrying a transaction until the transaction is confirmed.
useSimulation
: Options are true
or false
. If this is set to true you will simulate the transaction before sending it. This should be set to true if you want to optimize the compute unit limit. The simulation can potentially slow down your transaction but if your compute unit limit is optimized, it has a better chance of being included in an earlier block.
maxBuyBlockDelay & maxSellBlockDelay
: This is the maximum block delay from the copywallet's original transaction that you are willing to accept. The possible values are from 0 to 150. For example, if you set maxBuyBlockDelay=5
then it will prevent you from landing any transaction that is more than 5 blocks from the transaction you are trying to copy. This parameter can be useful if you only want to copy a transaction if you can be one of the first copiers.
copySell
: Options are true
or false
. Set this to true
if you want to copy the sells of the copywallet. If you only want to copy the buys and not the sells, you can set it to false
and use a different trigger for selling, such as autoSellDelay
or TP/SL. This can be useful if the copywallet picks good tokens but does not choose the right moment to sell them.
autoSellDelay
: If you want to automatically sell after waiting a certain amount of time, you can set it here. The units are in milliseconds. If autoSellDelay=0
then it is turned off. If you set autoSellDelay=10000
then it will sell the token 10 seconds after buying.
stopLossOn
: Set this to true to turn on stop loss protection, set it to false to remove stop loss.
trailStopOn
: Set this to true to use trailing stop loss. stopLossOn
must be set to true to use trailing stop loss.
stopLossPercentage
: This is the percentage of your stop loss or trailing stop loss. For example, if you set stopLossPercentage=50
then you will sell your tokens once the value has dropped below 50% of your initial investment.
takeProfitOn
: To use the take profit function, set this to true
. If you do not want to use it, set it to false
.
smoothingFactor: If you use TP or SL functions, you must set the smoothingFactor. This uses last X transactions for smoothing the token price. If you look at any chart, you will see frequent MEV activity or sandwich attacks that lead to huge spikes in price. These spikes can trigger your TP/SL when you do not want them to, so it is important set set a smoothingFactor to compensate for these spikes. 10 is usually a good place to start, but depending on your strategy you can increase or decrease it. For example, you might set this to 1 if you are doing fast trades on PumpFun and need to react immediately to changes in price, and you do not care about MEVs triggering your TP/SL.
There are 5 options for your transaction execution: Jito Bundles endpoint, Jito Transactions endpoint, RPC, bloXroute, or Nozomi. Simply Copybot allows you to send your transaction simultaneously to all endpoints without risk of transaction duplication. This ensures that you will land your transaction with the fastest route possible. Beware: Jito Bundles is the only endpoint that does not cost priority fees for failed transactions. You will still pay gas fees for failed transactions on Jito Transactions endpoint, RPC, bloXroute, or Nozomi. bloXroute and Nozomi each have a minimum tip of 0.001 sol.
Sending your transaction through the Jito Bundles Endpoint is the safest option for most users. You get MEV protection, the landings are typically pretty fast, with your transaction usually landing within 2 blocks of the copywallet if you provide adequate tip. 5% of your maxBuyAmount is typically a good place to start and you can go as high as 10% of your maxBuyAmount. If you tip Jito a lot, it's not impossible to land your transaction 0-1 blocks from the copywallet transaction. We stream the current tips from Jito so you also have the option to useOptimalTip so that you tip according to the current level of competition. This allows you to tip higher to land your transaction quickly when necessary but use a low tip when competition is not as fierce.
The Jito Transactions Endpoint is similar to the Jito Bundles Endpoint. You get MEV protection and landing is also quite fast. However, it also has the potential to be slightly faster than the Jito Bundles Endpoint because Jito will forward your transaction to current leader for validation. This comes at an extra cost because if it is forwarded you also need to pay the priority fee. For this transaction executor, you have the option to use the optimal priority fee and the optimal Jito fee.
Which Jito Endpoint should I use?
This is your default RPC Executor. If you have multiple endpoints that accept the sendTransaction method you can list them all under SEND_RPCS in the .env
file. The bot will send the same transaction with the same transaction hash to each of these endpoints. The transaction will be processed by the fasted validator, which will prevent other validators from processing the same transaction again. This allows you to get many opportunities for your transaction to be seen by a validator but you only have to pay priority fees once. Depending on your RPC provider, you can expect transactions that can land as fast as 1-2 seconds from the copywallet transaction. This could be around 2-5 blocks, which is not very good for copytrading. I do not recommend using the RPC executor for your transactions unless you have a staked connection. With a good staked connection, you can expect landing times similar or better than Jito, provided that you pay a good priority fee. You can useOptimalPriorityFee to obtain the appropriate priority fee for the current level of market competition.
useExecutor
: Options are true
or false
. If you want to send a transaction using this executor set it to true
.
useOptimalTip
: Options are true
or false
. Set this to true
if you want to use the optimal tip based on percentile for Jito or bloXroute. This will be compared with maxBuyTip
or maxSellTip
and the lowest tip will be used. If you set this to false, the copybot will automatically use your maximum tip. This is not available for Nozomi.
optimalBuyTipPercentile
& optimalSellTipPercentile
: This is used with useOptimalTip. The available options are "25", "50", "75", "95", and "99" corresponding to the different percentiles. Also, you can use "ema" for the exponential moving average. The higher the number, the higher the tip.
maxBuyTip
& maxSellTip
: This is the maximum tip you are willing to pay in Sol.
maxPercentTip
: This parameter allows you to set your maximum tip as a percentage of the trade size. This is particularly useful when you have a copywallet that sells small pieces off in increments so that you do not pay a very large tip for a very small trade.
useOptimalPriorityFee: Set this to true if you would like to use the optimal priority fee based on percentile.
buyPriorityFeePercentile & sellPriorityFeePercentile: The percentile of the optimal priority fee you want to use. You can set it from 1-99.
maxBuyPriorityFee & maxSellPriorityFee: You can also set a maximum for your priority fee. The bot will take the minimum value from your optimal priority based on percentile, your maximum priority fee, and the maxPercentPriorityFee.
maxPercentPriorityFee: This option allows you to automatically scale your priority fee based on the size of your trade.
You can define as many take profit levels as you want in Simply Copybot.
profitLevel
: This is the percent gain from your investment when you will take profit. For example, if this is set to 10, then when your investment grows by 10% you will sell your tokens. If you set it to 100, then you will take profit when your investment grows by 100%, which is equivalent to a 2x. Similarly, 200 is a 3x, 400 is a 5x, 900 is a 10x, and so on.
sellPercentage
: This is the percentage of your holdings that you will sell at each profit level. For example, if you set sellPercentage to 50, 50, 100 like above and you bought 1000 tokens at the beginning, then you will sell 500, 250, and 250 tokens.
Next, if you are planning to use bloXroute for your transactions, enter your bloXroute authorization header. Please refer to our if you need help.
REBALANCE_LAMPORTS ensures your Copybot maintains the right balance of SOL and WSOL for trading. Since Raydium and Meteora require WSOL, while Pump.fun and Moonshot use SOL, rebalancing converts between SOL and WSOL as needed. This prevents transaction failures due to insufficient funds in the required format, ensuring smooth operation across all supported platforms. I recommend you set this value to at least 5 times your maxBuyAmount. You should increase this appropriately depending on how many wallets you are copying and how frequently they trade to make sure you do not run out of either SOL or WSOL. To get lamports from SOL, multiply by 1_000_000_000 or use this .
Next, we will configure SEND_RPCS
This is where you can define all of the RPC endpoints to which you would like to send your transactions. It should be a comma-separated list. If you turn on the RPC transaction executor, the same transaction will be sent to each of the endpoints on this list. Since all of these transaction will have the same transaction hash, only the first transaction will land and there will not be any duplicate transactions or additional priority fees the other transactions that do not land on chain. For more details about sending your transaction to multiple endpoints for the fastest landing, check .
If you do not have a staked connection and are not landing fast enough with Jito, I highly recommend using bloXroute. You will have to pay a priority fee to the validator in addition to a tip for bloXroute. For both the priority fee and the bloXroute tip, you have the option to use the optimal rates based on your desired percentile. The minimum bloXroute tip is 0.001 sol. To use bloXroute, you will need to sign up for a free bloXroute account at: Please check this for more information on how to use bloXroute. On a free account, you are given 60 credits per minute and each transaction costs one credit, so effectively, the rate limit is 1 TPS.
Nozomi is a new service provided by Temporal that is similar to bloXroute. You can read more about it here: Like bloXroute, you need pay both the priority fee and a tip to Temporal. You can fetch the optimal priority fee, but unfortunately Nozomi currently does not provide their tip stream so we cannot obtain optimal tips from them. The minimum tip is 0.001 sol. However, one advantage of Nozomi over bloXroute is that there are no hard TPS limits as long as your transactions are successful. They will begin to rate-limit if you send a lot of failed transactions.
NextBlock is one of the fastest transaction executors available for sending your transactions directly to the leaders for validation. Currently, they are in beta and it is free to use them. You can get more information here: . The minimum tip is 0.001 sol. Currently, you do not need to set your NEXTBLOCK_KEY in the .env file to use them.