Performance tuning
Last updated
Last updated
Once you get your bot up and running, the next step is to tune it to get the best performance. There are a lot of variables so the exact config may differ for every person. This page will go through all the things that may affect the performance, and how you can improve it.
Choosing which mint to run the bot with is likely the most important thing when running this bot. You want the mint to have a lot of volume and price movement to generate enough arbitrage opportunities for you to catch. What usually performs the best is the top few meme coins that is trending everyday.
Similar to mint selection, you want to run the bot when there's a lot of volume and price movement. So days like weekend usually is a worse time to run the bot compare to weekdays. Within a day there are also hot time and cold time, you may want to consider only run the bot when the market is hot so you can burn less gas running the bot.
The bot supports having multiple pools for the same mint, but having more pools do not always mean having better performance.
The bot currently check the price difference between different pool and will try to execute an arbitrage trade between the two pools that have the biggest price difference. This is due to the onchain computation limit so it cannot try every combination effectively within the limited compute resource. This works better when all the pools you use have high liquidity, but if some of your pool has very low liquidity, there may be a big price difference but very small arbitrage profit you can extract from it.
So if you are looking for a lot of small arbitrage trades, pools with low liquidity will help you get there as there's usually less competition on smaller pools. But if you are looking for big arbitrage opportunities, you should only include pools with large liquidity. For example if a mint has 3 pools with 200 SOL, 100 SOL, 2 SOL in the liquidity, excluding the one with 2 SOL will help you to get better profits.
Read this if you don't know how fee is calculated in Solana.
You may be able to land in every block with a low fee, but you may not see a lot of landing with it. Your position within each block also matters. By raising your fee you will have a better position within each block, give you a better chance to actually grab the opportunity when it comes.
Though this does mean a higher risk as you will lose more gas fee for all your failed transactions. So you need to find the balance based on your specific setup.
Compute unit limit will affect multiple things for your transaction.
It will affect how many bins the bot's onchain program can look through. A general good practice is to set this between 300_000 to 800_000(without kamino, add 80_000 if you use kamino). The more dlmm pool you have the higher you should set this. You can first set a high number and check how much compute unit your successful trades usually take after running for a while, and lower your limit to just a bit higher than the biggest value you see.
It will affect the final gas fee you pay, together with compute unit price. The higher your limit is, the higher fee you will pay.
It will affect the position you land inside each block. Transaction with big limit and low fee may be ranked lower in validators, hence lower your chance to hit the opportunity. And if it's too big sometimes it cannot fit into the end of a block and will be pushed out to the next one.
This also affects how big your potential gain can be. Some super large arb opportunity requires a lot of computation so will cost higher CU. These hits can consume up to 600k to 800k CU sometimes. If you set a lower CU limit, your tx won't fail, instead it will just extract less profit from it.