v2 Optimization
As detailed in the arbitrage reference, Arbitrage relies on speed to capture inefficiencies between markets. This guide will help you optimize your bot for maximum efficiency.
As always - NFA, DYOR!
Connection
There are two main components to the bot’s connection:
- The Solana RPC
- The Jupiter API
Solana RPC
The RPC (Remote Procedural Call server) is how the bot connects to Solana. It’s important to have a fast, reliable RPC to ensure the bot can send transactions quickly.
To combat speed issues with default Solana RPCs, solutions that grab the leader information and send transactions directly to them have been developed. Two popular options include Helius’ Atlas and Blockworks’ Lite-RPC.
To speed these solutions up even further, you can use a Geyser GRPC to enable streaming data directly to these nodes, instead of relying on yet another RPC server, which only moves the bottleneck further up the line. Generally, this requires setting up your own RPC (guide coming soon, stay tuned!), but some providers, and even members of the community, offer a standalone GRPC service.
Jupiter API
The Jupiter API is responsible for the bot’s market data. Oftentimes, this will be the bottleneck when considering speed of finding arbs. Public instances do exist, but they are not recommended for anything other than testing. For production, it’s recommended to set up your own.
Once again, a GRPC can be used to massively speed up the API’s price updating speed. You can also filter out tokens you don’t care about, to reduce the amount of data you need to process. We reccomend running your Jupiter API on the same machine you run your bot on to reduce latency - in our testing, 2gb of RAM seems to be the minimum for a performant Jupiter API - although less is possible.
Configuration
The bot’s configuration is key to its performance. The config reference details all the options available to you, but here are a few things you should look out for:
Simulation
Simulating transactions increases the time-to-chain of each transaction by basically requiring the RPC server to process it twice. Unless you’re really paranoid, or you have an extremely good reason to keep it on, we reccomend turning it off. Our onchain program catches any non-profitable arbs onchain and reverts them for you, enabling a brute-force approach to finding profitable trades while keeping peace of mind.
Price ranges
Setting a large price range, or high trade size decimals, can slow down the bot by forcing it to check a very similar route twice or more. Keep tight, high ranges to cycle through different routes as fast as possible.
Profit BPS
Setting a high BPS will ultimately make the bot send a lower amount of profitable txs, as it becomes very picky about what it considers for profit. This can be good if you’re looking for high-profit trades, but it also lowers the total trade volume. A good range to start testing would be 5-10bps, with a high trade price.
Some extra tips
- Regular Updates: Keep your bot and its components up-to-date with the latest versions and patches to ensure optimal performance and security.
- Network Monitoring: Continuously monitor network performance and latency to identify and address any issues promptly.
- Community Engagement: Engage with the community for shared insights, troubleshooting tips, and access to additional resources like GRPC services.
By implementing these optimization strategies, you can enhance your arbitrage bot’s efficiency and maximize its profitability. Happy trading!