Advanced

MEV Mitigation — Lesson outline

Avoid getting exploited at the mempool layer.

Developer Advanced
5/8 — MEV Mitigation — Lesson outline

RouteFollow this to avoid forgetting protections.

struct OrderflowPlan {
    bool usePrivateRpc;
    uint256 slippageBps;
    uint256 deadlineSecs;
    address relayer;
}

function planDefaults() internal pure returns (OrderflowPlan memory p) {
    p.usePrivateRpc = true;
    p.slippageBps = 50; // 0.5%
    p.deadlineSecs = 120;
}

Turn the outline into code/UX defaults so you can test and ship them.

Steps
  1. Map the MEV supply:Chain for your app (where does intent leak?).
  2. Decide on orderflow (private:RPC, bundle, or intent relayer) and fallbacks.
  3. Design slippage/deadline policy and:UX defaults.
  4. Implement an intent-based swap:Forwarder with signatures + replay guards.
  5. Test sandwiches/backruns in public:Vs private submission paths.
  6. Monitor relayer/builder health and:Add toggles if they fail.
← Previous section
Next section →