What is OFA and why should you care | Nic Lin, imToken | ETHTaipei 2024
ETHTaipei·Wed, Oct 9, 2024, 12:00 AM
What is OFA and why should you care | Nic Lin, imToken | ETHTaipei 2024
Transcript
okay hi everyone uh my talk today is uh what is all the FL auction and why should you care okay let's begin uh a little about me I'm Nick Lan I work at I'm toen Labs we work on Dex defi L to research and we're also working on account account abstraction and also uh any subs okay uh here is a slide for today if anyone is interested I'll pass for 5 seconds okay so uh my goals for this talk it's simple it's a it's a very easy talk for beginner and I want to get more even more people attention on N the NV problem and also I want to convince you to start sending your transaction to all of auction uh which I'll introduce later and next I will uh in the end I will show you how easy it is to to use OFA to send your transaction to OA I will show you how it is and please uh use that after this talk so my agenda uh my talk will be separate into five parts first we'll go briefly go over what is n again and the next I will introduce uh you the OFA concept all the full auction and the third part uh uh we I'll be sharing you the experience uh we have when integrating with an O OFA for the past six months when we uh use our Dex tokon to integrate an Offa and next part uh I'll show you how to use an OP very simple and a summary part so let's begin uh what is n n put simply is the value extractable by inserting transactions or manipulating transaction order this could be done by miners in proof of work or by proposers in proof of stake or right now it could be is done by whole am supply chain thanks to PBS so some examples uh first the front round this could be the means or the FR Tech shares that you are uh eagerly to buy uh last November I think so uh a simple demonstration like this L want to me nft he send the transaction to a public man pool and somebody will front round it because they think this could be valuable on FD so they front round the transaction me before LS did so in the end L transaction fa she did not get the nft and the Searcher did and you she will then resell the NP to Alis for a higher price so this is from round and another example is Oracle updates for example you have a landing protocol and you have Oracle you update the price for the landing pool for example you update the price the latest price for eth and you will send it to men pool and this price update could trigger some Liquidations in the landing pool so and a Searcher sees this uh price update in the menol should fight to Take Along his liquidation transaction along with the price update transaction so that it could be the first one to liquidate uh whatever is to be liquidated on the Ling pool yeah so that's the Oracle update it also emits uh opportunities for n and next example is background so suppose La is want to swap eth to usdt and right now the price is roughly maybe 4,000 us DD on unisoft and since this is an mmm so she will set a minimum price acceptable price uh $3,900 USD and so you send the transaction to part manol and again the Searcher sees the transaction and since the AL transaction is going to move the price on the mmm so there's a price difference that means there's a up charge opportunity for the Searcher so Searcher will uh again send a transaction Arbitrage transaction will swap on the re reverse Direction swap usdt to eth so that you can make the price difference the up up charge opportunity and he will follow the Alex transaction so this will be a background transaction and another one the sandwich this is the the bad one so again AL send a transition to swap is eth to usdt and the Searcher saws that this is a bad Searcher and he what what what she will do is first he will will since the all is like he will specify the minimum AC acceptable amount uh he will accept a certain slippage so this Searcher will do a front R first to swap eth to us2 and to squeeze the slip slipage out and then after Alice transaction you can see he will add another background transaction to swap the one he just get here in the first front run transaction so I'll be back and to maximize the sech profit so in the end Alis will get the worst acceptable minimum price 3900 usdt so this would be like the very worse uh any example sandwich transation so next some examples that show you the transation not don't have any first uh token transfer simple token transfers or approval this don't have any opportunity so when you are doing this don't worry it it doesn't harm it won't harm you in any way uh next so uh the same applies to nft transfers the transfer simply doesn't IM me any chance opportunities for a and also uh for the rep eth deposit and with throw they they also doesn't have the chance for EnV so don't worry about the actions you taken uh uh the actions you're taken here the rep e uh actions or transfers approval they don't have any opportunity so uh we have talked about show you s samples and brief over overview of the N what is n next we will go into the main topic today what is an OFA what is an OFA so it is uh it stands for all the FL auction uh what does it mean basically it means you auction in all users transaction why would you do that why would you want to aution of user transaction or orders well because this will give the Offa by doing this you will give the user a seat at the table at the AMV supply chain table uh basically so what does it mean so before RFA exists this is uh how NV supply chain works atas is the one that generates Nev and the Searcher will exploit this n uh either back round front round or sandwich it will stke the many values and it will share with the builder ask the builders to include my bundle because I want to extract this money and and the same will goes to Builder Builder will ask the validator will pay you some share and please include my block so the whole EnV Supply train will exploit LSN and share the profit among them so this is before n at is the one that generates n but he's the one gets bullied gets exploited so after o OFA Al now have a chance to argue for what she deserve uh in Offa Alis will send a transaction to this Offa service where over service will like auctioning all Alex transaction and the Searchers if uh if the Searchers find this transaction to be profitable to be uh to have uh any opportunity who beat on this uh beat on this transaction and so once he beat successfully beat the transaction in extract the transaction you again also share the profit with the uh participants in the EnV supply chain but now uh they will also have to share the profit with allies because they have to PID for the transaction so Alice now can after with with the use of OFA she can now profit from her own transaction so basically o use the EnV supply chain to users Advantage very example we can do o can do uh transaction Reverb protection although this uh feature Reverb protection actually exists uh far before o even exists it exists uh like the flash bot protect Service uh maybe like three years ago or even uh in the proof of world age there's a TA Network that offer this kind of protection but uh so so this uh this feature is not unique to Offa but with Offa you can do it very simply you can offer a Reverb protection so la is supposed she want to means and and maybe she will be the uh her transaction will fail because maybe he didn't provide enough priority so she her transaction were getting slower and fail so with Offa when it if if you send a transaction to Offa and Offa to the Builder uh the Builder will not include her transaction if her transaction is going to fail because a fail transaction pay less tip so the Builder will naturally doesn't want to include any fail transaction so naturally this will give the user of OA give Alice the rever protection feature and also uh on top of uh rer protection you get any protection because OFA can ask anyone who wants to beat on this transaction you have to follow certain rules rule number one you cannot front R the user transaction or you cannot sandwich it this is rules you have to follow the rules and then we will give you the transaction if you do moreover you can ask for Kickback or or it's called rebate or refund so you'll be you uh for example the Offa would ask the builders if you get include a bundle that include the user transaction you have to pay the user a rebate a money uh the bid basically pay back to Ellis you have to follow these rules if you don't and I won't be giving you any other transactions you will be kicked out so this is the what can do o basically leverage MV supply chain the negotiating all this feature all this benefits for the user so some sandwich uh very uh testy sandwich data here so you can see uh this is from IGI uh there are thousands of sandwi transtion happen every day and this is also from another um dashboard zero n you can see that uh just um um just a few hours you get uh accumulated that um tens of thousands of US Dollars been front R been exploited in stred because of the sandwich transaction so it's pretty worse and this is the chart that compares the sandwi transaction to Total Dex volume and it's roughly 8 to 10% of the total Dex volume are being sandwiched and among the sandwich transac among the Decks that get that has transac get sandwich uh Unis swap is a top one uh it makes sense because after all un swap is the the most wellknown most popular Dex after all um yeah so this is uh most sandwich token Pairs and tokens uh if you are swapping uh the the tokens me web or usdc usdt you are swapping uh uh using this pair on unisa you have to uh be extra careful or simply use an OP um this is uh the call from Interview with a famous sandwich Chef that's basically sandwich and so in this interview he I called he says uh if you're just working off the public available information such as the manol public manol uh I think it's a fair game so to this sandwich there's no problem of about sandwiching people being ethical or not to them this is public information and they are more than comfortable exploring this transaction so it's pretty bad so and another chart is is uh this is a chart of showing you that uh right now roughly only 50% of the transaction are private transaction that's the transaction not sent to Offa only 50% so uh uh it it doesn't say uh I don't mean that the rest 85% should be also sent into private trans because as you see now all transaction uh has any opportunity so many of the transaction doesn't have to send TOA but uh 15% is far I think uh far below the uh the threshold that people should be if if people are really protecting their transactions uh yeah so this uh from Fresh B dashboard uh 10 to 50% transactions are private only so uh a little misconception to clear here uh OFA some people might think that Offa provides a rever protection uh AMV protection and also avoid public manol congestion well actually no uh it doesn't provide a public man pool conation you sending a transacation to OFA to a private man pool does not mean you you don't have to compete with other transaction on the public man pool you still have to compete with all other transaction on the public man pool so here you can see uh normal transaction normal user send their transaction to p manool and la and others send to UFA and to Searcher you you will observe transaction from both public manol and OFA so again you have to if you want your transaction to get included F or be included after all you have to you still have to pay enough priority fee pay enough tip to the uh Builders or participants on the MV supply chain so why would they include your trans transaction uh simple it's just incentives there's no like uh charity or aism Builders Searchers they include in your transaction because your transaction is profitable your transaction is profitable maybe because you have uh IV background IV opportunity or you simply pay tip the priority Fe so one k that I still have to mention that is is that a supp chain currently is built on trust uh you can see the user trust Offa to auctioning of the transaction Searcher trust the Offa to not uh steal in their uh uh front wrong or backr transation a backr transation sorry and also OFA once the Offa send the bundle to the Builder he has to trust the Builder and the Builder of course have to trust the validator so the uh supply chain is built entirely on trust right now so can we do better yes uh but uh how with priv privacy uh though at the moment uh the Privacy requires like Advanced cryptography so we don't uh there is still a long way to go so yeah I just briefly mentioned the uh supply chain is currently buil on trust so don't expect don't expect the transition uh Supply train to work like 100% fine there are s still could happen some accidents okay so some examples of OFA uh here we have uh a blocker and a share uh a blocker is built by uh I think K swab and other um uh professional Market maker team and avv share is built by flashart and uh uh also uh beyond the OFA features that I mentioned uh NV share also provides they are also working on a feature uh called program uh programmable privacy where in programable privacy user can decide which part of the transaction to R to researchers uh so for example Al sent his transition to any share and you will specify that I only want to share I only want to reveal the contract I'm intering with and the function I'm calling to the Searcher so transacation will look something like this and this would means that the transac is the information of the transaction is uh sealed or blocked uh the Searcher cannot see them and uh in the bottom Bob will specify that I'm find with revealing my Contra uh the contract I'm interacting with uh the function I'm calling or even the events that emitted like for example these events uh on uni swap where the events will indicate like how much what token you're swapping and how much amount you swapped this information could be really helpful for the Searchers to do background so if Bob is fine with rebuilding this much information here of course we have more clarity on the transaction for the Searcher and that's that will basically be a trade-off between for user to choose between a privacy and Searcher efficiency so if you if the user want more privacy uh it will make it more harder for the Searcher to do backround and that would means uh it's probably less uh profitable and less rebate and on the other hand if you can if you only want if you want less privacy then of of course the mean if I have a higher opportunity to extract and that will mean more rebate so this is a privacy I mentioned you uh with privacy we can do so uh much more uh in the Offa okay so next is uh transac boost uh it's basically an Offa aggregator uh why would we need an O Offa aggregator because uh different overas they have different apis they have different let's say different transaction status and they have different error handling so if you want to integrate Offa one by one it could be tricky or uh pretty complex so with uh an off aggregator you only interacting with one entity and he will handle the rest uh interraction with Offa for you so you make your transacation uh uh make your integration much easier uh okay next example Is AO uh it's uh basically what all does what this Offa does is that you get a rebate uh from the Oracle extractable value so this value is basically the EnV example I mentioned in uh in the beginning the Oracle updates that emits uh EnV opportunity so uh it will sometimes be called Oracle is tradable value so uh with AO uh the price Oracle will now the transac the price update transaction for example uh there's a new price update for it uh the transaction will first go through OA and Ola will announce to the Searchers that uh here is a new a new e price Oracle update and so uh you probably affect Landing Pro a l for B and Searchers can then uh start uh calculating like how much uh he can profit if it gets uh if we follow this PR price update and do liquidations and they will beat on this transaction too so with RFA now lending protocol get to share the profit from the Oracle updates uh before Ora all this uh a or all this OE goes to the Searchers only uh with o AO Ora now the Ling protocol can also benefit from it so next uh uh last example is also protocol that's uh become AMV aware and then to integrating AMV ID is that uh start utilizing neb for their own good so uh simply put uh here the en problem uh other chargers can profit from passive liquid providers loss uh because price change but uh P passive liquidity providers the the liquidity the price on am doesn't update so this price difference uh this Arbitrage opportunity is lost to the arbitragers and so this could this uh this is a problem long plag in the mm uh design space so now there comes new two uh new uh two new designs the first is the function maximizing mmn I think this developed by the C swap team so uh in FM FM mmm the Arbiters compete on the right to do our Arbitrage and uh the one below the auction manage mm is U proposed by Paradigm unisoft team and in mmm it r the right to manage pool to the high speeder so there the on High level that work similarly actually uh is just like auctioning off the right to do Arbitrage or managing pool this also include the high speed could also do the Arbitrage itself but it can also set the fees so but on High level they work the same with n know protocol can also benefit from the N it generates okay so uh we have introduced the idea of Offa give you some examples uh then uh uh right now I will share you uh with the experience we have integrating with the offs various ofas uh when we are using the Tok on our decks and so here are some challenges of using the OA first uh we discovered that our private transation got sandwich uh this normally should not happen you shouldn't expected to happen in offs so and also it's very hard to debug as everyone involved in the MV supply chain also take part in landing a transaction on what I mean is that everyone is suspicious even the user herself is suspicious why because user could uh import his private key to another wallet and another wallet could have a different endpoint so he could accidentally send the transaction to a public man pool so it's actually not our fault but uh it's also hard toar because you have to figure out exactly you have to track essentially have to track with every participant in this Offa supply chain to to see if they are doing thing right doing things right and you have to do this one by one and so it's very difficult to debug and or maybe maybe they are all innocent they're not or not at fault so this is uh come come out to our mind and we decide to like we we RSE we trust all all of the participants in the MV supply chain trust their honest and it could be happened because of incident accident yeah it's possible because e theum proof of State system right now they can it can reorg so for example here uh you have your private transaction show it send it to includ it in Block 101 and everyone can see the transac because it's included anyway it's public now but the 101 transition uh after a few seconds it got reor the block 102 uh is pointing direct to block one block 100 because maybe the Builder Val validator that's producing this block didn't see block block 101 coming maybe due to the network issues so he would essentially reor the block 101 so now the transaction inside block11 is public but is not included in the block Trend in in the con cult anymore so everyone is free to use the transaction free to extract the NV opportunities inside block one one so of course then we'll have uh your transaction private transaction supposedly to be protic that landed in next block and get exploited get sandwich so um yeah so again this is not like uh accusing any participants in the any supply chain of being not of not being honest because excellent still happens and maybe most of the time it's not due to the uh human error it's just like nature of the chain and next problem we run into is that the Builder did not give rebate um sorry as I mentioned before the Builder uh as required by the Offa it should give rebates to the user but we discovered that uh uh the one of the Builder did not give rebate to to the to the uh user to the Ben beneficiary and this this is discovered when we inspect our uh Reb history manually we nobody told us that this happened we have to discover that when only when when we uh look into the rebate history ourselves like manually expecting that so again all the participants could be at fault uh Offa maybe didn't send the transaction maybe Offa didn't give the rules or maybe uh searer Builder could also have fault maybe searer didn't um successively exploit uh successfully do the background they could also happen so again it's it's also very very difficult to De B and after some interaction with Offa the builders uh we discovered that uh the Builder had a misconfiguration and yeah it's simply that just uh a misconfigure a misconfigure configuration and uh so the third problem uh we run into is that uh we see that there's no rebate for quite a while I think it's uh almost two weeks and so begin to wonder like uh is maybe somebody treating on us like doesn't give us the rebate again or it's simply again a misc uh misconfiguration so yeah everyone is all at fault here it's very hard bu um or maybe it's just not enough any generated your transation though it swaps on and Dex andm but maybe The Profit just uh outweigh the cost so nobody wants to do the uh background or maybe uh they just know Searchers online or maybe the Searchers online just don't have enough liquidity to do the Arbitrage yeah it's all possible and so we tried the open source tools to like retroactively search for background opportunities uh like trying to prove that my transac has a a background opportunity but you fail to include it that's what initially our attempt to like debuging why this this happens so about we discovered that this is not actually uh attributable as I mentioned uh there are many uh cost uh to this problem sear as non Alliance Searchers not having enough liquidity uh and you can really blame blame them so uh with the uh three examples I give you uh is showing clearly showing that currently Offa has a lake of monitoring TRS uh how do we know our transation got reord how we we we get notify if we get re or search SPS following the all rules correctly uh are the Offa Searchers competitive enough uh what what if my the Offa I'm choosing uh does not have enough Searchers that will also uh decrease the chance that I get a rebate and so naturally you will want to have multiple offs it have several benefits Evol avoid single point of failure that if uh the off crashes you will not get your transaction stock and you have more offs natural means more Searchers and you are more likely to get rebate but it also means that you'll be more difficult to debar because you have now have more participants in the supply chain and you also could have conflicting Offa features like one Offa uh provides privacy but the other the other one don't so right now if you're choosing to integrate two ofas you have to give up on the Privacy feature okay last part how to use so how to use and all of that it's pretty simple uh first uh uh token long RX token and CWA now they offers any protection and rebate by default they send the transaction to the Offa by default and on token wallet right now is still work in progress because we have to like make the user experience better before we decide to actually integrating off sending transactions to private mol so uh um beside the the deps you use here if you if you use all deps right now you can manually set in RPC endpoint uh to your wallet in your wallet for example you can set it to NV blocker uh they have this uh link uh in the web page you can simply add add the uh click the button at to wallet uh you will natural uh you will automatically pop up the uh bottom and configuration on your Ms wallet and you can simply Klick then after that transation will be forwarded to AV blocker for protection and and rebate and avv Sh it has uh also has the same uh uh easy to use uh web page where you can uh it has provide more options and informations for example you can choose which mode you want and you can also specify like you want how much privacy you want and how much uh information you you reveal or how much Builders you want to send to uh it's also very easily configurable and the transaction boosts also have a easy web page where you can click on the uh Builders uh you want to send to and also he he has a privat session Explorer where you can enter your private transaction and you can view the status of your transaction so these are all very easy to use so summary users are losing million dollars every month uh due to n and users transaction gener generate any but they are the ones that getting exploited getting bullied and now uh with OFA it gives user a SE at the table um it uh gives them the right to uh negotiate the power negotiate for rebate uh but still OFA needs more monitoring tools but UN list I like to discourage from using an Offa um for for a simple user uh simply pointing your RPC to an off is is just provide so much benefit that even the the challenges I mentioned happen is only very happen rarely occasionally so so using off still always the the cost so please um go use some off get protic and even get a rebate right now okay thank you uh any questions any questions actually I do oh go ahead yeah um actually like I'm not quite sure about what's the me landscape right now on l2s is that a problem or is it mostly on layer one only um mostly layer one yeah okay um yeah so uh I got a followup question so in your slides you mentioned like um like the Privacy part requires more encryption like the trust right right now all everything is based on trust and so in your opinion or from your current understanding what encryption or cryptography are still needed and who's working on those actually uh on removing the trust in the this supply chain um so the uh the one that uh come out to my mind is like a shter network that's uh providing inced man pools I think they are working with the nosis chain to to to test the feature out um other than that I think maybe uh fleshbot their their new product SWA is also working on privacy feature too yeah all right uh thank you Nick thank you [Applause]
Automatic transcript — names and jargon may be misspelled.