New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

How to win MEV and trades on ethereum post merge with Eyal Markovich

Ethereum DenverMon, Oct 9, 2023, 12:00 AM

We'll go in-depth and untangle all the factors contributing to actually winning the trades regardless of how fierce the completion is.

Transcript

CEO of blocks route blocks out it's been helping a Searcher on D5 in the last four years and so what I what I thought that I'll share with you today is a few things that I've seen in the last year two year our Traders are winning more on defy and obviously we'll talk about the changes after the emergent because that's affected the the way that the Searchers are working do we have any Searchers here Traders cool so first of all Let Me Tell let me share with you if you don't know D5 is extremely competitive okay it was very competitive before the merge and it didn't change anything on every opportunity that a Trader is trying to extract Mev they are basically 10 to 50 other competitors that are trying to extract the same Mev okay so this is how how competitive it is they're basically three things that are required in order to succeed you need a better infrastructure because really on defy every millisecond count you need a better strategy some strategies are easy some are a strategies are hard in terms of compute in terms of risk on the trader whether they are Atomic strategy or not and the last thing that you need is basically a good execution and luck okay so we'll talk about the talk about it so when you think about what happened with the transaction on ethereum basically transactions are being generated by users user can generate transaction anywhere in the world using wallet like metamask or any other wallet and transactions are also being created by dexes by um by project the message here transactions can be created anywhere in the world you don't know whether it's going to be created in the US in Europe anywhere now some of those transactions are making changes to that effect that create that are creating Arbitrage for example a swap transaction large volume might create a a price change on one decks and that will create an Arbitrage because the different decks still have the all the price Liquidation on on for user that create an Arbitrage because a user a Trader that can capture that will get the ability to execute trade on a lower price so if you're a Searcher you are you need to find those transactions don't transactions that are creating the Arbitrage I call them trigger transaction you need to find those trigger transaction you need to create your your trade to capture the Mev and you need to execute that and you need to beat all the other 20 or 30 searches that are doing the same so two days ago I participated with the event together with block native I don't really like those two slides that I'm going to show you and I think they are explaining explaining what happening right very well so a user is signing a transaction within its wallet submit the transaction through the peer-to-peer Network through the ethereum network and the transaction get into the main pool mempool does nothing like a single mempool every now there's its own mempool and a Searcher is basically looking on it on the Maple and trying to identify those trigger transactions that we talked about if a Searcher if a Searcher identifier trigger transaction start to create their their trade and submit it to the Builder if there was no trigger transaction the Searcher is not involved in the transaction appears in the Builder mempool the same way that the appears in the Searcher man pool the Builder create the block submitted to the relay to the validator anyone here that is not familiar with PBS on ethereum post merge don't know what I'm talking about then I'll talk a little bit about that hmm so really in order to win in order to win a defy trading you basically need three things you need to see and identify the trigger transactions so that's identify blocks and transaction very fast then you need to have a very good strategy a very good program it's called the trading bot to to compute your trade to capture the Mev so we're not going to talk about that and then you need to submit your transaction to the to eventually get into the block over here we're talking about two different type of execution you might send the transaction through the peer-to-peer mempool transaction or you might send a transaction that is private you you might hear someone talk about flesh but bundle that is also a private type of transaction so we'll talk about those in in more detail foreign so first of all how do you disc how do you identify a transaction trigger transaction within the main pool there are several way to do that you can if you're running your only term node you can get a stream of transaction from the node through a standard web 3 endpoint that the node is providing if you're going to do that you're not going to win because you're going to be way too slow there are service provider for example like us that are giving a manpul data significantly faster so that can be 100 200 milliseconds faster remember we're talking we are millisecond nanoseconds so we're not talking here about minutes delay so you can get mental transaction 100 millisecond faster through a service like us which give you a give you some Edge in order to compute your your trade and there are some some tools okay so you some tools that allow you to compare between when am I getting the transaction from for many node when am I getting the transaction from infuria when am I getting the transaction from blocks route and so on and allow you to know whether you ever even a chance another tool that this is actually coming from us and it's free is the ability to see for each transaction and usually you're doing it only on the trigger transaction where exactly was it in the world when did we see it in a in Europe when did we see it in in U.S and then you can compare the time that you identified versus the time that our Network identified and if you are behind and you know that you need to improve your infrastructure so how can you get faster first of all you should not use the node the pending transaction it's just too slow some Traders are running there are Arbitrage but not in one place in 50 different places just to hear about the things a few milliseconds faster and execute their trade faster if you are using solution like us for the bdn you want to co-locate with us you want to get closer to us it's all about reducing latency and you also if you are running a node you want to improve the quality of your peers or use a solution like what we have it's called upscale to improve no Discovery but the idea here is don't rely on the default configuration of a node it just it's good for the for the normal project it's not good for D5 so here's for example this is a from a again a free tool that we offer called bdn Explorer and you can see there where most of the transaction are entering the bdn in the world and that gives you a sense which region you might want to consider to run your your trading but and now another metric that you want to to to monitor is where do you get the trigger transaction where do you get transaction in in general this is for example a metric that we provide if you're connecting to us how many transaction are you getting from us first if you have a 20 pairs in your node for each period you want to you want to monitor that and you want to make sure that the peers every period is very expensive because there is a number of slots that the node can support you want to make sure that you are getting enough data and you're not wasting a per slot on that so that's about getting a hearing about the trigger transaction that's that's the key without uh doing it fast you you have a less chances to succeed now slot in ethereum is every 12 second post merge if you are going to identify a trigger transaction in the first four seconds of a slot nothing bad happened like if you're gonna identify it with 200 millisecond delay versus the competitors nothing really nothing bad happen because you have you still have eight seconds to execute your trade but if we are at the last two seconds of the slot the annual you have 200 300 millisecond delay your chances to succeed went from 20 to 0.1 percent so you want to invest in infrastructure especially for the last few seconds of the slot because this is when validators are going to get their block from the Builder and if you are not if you're if your transaction is not part of the block of course you didn't win so how do you get faster in terms of sending transaction first of all it's depends whether you are sending a public transaction and mental transaction or whether you are sending a private or a flashbot bundle if you are not familiar with what is flashbot bundle should read about it after the after the presentation so if you are sending if you're sending your transaction to extract the Mev as a public not too many Traders are doing it some Traders a hundred of each MAV extraction was with public transaction in the last year so it's still it's still happening from time to time if you want to do that you want to make sure that you are connected to very good peers that can get your transaction as fast as possible to the Builder that can be appear like the like the bdn like our Network or that can be a nodes that are connected to the Builder nodes but if it's going to take 400 500 milliseconds for the Builder to get your transaction through the peer-to-peer and it's the end of the slow or close to the end of the slot or actually the beginning of the next slot you lost and other things that you want to consider is a different RPC so if you are if you are a Searcher and you submit your transaction to an RPC then summer RPC will be much faster than the others so invest the time to measure the RPC performance here's an example that basically when you look on RPC performance you are looking on inclusion rate how long does it take until my transaction gets into the block okay usually for MVP extraction it's one it it must be one one block after one block it's usually Mev was extracted by a different searcher but as you can see here there are some RPC that it can take five to ten blocks sometimes sometimes it's one it really depends whether the block was created by the owner of the RPC some rpcs forward the blocks like us forward the blocks to all the other Builder and that's why the the inclusion rate is is better so let's talk a little bit about block building if you are a validator foreign in the next slot to create the block you are basically the proposer the proposer will issue a request to several MAV Builder to get the best block they may have really at that point will return the best block that it is now the map relay is getting blocks from different Builder basically getting the block checking which block is the best for the validator and in the end when the validator is going to ask for the for the blog they relay will return the block you as a searcher you as a Searcher once you created your trade you submit your your trade usually as I said there's a flashbot bundle you submit your trade to several Builder okay so you want as a Trader to make sure that the Builder will get your bundle enough time before creating the blog so when the Builder create the block it will include your bundle otherwise you lost the chance um who are the major relay and who are the major Builder the best tool to see that it's called relay scan really scand.io that's the tool that that you want to to look at you can see on the left side you can see the different you can see the different relays you can see our we have one here 21 that was the last week so 20 it's of course change every every day 21 and we have two more so around 30 percent of the block space is coming from our relay and on the right side you can see the different you can see the different Builder so you can see some Builder can create about 22 of the block and some building some Builders create very low number of block per day there are basically two types of Builder what the first type is infrastructure Builder so those are builders that are getting public transaction from their main pool and bundle from searches and with some sophisticated algorithm they are aggregating all those bundles and transactions into a block to create the best block possible those type of Builder are for example flashboats blocks throughout also dot types that type of Builder those Builders are not creating their own transaction they are not a searchable by themselves they are a type of Builder are researchers so some searches that you will compete with or the other search are completed are actually Builder by themselves they have a huge advantage especially if they have a lot of liquidity they have a use a huge advantage and many times they are winning the blog and you will not be able to win your uh your trade and your defi unless you get to their to their RPC and get included within their blog as well happy so how can you get to the Builder of course if it's a peer-to-peer then it's happened automatically because the Builder have have a node and node is connected to the peer-to-peer if it's a bundle you want to submit the bundle to their uh to their RPC unless that's a builder that is a Searcher and you are considering that they are competing with you okay because some of them as I said is a search and they can get your bundle they can look at what you did and they can say wow this is cool I can I can earn 100 each year so I'm going to do exactly the same and forget about yours and just do it and they have a few enough milliseconds to do that as I mentioned everything in if 2.0 is with a slow time of 12 seconds and as a Searcher you really must think with the boundaries of a slot so to get your bundle to a builder you must get your bundle before the before this the blocks are ready at the at the relay before they validate or the proposal requested the block from the relay so we can see over here this is based on last week 800 blocks that I just randomly picked 149 milliseconds before the end of before the beginning of the slot the winning block those are the winning blocks already exit existed at the at the relay so if you are sending your transaction 100 millisecond before the beginning of the slot most likely you you are going to miss the the chance to get included so when you submit your bundle of course you can control to which Builder to send the bundle you can control when to send the bundles for some opportunities it's very critical to time the the bundle submission both in terms of when the builders is when when to send it in terms of the block but more because your strategy might be something that is affected by an external external signal for example if your strategy is if I Define so if your strategy is safe identify you know that the D5 on ethereum happens every 12 second but the C5 constantly happening so you might want to delay your your trade your final trade just a few uh maybe a second 500 millisecond two two seconds before the slow time and not do it two seconds or 10 seconds before the slow time so it's really depends on your strategy and depending on the risk that you are willing to to take here's a some data data from the field last 100 bundle last week when I created that slot and you can see by average 5.

