# 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.<br>

## How To Protect&#x20;

***

### **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.<br>

**Priority Tip**:&#x20;

1. The tip must be a minimum of 1,000 Lamports. However, for better prioritization, we recommend tipping at least 10,000–20,000 Lamports.
2. The tip should be a transfer instruction directed to one of the following addresses:

```
[
    "ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt",
    "3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT",
    "96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5",
    "HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe",
    "Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY",
    "ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49",
    "DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh",
    "DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"
]
```

**Code Example:**&#x20;

<pre class="language-javascript"><code class="lang-javascript"><strong>const { Connection, PublicKey, Transaction, SystemProgram, Keypair } = require("@solana/web3.js");
</strong>
// Set up connection and payer
const connection = new Connection("https://sol-rpc.kolibr.io/?tx_broadcast_mode=jito");
const payer = Keypair.generate(); // Replace with your wallet Keypair
const tipAddress = new PublicKey("ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt");

// Create and send transaction with TIP instruction
(async () => {
  const transaction = new Transaction().add(
    SystemProgram.transfer({
      fromPubkey: payer.publicKey,
      toPubkey: tipAddress,
      lamports: 10000, // Priority tip in lamports
    })
  );

  const signature = await connection.sendTransaction(transaction, [payer]);
  console.log(`Transaction submitted: ${signature}`);
})();

</code></pre>

\
**Url To Submit:** [https://sol-rpc.kolibr.io/?tx\_broadcast\_mode=jito](<https://solana-rpc.kolibr.io/?tx_broadcast_mode=jito&#xA;>)\ <br>

### **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**](https://solana-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**](/kolibrio-orderflow-service/solana/advanced/subsidy-transactions.md)[<br>](<https://solana-rpc.kolibr.io/?tx_broadcast_mode=jito&#xA;>)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kolibrio.xyz/kolibrio-orderflow-service/solana/advanced/how-to-protect-against-frontrunning-on-sol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
