A sybil-resistant gas sponsoring paymaster that is powered by backrunning!
Backrunning, is a well known MEV technique whereby the user tries to insert their transaction right after a target transaction in order to capture the created profit (e.g. inbalance liquidity pools).
Paymasters are entities that can sponsor transactions for other smart contract based wallets.
By combining the two, we can create an incentive-aligned Paymaster that can efficiently detect backrunnable transactions and strategically sponsor them.
This ensures a fair and sybil-resistant way of capturing profits from MEV opportunities, promoting a more equitable and competitive ecosystem on the Ethereum blockchain.
We extended on the VerifyingPaymaster contract from @eth-infinitism/account-abstraction, and added CFMM math and Flashswap support so it can calculate the optimal amounts needed to backrun the previous transaction.
We also attempted to use stackup's Bundler and Contracts, however they were using the Hardhat framework, which threw us into JavaScript hell. At the end, I just flattened it and chucked it to forge, and use the Bundler as is.
Due to the time limitation of the hackathon, it does not take into account the gas cost of the transaction, nor does it attempt to decode the UserOps, but rather assumes that the following set of transactions are backrunnable.