A trader submits a swap order on Uniswap at 2 PM UTC. Within milliseconds, the transaction enters the mempool, where specialized bots detect it, calculate the price impact, and queue a competing transaction to extract the difference. By the time the trader’s transaction settles, they have lost 5–15% of their expected output to a sandwich attack. This scenario repeats thousands of times daily across Ethereum and EVM chains, targeting ordinary users who never see the bot that took their profit. A rabby wallet extension equipped with transaction simulation can display the exact impact before the user signs, showing whether a quoted swap outcome is real or whether a drainer bot is already positioned to extract liquidity.
The distinction between a simulated transaction and a real one is the difference between knowing and guessing. Most wallets show a transaction description—”Swap 1 ETH for 18 USDC”—and leave the user to trust the source. Rabby’s simulation engine actually executes the transaction against the current blockchain state, revealing what will happen if the user signs it. If a bot has already positioned itself or if slippage has shifted the outcome by orders of magnitude, the simulation returns a warning before the user’s keys are touched. That protection does not make MEV attacks impossible, but it makes them visible, which fundamentally changes the decision-making context for a DEX trader or a user interacting with a smart contract.

Why simulated execution reveals what raw transaction data hides
A traditional wallet displays transaction parameters: the contract being called, the function, the encoded input data, and sometimes a human-readable interpretation. A user sees “Swap” or “Approve” but not the actual output. If the user is unfamiliar with ABI decoding or contract interfaces, the parameters might as well be random hex. Even an experienced trader examining the data can make calculation errors under time pressure, especially when gas prices are rising or a liquidation threshold is approaching.
Simulation changes that equation by forwarding the transaction to an execution environment that mirrors the blockchain’s state. The simulation consumes no gas, does not alter on-chain data, but runs the transaction logic as the network would. If the swap was supposed to yield 18 USDC but a bot has already exploited the price move, the simulation returns 15 USDC. If a contract contains a hidden fee or vulnerability, the simulation may fail with a revert reason. If the user has insufficient balance or approval, the simulation catches that before broadcasting. The wallet then displays the actual predicted output alongside the original quote, making the discrepancy obvious.
The technical mechanism relies on EVM state snapshots and transaction tracing. Rabby connects to full nodes or compatible RPC endpoints that support the `eth_call` method and tracing APIs, allowing transactions to be executed in a read-only mode against the latest block state. This is not unique to Rabby—other wallets and block explorers use similar techniques—but the integration into the signing flow is what makes it operationally effective. The simulation happens before the user reaches the “confirm” button, not after they have already committed.
For MEV bots specifically, simulation can reveal several attack patterns. A sandwich attack involves a bot detecting a pending swap, frontrunning it with a trade that moves the price, then letting the user’s transaction settle at a worse rate, and finally backrunning with a trade that profits from the temporary price move. The simulation will show a much larger slippage than expected because the frontrun transaction has already moved the price on-chain. A similar logic applies to other bot interactions: if a drainer contract is waiting to extract tokens from a user’s approval, the simulation will fail or show a large outflow that does not match the intended interaction.
Transaction simulation as a practical shield against drainer attacks
Drainer bots and scam contracts operate on the assumption that users do not verify what they are signing. A phishing site or malicious dApp might show “Verify your wallet” and present a contract call that actually sweeps all approved tokens to an attacker address. The transaction description might be obscured, abbreviated, or misleading. A user clicking through under time pressure might not notice that the recipient is not the intended address.
Simulation catches these attacks by executing the contract logic and reporting the actual transfers. If a user is asked to approve a token and the contract call actually drains the wallet, the simulation will show the token moving out. If the contract is designed to fail silently or redirect to a different address, the trace will reveal the actual destination. The user sees a warning like “This transaction sends 10 ETH to 0x1234…” rather than trusting a third-party interface that might be lying.
The effectiveness depends on the simulation’s ability to detect what matters. Rabby’s approach includes checking for Rabby security signals such as extreme price impact, unknown recipient addresses, token approvals to suspicious contracts, and transfers to addresses not involved in the declared transaction. These checks are not cryptographic proofs—an attacker can still craft a transaction that passes simulation if they know what checks are in place—but they raise the friction for casual drainer operations.
More importantly, simulation forces the attacker to choose between transparency and deception. If the transaction truly does what the user thinks, the simulation confirms it. If the transaction does something else, the simulation reveals it. An attacker cannot simultaneously show a false preview to the user’s screen while hiding the real transaction from the simulation; they can only submit one transaction to the wallet’s signing mechanism.
How MEV extraction works and why simulation matters for ordinary traders
Maximal Extractable Value (MEV) refers to the profit that can be captured by choosing, ordering, or timing transactions in a block. On Ethereum and EVM chains, miners and block builders have historically been the primary extractors, but in the proof-of-stake era, this role has shifted to proposers, block builders, and specialized searchers. A DEX trade is especially vulnerable because the contract logic is public, the pending transaction is visible in the mempool before it is executed, and the profit opportunity can be calculated in advance.
The most common form of MEV extraction against retail traders is the sandwich attack. A searcher observes a user’s swap order for ETH-to-USDC worth $10,000. The searcher calculates that the swap will move the price by 2% due to market impact. The searcher then constructs a frontrun transaction (buying ETH-to-USDC first), positions the user’s transaction immediately after, and appends a backrun transaction (selling USDC-to-ETH) that profits from the temporary price move. The searcher’s profit is the 2% price impact minus transaction fees—typically $150–$300 per transaction. The user receives a 2% worse rate than expected.
Simulation reveals this by showing the user that their quoted output (18.2 USDC per ETH) is now only 17.8 USDC per ETH due to the price shift that has already occurred in the mempool. The wallet can display the discrepancy, and the user can choose to cancel, wait for the mempool to clear, or increase slippage tolerance if they are willing to accept the cost. This is not a perfect solution—if the user increases slippage tolerance, they are inviting more extraction—but it restores information symmetry. The user no longer has to blindly trust a dApp’s preview.
For a user interacting with a rabby wallet extension, the simulation happens transparently in the extension’s popup or in-wallet interface, making the security check a normal part of the signing workflow rather than an extra step. This integration is important because security measures that require additional effort are often skipped. If the user has to open a separate block explorer, paste the transaction hex, and wait for a result, they might not bother. If the simulation happens automatically and displays a clear summary, adoption is higher.
Practical risk alerts and what they signal about transaction legitimacy
Rabby’s transaction simulation generates several categories of warnings, each signaling a different type of risk. An “Extreme Slippage” alert means the token output is much lower than the quoted amount, suggesting MEV extraction or a stale quote. A “Unknown Token Transfer” alert flags transfers to addresses not explicitly mentioned in the transaction, which can indicate a hidden fee or a redirect. An “Unusual Contract Call” alert triggers when the transaction interacts with a contract not commonly used for the declared function, potentially indicating a phishing site using a lookalike contract.
These alerts are heuristic-based, not foolproof. A legitimate but complex transaction might trigger false positives. A sophisticated attacker might craft a transaction that passes all checks. However, the purpose of the alerts is not to achieve perfect detection but to raise awareness. A user who sees “Extreme Slippage” and remembers that sandwich attacks are real will pause and reconsider. A user who sees “Unknown Token Transfer” and knows that drainers exploit hidden contract calls will cancel and check the source of the transaction.
The most valuable alert for defending against drailers is often the simplest: a clear display of which addresses will receive funds and how much. If a user is approving a token transfer and the simulation shows the token moving to an address that does not match the intended recipient, the user can immediately identify the attack. This works because drailers operate by misdirection; if the misdirection fails, the attack fails.
For hardware wallet users, simulation is particularly important because hardware wallets do not display contract ABIs or detailed function parameters on their small screens. A user with a Ledger or Trezor connected to Rabby can see the full simulated preview on their computer screen, verify the outcome, and then approve on the hardware device. This combines the security of offline key signing with the visibility of on-device simulation.
Gas optimization and the Gas Account feature in the context of swap safety
Simulation also enables a secondary protection: accurate gas estimation. If a transaction is going to fail (for example, because the user lacks funds after the swap), the simulation will detect this and prevent the user from broadcasting a doomed transaction that only costs gas. This is less directly related to MEV extraction but still valuable for reducing losses.
Rabby’s Gas Account feature allows users to pay transaction fees from stablecoin balances (USDC or USDT) rather than requiring ETH for every transaction. The simulation ensures that the gas fee can be deducted from the available stablecoin balance, and the user sees the total cost (original transaction plus fee) before signing. This is particularly useful for users who do not regularly manage their ETH balance or who prefer to keep ETH in cold storage.
For swap transactions, the Gas Account also simplifies the user’s mental model. Instead of worrying about whether they have enough ETH for both the swap and the gas fee, they can use stablecoins for everything. The simulation confirms that the stablecoin balance is sufficient and displays the swap output net of the gas fee, making the true cost of the transaction clear. This transparency prevents a common frustration: discovering after signing that the transaction would fail due to insufficient gas.
Comparing Rabby’s approach to other wallet security models
Hardware wallets like Ledger and Trezor provide strong security by keeping private keys offline and requiring physical confirmation of transactions. However, they do not inherently offer on-device simulation because their screens are small and their processors are limited. A hardware wallet can display some transaction details but cannot easily execute a full contract simulation.
Browser-based wallets like MetaMask offer some transaction warnings but typically do not perform full simulation; they rely on user vigilance and external tools. Desktop wallets vary widely in their security features and transparency. Mobile wallets like Rabby’s iOS and Android apps can offer simulation if they have sufficient resources, but many do not.
Rabby’s advantage is its integration of simulation into a self-custody wallet available on multiple platforms—Chrome, Brave, Edge, Opera, Arc extensions as well as iOS and Android. Because Rabby is developed by DeBank, a team with deep expertise in blockchain data and risk analysis, the wallet benefits from that institutional knowledge. The simulation engine is built on tested infrastructure rather than bolted on as an afterthought.
It is worth noting that simulation cannot prevent all attacks. A user can still increase slippage tolerance to accept MEV extraction if they are in a hurry. A user can approve a malicious contract to any amount if they do not understand what they are approving. A compromised or fake extension can bypass simulation altogether. Rabby’s Rabby review process—emphasizing open-source code, security audits, and community scrutiny—is meant to reduce the risk of the wallet itself being compromised, but users should always verify they are installing from the official source and that no fake Rabby sites or extensions are being used.
Approvals management and the broader permission ecosystem
Beyond transaction simulation, Rabby includes an approvals manager that allows users to view and revoke token permissions granted to contracts. This addresses a separate but related risk: a user might approve a contract to spend tokens (necessary for any swap), but the contract might be exploited later or the user might forget about the approval. With the approvals manager, the user can list all active approvals and revoke any that are no longer needed.
Combined with simulation, the approvals manager creates a two-layer defense. Simulation prevents a user from signing a malicious transaction in the first place. The approvals manager prevents a malicious contract from draining tokens even if the user previously approved it. Neither layer is perfect—a user can re-approve a contract, and a contract can be exploited before the user revokes the approval—but the combination raises the cost of an attack and gives the user multiple opportunities to respond.
The token approval decoder, another Rabby feature, helps users understand what they are approving. Instead of seeing “Contract interaction,” the user sees “Approve 1,000 USDC to Uniswap Router.” This transparency is fundamental to Rabby security. If a user understands what permission they are granting, they can make an informed decision about whether to grant it.
Open-source verification and the importance of code review for wallet trust
Rabby is open source, meaning the wallet’s code is publicly available for review, audit, and verification. This is essential for a security-critical application like a wallet. Users can check GitHub repositories to verify that the code matches the published source and that updates are legitimate. Security researchers can audit the code and publish findings. The community can scrutinize the implementation and raise concerns about risky practices.
However, open-source code is only as secure as the build process and distribution channels. If the published source code is secure but the browser extension available in the Chrome Web Store is built from a different source, users are not protected. This is why Rabby has undergone security audits and why the wallet emphasizes the official download sources. Users should install the rabby wallet extension only from the official Rabby website or from trusted extension stores, and they should verify that the domain is exactly rabby.io (or the official mirror) to avoid fake Rabby sites.
Open-source wallets also benefit from the ability to run a local version or verify builds. A user who is highly security-conscious can compile the wallet from source themselves and install the local build, ensuring that no supply-chain compromise has affected their copy. This is impractical for most users, but the option exists and provides a ceiling for how much trust is necessary.
Frequently asked questions
How does the rabby wallet extension detect sandwich attacks before I sign?
Rabby’s transaction simulation executes your transaction against the current blockchain state before you sign it, showing you the actual output you will receive. If a bot has already positioned itself in the mempool to extract MEV, the simulation will show a much larger slippage than the quoted amount. The wallet displays this discrepancy as a warning, allowing you to cancel the transaction, wait for the mempool to clear, or adjust your slippage tolerance.
Can simulation prevent all drainer bot attacks?
Simulation prevents attacks that involve hidden contract logic or misdirected transfers by showing you exactly what will happen if you sign. However, it cannot prevent a user from intentionally increasing slippage tolerance to accept MEV extraction, nor can it protect against attacks that exploit a previously-approved contract. Simulation is one layer of defense; approvals management and careful verification of sources are additional protections.
Is the rabby wallet extension safe from phishing and fake extensions?
Rabby is open source and has undergone security audits, but fake Rabby sites and extensions are common scams. Always install from the official website (rabby.io) and verify the domain carefully. Check the browser extension store to confirm you are installing the genuine version. Never enter your recovery phrase into any website, even one that looks identical to Rabby’s official site.