5.6 seconds before the slots die time most of the bundle arrive but on the other hand you can see that in the last two seconds of the before the Slow Time we see an increase in the number of of bundles so it's really depend on the type of bundle if it's uh things like sandwich attack it doesn't really matter when you send it so you can send it immediately but if it thinks like C5 defy you you want to wait until the end of the of the slot so there are few things that I want to talk about before see if you have any questions is if you are a Trader and you're just starting how do you travel shoot so first thing you want to know is who won the block okay so one block is really which Builder created the block okay and which Mev relay created the block because you want to make sure that in the next time you are going to submit your bundle to maybe the same Builder and you want to make sure that the Builder that you're submitting to is working with it with that really so you can go to big Concha dot again that's the leading uh Explorer for the Bitcoin data and you can type the slot number and you you will see the related one uh that's there's there really has quite a lot of endpoint data API endpoint that you might use to get additional information we're not going to cover it but if if it's interested thing for you you might want to look for the data API of the Mev relay and the last thing is how do you know which Builder created the block you can take the you can get it obviously also from from the Explorer but you can also go to atoscan zoom into the block and if you look on the extra data just you're gonna see which builder in this example you can see it's Builder 69. all right let's see if you have any questions cool thank you thanks for coming [Applause]

Automatic transcript — names and jargon may be misspelled.