【CJ market-making notes 12/14】
In on-chain execution, some losses have nothing to do with directional judgment. Even if the strategy is correct, the moment of Swap execution can still hand the profit to an MEV bot.
Once a transaction enters the public mempool, the bot can see the direction, amount, and slippage tolerance in advance. It may buy in front of you, pushing the price higher; your trade then executes at a worse price; and the bot sells after you, pocketing the price difference. This is a common sandwich attack. The larger the amount, the thinner the liquidity, and the wider the allowed slippage tolerance—typically the more obvious the exposure.
To reduce risk, there are at least two layers. First, use appropriate private transaction channels for sensitive trades to reduce early exposure of orders in the public mempool. Second, set a reasonable minimum amount to receive—`amountMin`—to limit the worst execution you’re willing to accept. If the parameters are too loose, you give the bot room; if they’re too tight, the trade may fail frequently.
Neither private channels nor `amountMin` can guarantee a complete escape from MEV; they only reduce exposure and constrain the worst outcome. When doing on-chain strategies, your return model must leave room for execution frictions.
Next post: If technical risks can be handled, what do you do about the human attention limit?
#DeFi #MEV
In on-chain execution, some losses have nothing to do with directional judgment. Even if the strategy is correct, the moment of Swap execution can still hand the profit to an MEV bot.
Once a transaction enters the public mempool, the bot can see the direction, amount, and slippage tolerance in advance. It may buy in front of you, pushing the price higher; your trade then executes at a worse price; and the bot sells after you, pocketing the price difference. This is a common sandwich attack. The larger the amount, the thinner the liquidity, and the wider the allowed slippage tolerance—typically the more obvious the exposure.
To reduce risk, there are at least two layers. First, use appropriate private transaction channels for sensitive trades to reduce early exposure of orders in the public mempool. Second, set a reasonable minimum amount to receive—`amountMin`—to limit the worst execution you’re willing to accept. If the parameters are too loose, you give the bot room; if they’re too tight, the trade may fail frequently.
Neither private channels nor `amountMin` can guarantee a complete escape from MEV; they only reduce exposure and constrain the worst outcome. When doing on-chain strategies, your return model must leave room for execution frictions.
Next post: If technical risks can be handled, what do you do about the human attention limit?
#DeFi #MEV
