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
MEVBoostAccount
and send special userOps calledBoostUserOp
which invokes boost methods ofMEVBoostAccount
. - Searchers use a special ERC-4337 paymaster called
MEVBoostPaymaster
which refunds maxium MEV to senders byBoostUserOp
auction 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]-->validator
sender
--[mev caputured by searcher]-->searcher
searcher
--[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]-->searcher
searcher
(as a paymaster) --[fee to excute tx] -->validator
searcher
--[maxium MEV refund]-->sender
searcher
-- 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
BoostUserOp
is profitable, the searcher will fillpaymasterAndData
to makeBoostUserOp
valid, build a profitable ERC-4337 bundle including thatBoostUserOp
and send it to the bundler. Finally, ifBoostUserOp
is success, the sender will getminAmount
MEV value from searcher and theBoostUserOp
is sponsored by the searcher. -
If the
BoostUserOp
is not profitable, the searcher will not fillpaymasterAndData
of theBoostUserOp
. ThatBoostUserOp
in 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
, paysminAmount
MEV value to the sender and sponsors thatBoostUserOp
. - The
BoostUserOp
is valid after timestampselfSponsoredAfter
and 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