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
- Map the MEV supply:Chain for your app (where does intent leak?).
- Decide on orderflow (private:RPC, bundle, or intent relayer) and fallbacks.
- Design slippage/deadline policy and:UX defaults.
- Implement an intent-based swap:Forwarder with signatures + replay guards.
- Test sandwiches/backruns in public:Vs private submission paths.
- Monitor relayer/builder health and:Add toggles if they fail.