1/ "Hey you're only capable of complaining, why don't you build the something useful?"
Presenting general-purpose MEV protection built by anon in under 2 days(weekend) which has
a number of advantages over existing solutions:
1/ Until recently people believed that computers will never defeat a human in the game of GO and definetely not complex games like Dota or Starcraft.
But over the last few years the dominance of meat bags in competitive games quickly diminished.
My focus lifespan is like 1 month, started building MEV bot - made some money but very little progress on truly general-purpose one("alphaMEV") and most of my reinforcement learning ideas/experiments sadly didn't work out so far.
Started playing computer games instead :)
1/ Announcing our first Machine Learning competition focused on MEV extraction.
Build a model for predicting back-runable transactions and their value. Download the dataset and learn more at
Alpha leak for searchers seems I'm too lazy to implement this myself:
1) You implement a personal converter on BancorNetwork
2) Wrap all your DEX-arbs using this converter so that tx['to'] = BancorNetwork
3) You'll get 28% of DEX arbs for free without paying any bribe to miners.
Why do people hold funds in yearn? I believe it's a brilliant business model, but don't understand how they have so much sticky liquidity without even some shit-coin vesting.
For WBTC it's literally a meme:
I get: your yield
You get: nothing
70 to 123 ETH SUSHI/UNI arb:
1) Model missed correct transaction to back-run by 1 full block.
2) Random unrelated transaction included in the bundle increased gas cost by 50% for no reason.
But you can cry me a river how market is fully efficient already.
1/ Today observed that even someone's bot started using BetaRPC for sending transactions. Interestingly if their bot mis-calculates optimal swap route, BetaRPC back-runs them and fixes it for free.
Though you win some, you loose your alpha bro.
0/ Finally had time to read Eden network's whitepaper and design seemed completely broken. So decided to do on-chain digging:
Sandwich buy:
Sushi trade:
All subsidised by SushiSwap at the top of the block via Eden.
@SiegeRhino2
Closed source completely centralised protocol without any audits.
People are absolutely lost their mind investing 600M into that, I don't even consider this DeFi.
What were people afraid of after EIP-1559?
Block re-orgs after large hacks.
What really happens?
Two companies play with different block parameters they want via giving away scam-coins pumped by clueless retail investors.
And both coins starts with "E"
Now that few people looked at it privately happy to present to all black-hats as well:
Contract holds 170k worth of LUSD(staked via Stability Pool) on top of shit-coin rewards.
If you can break it - it's all yours, full amount is your bounty.
9/ Ultimately as my next undertaking I want to build an OpenAI-like gym for competition of autonomous MEV bots.
Input: blockchain state, mempool state, set of real (or fake) trigger transactions. Outcome: bots compete to find the best opportunity based on reward function.
1) Anyone starting as MEV searcher without any capital has to acquire in-depth understanding of flash-loans.
I've open sourced my contract:
It also contains simple helper example how to wrap any call with DyDx flash-loan under 'DyDxFlashLoanHelper'
2/ An endpoint to prevent 95% of sandwiches(5% uncle rate) completely for free was available for almost half a year:
But you dimwits obviously won't use it because there's no shit-coin attached to it.
10/ This is a massive undertaking, and I won't be able to finish it by myself. I'm looking for top-notch developer who:
- Understands majority of the tweetstorm above
- Already built similar things in the past
- Happy to work for ETH :)
- No moon-boys please
Or you can participate in our competition to flex your skills and improve accuracy of prediction for back-runable transactions:
P.S. I've wasted too much time building this website+dataset to see such a low participation so will shill this shit everywhere
While downfall of UST was obvious to anyone who was willing to do research, I'd love to see clone of LUSD with improved oracle model.
Something like LUSD but where oracle uses median price between ChainLink/Tellor/Uniswap TWAP(ETH-USDC) so it takes at least 2 parties to rekt you.
What will be stable equilibrium with bundle merging?
Ultimately all AMM trades should be routed privately so hopefully all sandwich bots will completely disappear.
Next should be oracle updates so back-runs will disappear?
Will it be old-school arbs at the beginning of new blocks
Today Flashbots releases v0.2 and introduces bundle merging. That means that Flashbots miners can now mine multiple bundles per block.
A thread digging into this huge release and what that means 👇🏻
Observed some of the largest BetaRPC back-runs so far:
1) with MEV gap of 2.55 ETH
Trader got back: 93% Miner: 4% BetaRPC: 3%
2)
with MEV gap of 1.62 ETH
Trader got back: 95% Miner: 3% BetaRPC: 2%
That I consider fair distribution.
With BetaRPC usage growing seeing successful back-runs quite often now. The most recent example:
User sold LQTY via 0x aggregator:
Path wasn't optimal so back-run was created:
User got back 78% of the opportunity, miner only 14%.
@SiegeRhino2
I didn't build sandwich bot for ethical reasons and they've built the most notorious one and run it for a very long time, so they clearly don't care about ethical reasons.
Outside of ethical reasons I think this sets dangerous precedent, what about gas auctions in general?
3/ Over the last few weeks I was actively developing AlphaMEV - a bot trained to extract MEV based on trigger events (New blocks / Oracle updates / AMM trades).
While the reward function is simple (profit per gas_used), the devil is in the details and action space is infinite
What's the cheapest way to buy a smart contract audit now-days? (For personal consumption so audit won't be shared externally)
In case someone is interested please DM me with any example of critical bugs that you've previously found.
2/ AlphaGo and AlphaZero defeated best humans in Go
OpenAI Five defeated best humans in Dota2
AlphaStar did it with Starcraft II
I strongly believe that bots trained with reinforcement learning can be successful in extracting MEV as well.
Shit like this:
Is the reason I consider LUSD as the only viable stable-coin. Any others without governance?
Centralised control - not your money(USDC/USDT)
Governance control - not your money(DAI/MIM and many others)
Then built "BetaRPC" but also got quickly bored since it's unclear what can be improved there.
After playing with alpha focused stuff(MEV) and infra focused stuff(RPC) decided to build a protocol on Arbitrum but already getting bored even before the project is finished.
Thank you everyone for participating! Grand total of 128 submissions received.
I tried my best to de-duplicate submissions by code and 23.6 ETH of rewards have now been dispersed:
Also smaller rewards were dispersed beyond top 5 for trying!
1/
1/ Announcing our first Machine Learning competition focused on MEV extraction.
Build a model for predicting back-runable transactions and their value. Download the dataset and learn more at
2/ Sadly this approach doesn't always work when coinbase is a smart contract and your bundle fails with out of gas.
For example, it will loose you all blocks created by F2 pool(60 TH/s). The correct approach is just as simple:
{value:amount}(new bytes(0));
Today was figuring out why some apeBank transactions don't use gas tokens and found out that someone else started using it:
Feels good :)
Small tip: Use FLAG_BURN_NATIVE to decrease your gas used 2x at tiny cost increase in ETH.
1/ Tiny leak but looking at other searchers mistake is pretty popular.
A lot of people are using "block.coinbase.transfer(amount)"
Even example provided by flashbots team contains this mistake:
@bertcmiller
Interestingly this person also started completely from scratch with an empty account, deploying the contract and exploiting an arb bot in the very first bundle:
There he didn't even have to create a bait.
I think there's still no shit-coin for setting "Extra Data" within the block.
So who will create "Extra Data Advertisement Coin" which is minted to mining pools which set "Extra Data" correctly based on running advertisement campaign?
3/3) I've deposited 10 ETH + 10 WETH into this contract for anyone to use in their tiny flash-arbs.
If you've spent time reading this contract and found a vulnerability please consider these 20 ETH as bounty fee.
8/ I believe that one of the best ways to attract such talent is to make it dead simple for anyone with RL expertise to play around with MEV bots.
Deep learning experts shouldn't be forced to spin up archival nodes and memorise the nuances of Ethereum infrastructure.
4/ Simplest way to start is always with supervised training so I took last 1 million blocks, traced them on archive node, extracted profitable transactions made by other bots and used them as ground truth.
Sadly it still required manually tuned heuristics to limit search space
2/ Using provides advantages on following fronts:
(I) Speed of transaction confirmation
(II) Mitigating payment for failed transactions
(III) Uncle insurance fund[EXPERIMENTAL]
(IV) No extra fees and minimal logging
I'm a boomer and don't understand value of NFTs even the rare/old ones. Fractionalised NFTs make even less sense to me.
But given I've promised some worthless NFT for winners of first competition and too bored to draw one in MS paint I've fractionalised one I won from Lido.
1/
With BetaRPC usage growing seeing successful back-runs quite often now. The most recent example:
User sold LQTY via 0x aggregator:
Path wasn't optimal so back-run was created:
User got back 78% of the opportunity, miner only 14%.
7/ Today was one the best days for AlphaMEV. Still, it missed a lot of opportunities, especially in situations that had no precedent (like liquidating Justin Sun).
To make it more generalised we actually need help from hardcore deep-learning researchers
2/ Bot transaction:
BetaRPC back-run:
Top of the block transaction using exclusively AMMs and flash-loan going from 170 ETH to 180 ETH and paying less than 1% of MEV profit to the miner.
3/ Even though I moved on and don't spend time on MEV any at the moment, it's still fun to see such a huge gap in miner payments between overcrowded strategies(99% to miner) and very basic new ones(1% to miner).
In transaction above it just seems to be new AMM(PegExchanger).
When you achieve peak efficiency in terms of transaction fees, but thanks for the 0.05 tip!
In this case it seems this was just UI bug but random shit is the reason I'm afraid of touching side chains. Without my own full node for side-chain never feel in control of anything.
One follower told me about
@LidoFinance
referral program. Decided to check ma balance after the NFT mint transaction, not so bad from 13 ETH to 825k$
Before everyone looses their mind: yes I know that I won't get it for violating Terms of Service but fun feature anyway.
1/
@bertcmiller
To perform a sandwich/front-run you need to have input shit-coin available. That's why proper slippage is more important when you buy.
So to sandwich Vitalik they had to hold bag of dog coins originally which they obviously didn't
In this sense back-run was their only option.
1/ BetaRPC 1 week in review:
1) Stability is slightly better now
2) Examples how BetaRPC empowered its users during very first week
3) Rookie errors to avoid
4) Why you should DM me if you're wallet provider and care about helping your users to avoid expensive mistakes
Now that few people looked at it privately happy to present to all black-hats as well:
Contract holds 170k worth of LUSD(staked via Stability Pool) on top of shit-coin rewards.
If you can break it - it's all yours, full amount is your bounty.
3/ (I) Speed of transaction confirmation
More than 99% of ETH transactions aren't affected by MEV in any way and yet using TaiChi network you have to wait 2-4x longer and use "high" gas price for 100% of submitted transactions.
approaches it on two ways:
1/ Broken logic works like this:
A) Group by tx['to']
B) Sort by gas price within (1)
So sandwich bots now just have to use router for buys.
But it's way worse in reality because it allows bots to front-run any dex-aggregator using sushi-swap internally completely for free.
5/ Confident in your model building skills?
Want to participate in a Kaggle-like competition where instead of fame and money you get a worthless token of appreciation or an NFT from an anon?
Head to to download the dataset and make submissions.
5/ Limiting the search space for AMM trades is straightforward. It contains following variables:
1) Platform - Uni / Balancer / Bancor / ...
2) InputShitcoin
3) OutputShitcoin
4) InputAmount
First three have low cardinality, and optimal InputAmount can be solved by ternary search
@NathanWorsley_
Found actual transactions from top
#1
place on leader-board:
1)Trade:
2)Back-run:
User received only 38% of the opportunity?
The hell is that, first route user incorrectly as "aggregator" service then return back to them only 38%?
9/ Right now code quality is abysmal(it was implemented in 2 days), but I'll try to open source main logic + ML models so you can run limited version locally with your own full node. Though it's not high-pri since main audience("beta" traders) don't run their own full nodes.
8/ (IV) No extra fees and minimal logging
Endpoint is provided completely for free
This endpoint will not save your IP or any personally identifiable information because it's none of my business
I'll also spin-up otterscan() instance to show any pending txs
Who can simply explain me AVAX gas fee market?
Why majority of blocks are empty:
Yet you still have to pay 1-5$ for transaction?
Why transaction fees don't go down to cents if blocks are empty anyway?
4/ (I) Speed of transaction confirmation
(A) ML model at BetaRPC predicts which transactions have to be routed privately and only does it for ~1% of affected transactions
(B) Improved coverage: it integrates TaiChi and MEV relays: Flashbots/Ethermine/BloxRoute/Archer/MiningDAO
1/3) Since creation of apeBot it performed 322 zero collateral trades using Uniswap and DyDx flash-loans.
Sadly it's still incredibly hard for anyone to compete in the auction if they don't have capital and have to rely on flash-loans.
1) So it seems that consensus is that 'screwing up other bots' is more ethical than other things.
I've been logging all the events which happened in the mempool for a year now. A lot of people read the 'Dark Forest' from
@danrobinson
but not many actually understand what happened
@SamuelShadrach4
So you buy NFT at 500k$ then donate it at "appreciated" value of 3.4M$ to claim nice fat tax deduction?
I guess I'll become something of an NFT collector myself closer to the end of the tax year.
@NathanWorsley_
I actually don't get it, why not route user correctly in the first place?
Like RPC endpoint can't change original transaction so can only spend gas on back-run.
That's a centralised DEX aggregator why not create optimal path in the first place?
1/ Why not today harmful MEV which comes from ArcherDAO relay?
Block from your mining pool where searchers leaves trader 0.55 ETH worse off with the help of your relay.
Overall this and are great steps in the right direction.
Today, harmful MEV comes from FlashBots Searchers and Miners working together to abuse transactions. 🤖😈
We used the same MEV toolkit to create Archer Swap (
@Archer_DAO
), which gives normal traders super powers and protects them with zero-slippage, zero failure cost swaps. 💪
Can anyone please explain to me why would
@sparkpool_eth
uncle its own blocks?
Example:
It's a block by SparkPool which contains uncle at block 13055372 which is also from SparkPool.
Are BeePool and SparkPool controlled by single entity?
Are there any yield farms with actual on-chain insurance?
Under on-chain I mean when I deposit X amount of ETH/USDC and if for some reason I can't withdraw X amount back at any later date it will auto-sell some locked insurance coin to cover the gap?
COVER/NXM are all off-chain.
New hackathon from one of participants in AlphaMEV contest.
I think it's a pretty interesting task to optimise for, though given limited evaluation time-frame my hunch that confidence intervals would be very large and winner will be likely the person to over-fit/gamble a bit.
Thrilled to announce our very first hackathon!! Focusing on
@Uniswap
v3 🦄, developers will compete to provide the optimal LP strategy wtih concentrated liquidity.
Details:
Finally figured out how to make MM wallet work with the fact that some transactions can be "discarded".
If you submit transaction to BetaRPC and it's failing(too late to mint NFT or price changed too much).
Previously it looked constantly stuck as "pending" in MM like below
1/
11/ Thank you everyone for your questions and feedback! I've received way more responses than originally expected and I've already found a back-end developer to help me push simulation infra forward. For now I want to keep it small to minimise organisational overhead.
5/ (II) Mitigating payment for failed transactions
Using simulation + another ML model endpoint predicts probability that transaction would fail in the block where it's included on-chain.
If probability is too high it only uses Bundle relayers to avoid payment for failed stuff
2/ I'm in the process of building a light-weight replacement contract which should allow for single-side trades as well.
Of course immutable, zero governance, TWAP with support for any ERC20(Collateral providers can pick any 'borrow-able' assets and required collateralization)
@angela_walch
In case of DeFi unless transaction is routed via private pools it's public information so doesn't seem the same as TradFi.
But better education is necessary as there're hundreds of options to avoid it as ETH user: mistX, taiChi network, , Archer...
6/ For liquidations, the search space is much larger: need to bruteforce all outstanding loan positions.
Finally, for 0x/EtherDelta orders it's ultimately unsolvable without additional off-chain data (order book) - but can also be pulled from mem-pool
@SamuelShadrach4
"Within an Eden block, transactions are ordered by the sender’s relative stake of EDEN tokens."
There's nothing about "fair" sequencing and seems like another pathetic attempt to shoe-horn unnecessary token with broken economics.
@vorot93
Can't find any public information how to help fund Erigon / Otterscan(
@wmitsuda
)?
It feels like having a client developed outside of US and finally having private block explorer(run locally) are horribly underappreciated massive wins for true decentralisation.
3/ For example, out of 13.6k ETH (27$M USD) paid to miners, at least 22% of arbitrages weren't even in the same block as transaction that created the opportunity. And it holds true even for some of the largest back-runs in the last 2 month.
2/ But finger pointing in this situation seems strange since every single company runs their relay allowing sandwichers by choice.
Flashbots relay
BloxRoute relay
ArcherDAO relay
Can relay easily prohibit sandwich bundles routed via their relay? They all can but no-one does.
2/3) What if you can do re-entrancy check / balance update and native gas token refund using just a single SSTORE operation?
Pretty much I've decided to create my own flash-loans provider:
It doesn't take any fee at all and is extremely gas efficient.
5) Ironically the fist bot which actually copied the transaction didn't get anything out of it and the second one wasn't able to copy it on his own until first bot did it.
So while forest had a lot of predators they were definitely not as advanced as people used to believe.
7/ (III) Uncle insurance fund
This uncle insurance fund is obviously not incentive compatible and is provided as-is without any guarantees whatsoever.
It will be funded by any MEV that doesn't negatively affect BetaRPC users in any way like back-running.
2/ While the concept of back-runs is widely known, people usually believe this game is exclusively focused on latency / gas optimisations or miner bribe.
But if we analyse back-run MEV transactions which paid via coinbase we can see a few surprising observations.
@bertcmiller
What makes you think that some searchers don't continue doing so? It's all fake money anyway.
Also gold farming bots in Diablo 3 before bugs and insane inflation.
Sad to see but I guess expected, I'm running 3 geth archive nodes myself for back-testing/training + 1 backup and after 1.10.4 it was a downhill road, first broken snapshot logic for archive nodes() and now this.
Guess
@ErigonEth
soon be only viable client.
Who will miss archive mode support from Geth? We're trying to figure out where to go with it, as it's not meaningfully sustainable, especially as we're pushing the gas limits higher and higher.
#Ethereum
@zzp45_eth
@bertcmiller
You should start a twitch stream I see you're trying to drain 0x00000000003b3cc22af3ae1eac0440bcee416b40 in real-time again :)
It's always pleasing to see sandwich bot operators getting rekt.
4) This second bot used checks on block.coinbase to disable geth simulation and checks on block.gaslimit to disable parity simulation. Now largest bots already adjusted their clients accordingly but back then it was relatively new and I've learned a lot from analysing such bots.
@SiegeRhino2
But what exactly can you double check as a user?
Decode hex number on minReturn field and verify it's high enough? No-one got time for that.
Wallets should be responsible for that and perform some sanity checks on transactions and warn users before releasing signed transactions.
@SiegeRhino2
@SiegeRhino2
if you participate I'll personally draw an NFT for you in Microsoft Paint. What kind of money can be more valuable than that?
@CryptoDragonite
@FrankResearcher
Good luck explaining to your bank/tax adviser how you've received 14 billion$ airdrop and now have to pay taxes on it :)
@fradamt
@SiegeRhino2
@NathanWorsley_
@MEVprotection
Back-running is always way less efficient than routing because you pay exchange fee twice(user in one direction, bot in another) on top of wasting additional gas and paying for it so it won't be "competitive".
@_someone_els
@LidoFinance
I've made minus 13 ETH in this "arb" so don't recommend copying it.
Though important part is friends you make along the way :)
1/ Giving a heads up for searchers who used apeBank for their swaps:
It will be deprecated shortly after London upgrade since main benefit(cheap native gas-refunds) will become obsolete.
6/ (III) Uncle insurance fund
Some blocks become uncles and all transactions go into mempool.
I'll setup a bot to fight in MEVA auctions to include BetaRPC transactions from mem-pool completely unharmed.
This will be applied only for txs which can be negatively affected by MEV.
6) As the last corner stone we'll training and documenting reinforcement learning model trained using archive node on all historical profitable arbs and liquidations by other bots.
Based on trigger events(like oracle updates/AMM trades) it will predict optimal back-run path.