A trader on Ethereum notices an opportunity: a decentralized exchange pair is mispriced, and executing a swap now could generate profit. The transaction is submitted, but within seconds of hitting the mempool, a sophisticated bot detects it, inserts its own transaction ahead of the target, and captures the spread. This is a sandwich attack—a specific form of maximal extractable value (MEV) exploitation that costs traders billions annually. The trader never sees it coming because conventional wallets do not simulate execution or warn about vulnerability to front-running.
Rabby Wallet Extension for Ethereum and other EVM networks solves this by showing traders exactly what will happen to their transaction before they sign it. The rabby wallet extension includes built-in transaction simulation and risk alerts that detect sandwich vulnerabilities, failed transactions, and hidden contract interactions before submission. For users trading across decentralized finance (DeFi) or interacting with unfamiliar smart contracts, this preview capability acts as a material defense against the most common attack vectors in blockchain transactions.

How transaction simulation works in Rabby Wallet Extension
Transaction simulation is the process of executing a transaction locally against the current blockchain state without actually broadcasting it to the network. When a user prepares to sign a swap, token transfer, or smart contract interaction in the Rabby wallet extension, the software runs the transaction through a simulated environment. This environment replicates the current account balances, contract state, and gas conditions so that the user can see the exact outcome before commitment.
The mechanics involve several components working in sequence. The wallet captures the transaction details—contract address, function call, parameters, and value transfer—then submits them to a simulation service that executes them against a read-only copy of the blockchain state. The service calculates whether the transaction will succeed, what token amounts will be transferred, what gas will be consumed, and whether any external dependencies (such as oracle prices or liquidity pools) have changed since the transaction was prepared.
This differs fundamentally from how most wallets operate. A standard wallet displays the visible fields of a transaction: a destination address and a value amount. It cannot tell a user whether the contract being called will actually perform the expected action, whether the minimum output constraint will be met, or whether the slippage tolerance on a swap is about to result in a poor execution. The Ethereum network and other EVM chains execute transactions based on what the contract code does, not what the user intends. Simulation bridges that gap by showing the intention and the actual outcome side by side.
The Rabby wallet extension uses simulation to detect when a transaction is likely to fail due to insufficient liquidity, oracle price changes, or reverted contract logic. It also detects when the output of a swap or complex interaction differs materially from what the user expected based on quoted prices. These alerts appear before the user is asked to sign, reducing the cost of discovering a mistake from a failed on-chain transaction (paid in gas) to a dismissed notification (costing nothing).
Sandwich attacks and why they matter to EVM traders
A sandwich attack occurs when a third party observes a pending transaction in the mempool, inserts its own transaction before the target (front-running), and then inserts another after (back-running). The result is that the victim’s transaction executes at a worse price than expected. On a decentralized exchange, this might mean receiving fewer tokens for a swap. On a lending protocol, it might mean executing a liquidation at a price that has been artificially moved against the borrower.
The attacker relies on the mempool being public and the victim’s transaction being visible before execution. Ethereum and most EVM chains broadcast pending transactions to the network so that miners or validators can include them. Anyone monitoring the mempool can see what is coming. Bots watching for large trades in particular trading pairs have become sophisticated enough to identify profitable sandwich opportunities in milliseconds and submit front-running transactions with a higher gas price to ensure priority.
A typical victim does not realize they have been sandwiched. They submit a swap expecting to receive, say, 100 USDC for 1 ETH based on the exchange rate at the time. The transaction executes, they receive 95 USDC, and they assume the market moved. In reality, a sandwich bot manipulated the price against them immediately before execution and profited from the slippage. The victim paid an invisible tax for the privilege of trading on a public blockchain.
The Rabby risk alerts address this by showing the user not only what the current price is, but what price they are actually likely to execute at given current mempool conditions and slippage settings. If a transaction is extremely likely to be sandwiched—for example, a large swap that will have extreme impact on the pool—the wallet can warn the user that the final output will be significantly worse than quoted.
Risk alerts detect failed transactions and malicious interactions
Beyond sandwich attacks, transaction simulation in the Rabby wallet extension detects a broader class of failures and unexpected behaviors. When a user approves a token for spending by a contract, the wallet can simulate what that contract will do with the approval. If the contract is designed to drain the entire token balance rather than execute a legitimate swap, the simulation will show that the actual outcome is a total token loss rather than a single transaction.
This is particularly critical because token approvals are irrevocable until revoked. A user might grant a decentralized exchange permission to spend 100 USDC, expecting it to be used for a single swap. A malicious contract could instead spend the full amount on its first interaction, even if the user only intended to trade a small portion. The Rabby wallet extension simulates the approval and the subsequent interaction together, revealing whether the contract respects the user’s intent or exploits the permission.
Simulation also catches transaction reversions that would normally be discovered only after submitting the transaction and paying gas fees. If a swap fails because the minimum output was set too conservatively and the pool no longer has sufficient liquidity, the simulation will show that the transaction reverts. The user then has the option to adjust parameters, try a different route, or abandon the trade—all before spending gas.
The risk alerts are not perfect predictions of MEV or network conditions that will exist when the transaction actually broadcasts. A quoted sandwich risk is based on current mempool state and pending transactions visible to the simulation node. By the time the user signs and broadcasts, the mempool may have changed, new bots may have detected the trade, or network conditions may have shifted. However, the alert provides a material improvement over the alternative: submitting a transaction with no warning at all.
Hardware wallet support and the simulation security model
The Rabby wallet extension supports hardware wallets including Ledger, Trezor, Keystone, OneKey, GridPlus, and BitBox02. This is important because simulation does not replace hardware-backed key custody. The simulation happens on the user’s computer or phone, but the actual cryptographic signature that commits the transaction is generated by the hardware device. An attacker who compromises the computer running the Rabby wallet extension cannot steal funds because they cannot access the private key stored on the hardware wallet.
The security model therefore separates the simulation layer from the signing layer. Rabby performs the analysis and shows risks and expected outcomes, but it does not sign transactions itself when a hardware wallet is configured. The user sees the simulation results on their computer, approves the transaction, and then the hardware wallet shows the same transaction details and requires a physical confirmation before signing.
This two-layer design has limitations worth understanding. The simulation shown by Rabby cannot change what the hardware wallet displays. If the hardware device shows only a contract address and a function selector, and the user does not have the tools to decode that into human-readable parameters, they must trust that the computer is correctly translating it. An attacker in a position to control both the computer display and the hardware interface could theoretically display different information on each. In practice, hardware wallets are designed to show transaction hashes that match what the computer requests, providing a check against modification.
OpenZeppelin and other security auditors have examined wallet implementations and hardware communication protocols to verify that modifications in transit are detectable. Rabby’s open-source codebase means that the simulation logic itself can be audited by external parties. The combination of simulation visibility, open-source code review, and hardware signing creates multiple verification points that reduce the likelihood of a successful compromise.
Real-world sandwich attack scenarios blocked by Rabby
Consider a concrete example: a trader attempts to execute a swap of 50 ETH for USDC on Uniswap v3. The current exchange rate suggests they should receive approximately 95,000 USDC. They configure their Rabby wallet extension with a 2% slippage tolerance, meaning they are willing to accept as little as 93,100 USDC. The transaction is prepared and submitted to the simulation engine.
The simulation detects that there are currently three large pending transactions in the mempool that are also USDC trades. These transactions will execute before the trader’s transaction (because they were submitted earlier or have higher gas prices). Each of those transactions will increase the price of ETH in the pool, meaning that when the trader’s transaction executes, it will receive fewer USDC than the simulation shows. The Rabby risk alert indicates that the likely execution price is 88,000 USDC—well below the 2% slippage tolerance.
The trader now has three options: submit anyway and accept poor execution, adjust slippage tolerance upward (which risks even larger unexpected loss), or cancel and wait for mempool conditions to improve. Without the simulation warning, they might have submitted the transaction and received 88,000 USDC while expecting 93,100, losing thousands of dollars to MEV extraction without understanding why.
Another scenario involves a liquidity crisis. A trader uses Rabby to swap a stablecoin pair (USDC to USDT) through a lending protocol that offers better rates than a direct exchange. The simulation reveals that the contract has insufficient USDT reserves to fulfill the swap at current prices. The transaction would revert, and the trader would pay gas fees for nothing. The alert guides them to either reduce the amount, find an alternative route through a different protocol, or delay until liquidity is available.
Gas Account and fee structure across multiple chains
Rabby wallet extension introduces another layer of protection against extraction: the Gas Account feature, which allows users to pay for transaction gas fees from a single balance of stablecoin (USDC or USDT) across all supported chains. Normally, a trader must maintain native gas tokens (ETH on Ethereum, MATIC on Polygon) on each chain they plan to use. This creates friction and opportunity for MEV: if a user is low on gas tokens and must execute a swap quickly, they may accept poor terms rather than wait for a bridge or exchange.
The Gas Account consolidates this friction. Traders maintain USDC or USDT balances on their preferred chains and use that balance to pay gas across the entire network. The wallet extension abstracts away the gas token requirement. While this does not directly prevent sandwich attacks, it removes one tactical advantage that attackers exploit: urgency created by users running low on native gas tokens and therefore accepting suboptimal execution.
The fee structure of Rabby wallet extension itself—0.25% on swaps and bridges with zero fees for stablecoin pairs and wrapping—is transparent and considerably lower than centralized exchanges. No hidden fees appear in simulated transactions. The user sees the exact fee before signing. This transparency, combined with transaction simulation, reduces the total surprise cost of DeFi execution.
What simulation cannot protect against
Simulation has clear limits that users should understand. It cannot protect against price oracle manipulation if the attacker controls the oracle. Some DeFi protocols rely on price feeds from services like Chainlink or Band Protocol, which are designed to be resistant to flash loan attacks and single-block manipulation. If an entire oracle service is compromised, simulation will show the false price and recommend execution based on it. The transaction will then execute at the manipulated price.
Simulation also does not protect against selecting a bad route voluntarily. If a user chooses to trade on a pool with extremely low liquidity when better options exist, the simulation will show that the trade is possible but will have poor execution. It warns the user, but it does not force them to use a better route. The responsibility for making the actual trading decision remains with the user.
Network conditions can change between simulation and execution. A transaction simulated during low network load might broadcast when the network is congested, causing different gas costs and different priority. The MEV environment can change: new sandwich bots might have deployed, old ones might be inactive, or network upgrades might have shifted extraction patterns. The simulation is a snapshot of conditions at the moment it runs, not a guarantee of conditions at execution.
The open-source code of Rabby wallet extension on GitHub can be reviewed by security researchers, but the review itself requires technical expertise and time. Most users will never audit the code. The wallet’s security depends on the combination of open-source transparency, formal audits, and user vigilance. A backdoor in the simulation logic would still allow transactions to be submitted that appear safe but are actually exploitable.
Practical workflow for reducing MEV exposure
For a trader seeking to reduce MEV losses, Rabby wallet extension should be part of a broader strategy rather than a complete solution. The first step is to understand what transactions are vulnerable. Large swaps are more vulnerable to sandwich attacks than small ones because the profit available to an attacker scales with transaction size. Swaps during peak mempool congestion are more vulnerable because more bots are actively monitoring. Swaps on less liquid pools are more vulnerable because moving the price is easier for an attacker.
Before using the Rabby wallet extension to execute a trade, a user should ask whether the trade is necessary now or could be split into smaller transactions executed across time. Splitting a large swap into three smaller swaps on different blocks reduces the extractable value available to any single attacker and reduces the impact of any single sandwich. The downside is higher total fees and more manual execution. The risk alert in Rabby can help the user decide whether the risk of sandwich attack justifies the extra friction of splitting.
The user should also consider using protocols that offer MEV protection natively. Some protocols allow users to opt into dark pools or batch auctions where transactions are bundled and executed simultaneously, preventing one transaction from being sandwiched by another. Rabby can simulate these interactions and show the expected cost in a transparent way.
Finally, users should treat the simulation results as one input to a decision, not as a guarantee. If the Rabby risk alert shows a 15% MEV risk and the trader’s expected profit is 20%, the decision remains with the trader. They have better information than before, but information is not the same as complete protection.
Frequently asked questions
How does transaction simulation in Rabby wallet extension prevent sandwich attacks?
Rabby wallet extension simulates transactions against current blockchain state before you sign them. This reveals whether large pending transactions in the mempool will cause slippage that exceeds your tolerance, or whether bots are likely watching this trade. If the simulation detects extreme MEV risk, it alerts you, allowing you to cancel, adjust parameters, or split the transaction into smaller pieces that are harder to sandwich profitably.
Can Rabby risk alerts guarantee my transaction won’t be front-run?
No. Rabby wallet extension shows the risk based on current mempool conditions and pending transactions visible when the simulation runs. Conditions can change between simulation and execution. Hardware wallet integration ensures that even if your computer is compromised, your private keys cannot be stolen, but that does not prevent a transaction you voluntarily sign from being sandwiched by other traders or bots after broadcast.
Does using Rabby wallet extension cost extra fees for the simulation service?
Rabby wallet extension itself is free and open-source. The swap and bridge feature charges 0.25% with zero fees for stablecoin pairs and wrapping. Simulation itself is included at no extra cost. Hardware wallet support is also included. You pay gas fees to the network and the routing fee to Rabby, but not for the simulation analysis that protects you from errors.
