# Where do Bridges leak MEV? ## This is MEV I recently watched this talk and it fundamentally changed my thinking about what MEV is and subsequently led me to think about where MEV is produced in the Across Protocol. <iframe width="560" height="315" src="https://www.youtube.com/embed/8qPpiMDz_hw?si=0uJf-kRbu5jBYf1O&amp;start=97" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> ## What do Smart Contract Engineers do? I, a smart contract engineer, try to build dApps that produce as much value as possible while minimizing MolochEV (the value lost by uncoordination arising from inexpressiveness and a suboptimal mechanism) and MafiaEV (the value extracted by sophisticated agents or the "Mafia" at the expense of unsophisticated ones or "retail"). Also, "Maximizing expressivity" is just a really fun and esoteric way to describe software engineering. In the best case, I create dApps that maximize their MonarchEV, or value that accrues to the protocol in exchange for a valuable service rendered. It’s best that the protocol receives this value, as opposed to it being consumed by sophisticated agents at the expense of unsophisticated ones, or lost into the void. Then, the protocol can distribute the value to those who "deserve" it within its ecosystem, like relayers and LPs in Across (and maybe even ACX holders). ## So where does Across leak value? Across produces value by charging bridge depositors who want to move their funds to another chain. This value is MonarchEV and is supposed to be paid to relayers and LPs. Any of this value going to unintentional recipients I’ll refer to as value leakage. You can also think of this leakage as MEV produced by Across. For all dapps, value leakage usually occurs when the order of transactions can be swapped by block builders (sandwich attacks) or when more sophisticated uses prey on retail ones (front running). For the most part in Across, there are no value extraction opportunities where the order of deposits and relays produces extra value for block builders. There is however some value lost from retail users to sophisticated ones. First I’ll discuss why there is little[^1] value lost to block builders. This is because Across is architected such that deposits are defined very "loosely". Bridge depositors signal their intentions about where they want to receive funds and what fees they expect to be charged. Relayers see these deposits off-chain and fill them on the destination chain and get refunded by the protocol. The order of the relayer fills does not affect their refund. The order of the deposits does not affect other deposits (but it can result in relayer loss of funds as demonstrated below). So, there is no value lost to depositors in Across, but there are some subtle value leaks from the relayer capital pool that can be fixed. ## MolochEV and MafiaEV in the Across Relayer pool *TLDR: Relayer value is lost to front-running, resulting in higher gas fees for the winner and ETH surrendered to transaction reversion by the loser.* First of all, MolochEV (value lost to uncoordination arising from suboptimal mechanisms) is produced when honest relayers try to fill the same deposit, and the slower one's transaction reverts. The ETH coughed up by this reversion is a negative externality. Moreover, honest relayers competing to fill these deposits results in higher gas fees paid by the winner. Across also produces MafiaEV via a similar situation where sophisticated relayers prey on "retail" relayers and front-run their transactions. Across today unfortunately lacks critical mechanics that prevent relayers from entering into a race to relay, which leads to loss of relayer value to block builders (MolochEV) and other more sophisticated relayers (MafiaEV). An RFQ or "flash auction" system will fix these two sources of unwanted value loss. ## Across Flash Auctions We plan to build an off-chain auction API where relayers bid to win deposit RFQ's submitted to a private auction relay. This would prevent a duplicated relay from ever appearing on-chain and reverting. Across would likely need to upgrade its protocol to enforce that winning relayers are the only ones who can fill these deposits, and also penalize them for not following through on their bid. Perhaps this means that relayers would have to deposit a bond into a contract, in exchange for getting access to the RFQs. In net, depositors would get charged the fair fees for their RFQ and relayers would be protected from reverting transactions.* *Of course, it’s worth noting that these auction API’s are trusted. For there to be sufficient competition for running honest auction API’s, they would have to be able to charge fees. If we assume that we depositors would only use these auction API’s if their net fee is lower, this fee would have to be passed on to relayers. So, the auction fee would have to be less than the expected value lost to relayers who don’t use an auction API and get frontrun. This problem is very similar to the problem of running trusted, zero-revenue “MEV Relays” today. By the way, I previously touched on this RFQ idea [here](https://hackmd.io/@nicholaspai/S1TmamGOn#Modular-Components-within-Across). ## Conclusion This was a really fun exercise to map out {mafia, moloch, monarch}EV produced by Across. I don't believe there are other sources of non-Monarch-MEV in Across. Moreover, the above MafiaEV and MolochEV are easily transformed into MonarchEV from an engineering perspective because so much of the Across protocol lives off-chain in modular Relayer implementation. Across is clearly benefiting from having implemented an "Intents-based" architecture and will continue to be nimble as a result. [^1]: It’s worth describing a rare way that value leakage is produced is that block builders on the deposit origin chain can re-order deposits to make relays on the destination chain invalid ex-post, which causes a loss of funds for the relayer and double pays the depositor. However, Across mitigates this because relayer implementation is customizable and all relayers today make sure to only relay deposits that have a very low chance of being re-orged on the origin chain. (If relayers want to increase their re-org risk in order to beat others to deposits, then they are free to do so of course). Perhaps this is an area where Across can enshrine a minimum follow distance into its protocol to disincentivize depositors from colluding with origin chain block builders.