Only validators and searchers benefit from current MEV ecosystem while the transaction senders where MEV is actually extracted from are excluded.
In fact, senders need to pay twice for the transaction execution: the transaction fee and the fetched MEV. The latter always goes against the intention of the sender and can be consider as a robbery in secret towards sender.
The project supports senders to capture MEV under the ERC-4337 framework:
- Senders use special ERC-4337 wallets called
MEVBoostAccountand send special userOps calledBoostUserOpwhich invokes boost methods ofMEVBoostAccount. - Searchers use a special ERC-4337 paymaster called
MEVBoostPaymasterwhich refunds maxium MEV to senders byBoostUserOpauction and also pays transaction fee forBoostUserOp.
The project mainly has following advantages:
- Improve the current MEV ecosystem and maximize the sender's interests by trustlessly ensuring the maxium MEV capture by the sender.
- It provides a completely decentralized and permisionless MEV-Share solution.
- Considering the existence of MEV, the project promotes the adoption of the ERC-4337 wallet by providing the build-in mev capture features and making transaction cost possibly less expensive than the EOA.
This project has released weekly updates since 2023.05.22.
- In the view of the sender
sender--[fee to excute tx]-->validator
- The fact goes against the intention of the sender
sender--[fee to excute tx]-->validatorsender--[mev caputured by searcher]-->searchersearcher--[share mev with validator]-->validator
MEVBoostAA captures MEV from searchers to senders based on the framework of ERC-4337. so, senders will be protected.
sender--[mev caputured by searcher]-->searchersearcher(as a paymaster) --[fee to excute tx] -->validatorsearcher--[maxium MEV refund]-->sendersearcher-- share mev with validator -->validator
The sender just need to depoly a ERC-4337 wallet MEVBoostAccount, construct a BoostUserOp (i.e. a userOp calling the boostExecute or boostExecuteBatch method) and broadcast it to the ERC-4337 mempool.
The first parameter of the method boostExecute or boostExecuteBatch is MEVConfig which including minAmount(i.e. minium required mev amount) and selfSponsoredAfter(i.e. timestamp after which the BoostUserOp is executed without searcher and MEVBoostPaymaster).
Searchers who have deposited fund to MEVBoostPaymaster will grab BoostUserOps in the ERC-4337 mempool.
-
If the
BoostUserOpis profitable, the searcher will fillpaymasterAndDatato makeBoostUserOpvalid, build a profitable ERC-4337 bundle including thatBoostUserOpand send it to the bundler. Finally, ifBoostUserOpis success, the sender will getminAmountMEV value from searcher and theBoostUserOpis sponsored by the searcher. -
If the
BoostUserOpis not profitable, the searcher will not fillpaymasterAndDataof theBoostUserOp. ThatBoostUserOpin the ERC-4337 mempool will be valid after timestampselfSponsoredAfter. The bundler will regularly bundle and execute thatBoostUserOp.
Briefly, a BoostUserOp is valid when one of the following conditions is met:
- The searcher fills the
paymasterAndData, paysminAmountMEV value to the sender and sponsors thatBoostUserOp. - The
BoostUserOpis valid after timestampselfSponsoredAfterand sponsored by the sender.
- node (>=16.0.0 <18)
- yarn (^1.22.10)
- foundry
- Environment Variables (Used for foundry fork tests)
- MAINNET_NODE_RPC_URL: The RPC URL for accessing forked states.
MAINNET_NODE_RPC_URL=https://eth-mainnet.alchemyapi.io/v2/#####__YOUR_SECRET__#####
$ git submodule update --init --recursive
$ yarn run setup
$ yarn run compile # compile contracts
$ yarn run test-foundry-fork # run unit tests with forked states
