When you send a trade on-chain, it does not land in a block instantly. First it waits its turn in the mempool (a holding area for unconfirmed transactions visible to all network participants). And that is where the problem begins. MEV (Miner Extractable Value, the profit a block producer can extract by reordering transactions within a block) turns this public mempool into a hunting ground for bots. They scan it in real time, find profitable orders from retail traders, and insert their own transactions to profit from your trade. The result for you: slippage and a worse execution price than you planned for.
For an intermediate trader who wants to preserve capital and achieve consistent execution, understanding this threat is essential. Once you understand exactly how bots find you, a way to protect yourself also appears. The primary defense mechanism covered here is private RPC endpoints.
A private RPC provides a more direct and less exposed path for sending a transaction. Your order is not put on public display in the open mempool, which means bots simply do not see it. In practice this raises the chances that a trade will execute at the price you targeted and protects your P&L from predatory activity.
MECHANICS
To understand how the defense works, first take a look at how the attack works. An MEV bot continuously monitors the public mempool. The moment it spots a large order or a trade with meaningful profit potential, it sends its own transaction with a higher gas fee (the processing fee that determines priority in the queue), so as to push into the same block ahead of you. This is called front-running.
The second technique is more dangerous and is called a sandwich attack. The bot places a buy order immediately before your trade and a sell order immediately after it, squeezing your transaction from both sides. You end up buying higher and selling lower than you intended, while the bot pockets the difference. The very price movement your trade creates becomes its profit.
A private RPC endpoint breaks this scheme at its foundation. Instead of broadcasting your transaction to all network nodes, it sends it directly to a specific node or into a private network. The window in which a bot could spot your order and react is sharply narrowed: the transaction is simply not publicly visible until it is confirmed in a block.
| Public RPC | Private RPC |
|---|---|
| Transaction is visible to all nodes in the mempool | Transaction goes directly to a node or into a private network |
| Bots see the order before confirmation | Order is not publicly visible until included in a block |
| Open to front-running and sandwich attacks | Attack window is sharply narrowed |
EXECUTION
Moving your trading to a private RPC comes down to a few sequential steps:
- Subscribe to a reputable private RPC provider.
- Obtain the unique endpoint URL and any required API keys from the provider.
- Configure your trading software or wallet so that all outgoing transactions go through this private endpoint.
- Before sending a trade, confirm that your software is actually connected to the private RPC and not to the default public one.
- Monitor transaction confirmations for unexpected slippage or price deviations.
Even on a private RPC, do not forget about the gas fee: adjust it to current network conditions, otherwise a transaction may get stuck despite all the protection. It is also worth thinking separately about limit orders, which define the maximum acceptable execution price and serve as a safeguard if something still goes wrong.
COMMON MISTAKES
The most common mistake is obvious: continuing to broadcast transactions through a public RPC. That is exactly what makes them vulnerable to bots. So before sending any order, verify that the software is pointed at the private endpoint.
The second trap is assuming that a private RPC relieves you of gas fee management. You have removed the bots, but the network is still there. Without an adequate fee, the transaction will either get stuck or cost more than necessary. Match the fee to network load.
And third: do not treat a private RPC as absolute protection. Sophisticated actors still have ways to interact with your transactions. A private RPC is one layer of defense, not the entire perimeter. Keep a full risk management setup alongside it: a stop loss and proper position sizing.
RISK-MANAGEMENT
The baseline position sizing rule: a single stop loss hit should not cost you more than 1% of total trading capital. With $10,000 in capital that means a maximum loss of $100 on any single trade.
Place the stop loss accounting for normal market volatility, usually at 1.5x-2.5x the Average True Range (ATR, the average daily price movement range). For example, if the 14-period ATR of an asset is $50, a sensible stop loss would be $75-125 from the entry price, so that random noise does not knock you out of a position prematurely.
Keep leverage on volatile assets within 2x-5x. Excessive leverage amplifies both profit and loss, and also brings liquidation closer even on small price moves. Before trading with real money, run the strategy on historical data to see the possible drawdowns in advance.
How to tell a reliable setup from a vulnerable one: before sending an order, open the network settings in your wallet and compare the endpoint address with what your private RPC provider gave you. If the field shows a default public address (often the network's default RPC or a public exchange node), your trade will go to the open mempool and will be visible to bots. If it matches the private address and pings without error, the setup is working.