How to Protect Against Frontrunning on SOL
Introduction
Front-running occurs when malicious actors exploit pending transactions to manipulate prices and gain an unfair advantage. On Solana, the mempool operates differently compared to Ethereum. The mempool stream is shared from RPC nodes to validators only when they are about to become the leader (a 1.2 to 3.6-second window). This design limits access to pending transactions, making it harder for attackers to exploit them directly.
However, some validators exploit this system by operating proxy relays within their environment. These relays leak pending transaction data to malicious searchers, who then execute sandwich attacks. In such attacks, searchers place a buy order ahead of the target trade and a sell order immediately after. This manipulation inflates the price for the user's trade, causing the user to receive worse terms and undermining the integrity of the transaction.
How To Protect
Option 1: Use Jito
Using Jito is the most common way to make your transaction private. However, for the Jito Block Engine to accept your transaction, you need to include an extra priority tip in the form of a transfer instruction.
Priority Tip:
The tip must be a minimum of 1,000 Lamports. However, for better prioritization, we recommend tipping at least 10,000–20,000 Lamports.
The tip should be a transfer instruction directed to one of the following addresses:
Code Example:
Url To Submit: https://sol-rpc.kolibr.io/?tx_broadcast_mode=jito
Option 2: Use Kolibrio Subsidy Transactions
If adding a priority tip directly to the target transaction is not possible, Kolibrio supports subsidy transactions. In this case, the originator sends a standard transaction to Kolibrio's RPC endpoint. Url To Submit: https://sol-rpc.kolibr.io/?tx_broadcast_mode=subsidy Kolibrio automatically generates an additional transaction with a Jito tip, bundles it with the original transaction, and submits the bundle to Jito. This approach ensures the transaction is prioritized and protected against front-running without modifying the original transaction. Learn more
Last updated