DEV Community

Mack Schneider
Mack Schneider

Posted on

Should I Wait, Replace, or Cancel a Pending Flashbots Tx?

If your Flashbots Protect transaction remains valid and wanted, wait; if it needs correction, replace it with the same nonce, and if unwanted, request cancellation while pending. Because private transactions can be absent from public pending views, Flashbots Protect status reports whether the submission is pending or included; an on-chain receipt confirms inclusion.

What Does a Pending Flashbots Transaction Mean?

A PENDING status means Protect received your transaction and a builder is processing it, but inclusion is not guaranteed. The Flashbots Transaction Status API documentation defines PENDING, INCLUDED, FAILED, CANCELLED, and UNKNOWN, and reports a recent simulation error where available. UNKNOWN means Protect did not receive that hash; FAILED means its submission window ended without inclusion. If either appears and you still want the action, confirm the nonce remains free before resubmitting.

Use the original hash to find Protect status and an on-chain receipt; also look for any included transaction from your address with the same nonce. If either was included, the nonce is spent. Even a reverted execution consumes it, so pending cancellation cannot undo inclusion. A missing public explorer pending entry proves little: private submissions stay out of the public mempool.

When Should You Wait, Replace, or Cancel?

Choose by intent, simulation results, and whether the nonce remains unconsumed. Suppose two swaps have the same PENDING status, no simulation error, and an available nonce. If the trade still suits you, I would wait. If it is unwanted, I would request cancellation. The evidence is identical; your intent changes the useful action.

If you still want the action but simulation reports SimErrorMaxFeePerGasTooLow, a corrected fee cap may justify a same-sender, same-nonce replacement. SimErrorInsufficientFunds points to ETH needed for value and gas; SimErrorNonceTooLow or SimErrorNonceTooHigh points to nonce order; SimErrorExecutionReverted may point to swap slippage or contract conditions, with revertReason offering detail. SimErrorOutOfGas points to the gas limit. Raising fees cannot repair funding, nonce, or execution failures. Replace only while the original nonce is unused: a higher nonce creates another transaction, potentially queued behind the first.

If the action is unwanted and pending, Protect cancellation requests withdrawal off-chain. Protect Cancellations documents an authenticated same-sender, same-nonce self-transfer with empty data; Protect does not mine it, so the request costs no gas. An included same-nonce replacement instead spends the nonce and pays gas. Cancellation can lose a race to inclusion, and withdrawal from Protect cannot invalidate a copy sent elsewhere.

These checks let you distinguish a submission worth waiting for from one that needs correction or withdrawal before its nonce is consumed.

How Do These Cases Change the Answer?

Expired swaps, delay measurements, and bundler submissions require evidence beyond the Protect status of a single transaction.

How should I record an expired swap for portfolio accounting?

Keep the original hash, Protect status, and any eventual same-nonce receipt with your records. Expiry alone does not show an executed swap; record asset movement from what settled on-chain.

How can I measure inclusion delays across my transaction history?

For included transactions, compare submission timestamps with receipt block timestamps using the same method for each. Keep expired and cancelled hashes separate: they have no inclusion time, so a zero delay distorts the result.

What changes when my wallet submits through an account-abstraction bundler?

An ERC-4337 wallet submits a UserOperation to a bundler, which packages it into an on-chain transaction. Track the operation's status and nonce through the bundler; an ordinary Protect transaction hash and cancellation request may not describe that path.

Top comments (0)