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

Loading player…

Weiroll: A Unique and Powerful Primitive for DeFi | Colin Platt - Makina

Ethereum DenverMon, Mar 9, 2026, 12:00 AM

Speaker

Colin Platt

This session will focus on how Weiroll (https://github.com/weiroll/weiroll and later modified in https://github.com/EnsoBuild/enso-weiroll), an open source initiative, creates a powerful primitive for DeFi interactions, including in building and maintaining vaults.

Transcript

Hi. Um, welcome. So, Colin Platt, I'm product lead for Machina. Um, very quickly about Machina. So, we are, uh, DeFi execution engine.

Uh, we build institutionally focused DeFi vaults, helping bring larger institutions on chain. Um our core insight really when we started building Machina was around how these uh current vault uh ecosystems were not really built with the minds of institutions. We're seeing kind of a move from investors going from more of a retail scale to uh larger high net worth individuals even beyond that. Um and we wanted to enable tools that could automate those workflows, bring more risk controls, bring crosschain risk controls, uh and help people better invest. One of these ideas that made it possible and what I'm going to talk to you about today is Wayroll.

Um, so Wayroll is a really unique um, composability engine um, that brings a scripting VM onchain. And if my slides work here, that'd be even better. So, um, when we talk about DeFi, uh, when we heard about DeFi in the early days, it was all about composability. We heard about DeFi Legos a whole lot. Um while very cool and kind of the superpower of DeFi uh it does present a few challenges especially when we bring this into smart contracts we bring this into vaults we really have two options uh on the table currently with the existing infrastructure we can either have custom smart contracts so adapters uh if you're familiar with how urine works uh VA or other uh technologies or we can have multiple separate uh transactions so this is going through doing one after another executing each one of course uh if we go with the first option uh that requires us to build new smart contracts every time we want to integrate anything potentially we need to go through a whole new new audit cycle this can cost a lot of money take a lot of time that opportunity may be gone by the time you're you're up and ready to run the second is if we use the existing tools and do things sequentially well we faced more gas costs uh race conditions potentially uh and no atomicity this is really problematic especially when we're trying to unwind things if we're going into looped uh contracts if we're trying to pull out of loop contracts it may just uh take a lot more time.

If we're in a hurry, uh if we're worried about getting out of something ahead of an attack, this could cost a lot of money over time. So, if we take kind of a simple example here and we want to work across protocols, um say swap ETH USDC, deposit that in Pendle, take your PT, use that on Morpho, right now that requires several different interactions. With Wayroll, we can potentially bring that all into one uh by providing the scripting language. So everything's showing correctly. Perfect.

This scripting language, what is it? What does it come from? What does it deliver exactly? So kind of in short, uh you can think of it as a light lightweight onchain VM. What we mean there is a it's a virtual machine that allows us to put in different calls that can be chained together that can speak to each other within a single transaction passing inputs from one side to the other.

This is a little bit different than if you've heard of multiol, which is something you may have actually used without realizing you're using it, where you have independent calls that need to be pre-programmed in. The power of way roll and being able to bring that together in these dependent chains of commands is really allowing you to pass that information across and lock down and retain what exactly you're doing within that transaction. So, if you kind of think of this uh in this chain of commands we have on the right side here, um we have this light chain VM that we target. we pass an arbitrary call to contract one which passes information to contract two, contract three, so on and so forth. I won't jump into it exactly right now.

Um, but you can wrap these in permissions. Um, and having this all together in a single call rather than a multi call structure gives you the power to really have those controls that we'll talk about. So, Wayroll a little bit more in depth here. Um, where did it come from? It's been around for about 5 years.

It's an open source project was started by Nick Johnson of ENS. um as well as Dean Igenman who was a co-founder of dialectic who was one of our design partners um as well as a number of other contributors. It's essentially two different parts. Uh the first takes in commands and allows us to structure information around the commands and the second is an array of state. The VM itself is stateless.

The commands that we pass in can hold that state. It allows us to execute sequentially with inside of a transaction. It doesn't have direct support for fours and loops and that kind of stuff uh or if statements. Those can be added on through kind of external helper contracts, but they're not core to the VM itself. It's a sequential execution or a revert.

It allows us to do quite in-depth things. We can have up to 127 elements. We can pass in arbitrary bite length information uh dealing with the state next to that. Why is this important and where does this kind of take us? Um when we look into how we can pass this information uh it's as I said a kind of simplified lightweight VM allowing us to deal with really anything onchain.

So conforming to anything that has an EVM execution layer command that we can deal with. Obviously, anything offchain is outside of the scope of what we're talking about. We're allowed to pick the selectors against a target contract and pass in flags as well as input dealing with that state defining where it comes in. Because we can deal with anything on chain, it means we can integrate anything on chain. This is not just a specific thing that we're looking at.

This is something that any project can really integrate as a way of dealing with its onchain uh transactions. So we think this is extremely powerful and we think this will bring a lot more control potentially can prevent things like what we saw with bybit uh on on the back of uh safes where UIs were getting compromised u because you can lock this thing down and you can define exactly what happens and pass that information through in a very controlled manner adding white list adding blacklists uh to those transactions and controlling it exactly where it needs to go and only the information and only the types of information that you want to be free and available. Going into this uh we also have a lot of control about uh exactly how we pass it through. We can add more information about whether we're passing a delegate call in whether we're passing a normal call or just reading information through static calls because we can chain them together. Potentially you need to read complex stat static calls to pass in to your delegate calls.

You need to pass through value. Uh if we're dealing with something like wrapping unwrapping ETH, we may need to do that midchain. This information can also hold a lot of information that we saw earlier about flags uh that I was kind of alluding to. So the original version of Wayroll just had this uh tupe uh which allowed us to to also execute without decoding it through the machine. An extension to kind of give us more information around what we can do as well as these call types.

That wasn't full and complete. So we do need to talk about how that's extended. But first I want to kind of jump into the execution pipeline. Of course we're dealing with something that is a VM. you do need to do a little bit more more work and coordination before there are packages in Rust and and J uh JS if you're interested in doing that we can put this together in our term uh is done through instructions which kind of does that VM uh level interaction and then passes that through when we actually go to hit on chain we're decoding this on chain we're encoding the inputs into the machine and we're doing each one of these individual calls these call the output is decoded returned back into the subsequent all and this is really kind of that power when I was talking about how we chain things together and we have this dependence things can be precomputed but things can change before our simulation and our execution on chain and if we want to leave a longunning uh command out there and we want to just execute let's say when things fall in to range we may not beat that race condition and we'd want to revert if we're trying to do a swap within a different uh limit order this gives us the power to kind of do that revert backwards without killing the rest of the chain It allows us to do that onchain.

I don't know if anybody went to the any of these MEV uh on all let's say L2s um and other private uh chains. This gives us an ability to kind of reduce that gas usage because we don't need to constantly query and run everything to check it. We could do this more elegantly through something like a way roll. We also have um sorry um as I as I mentioned we also have a lot more uh availability. I am sorry that somebody is calling me in the middle of my presentation and it keeps buzzing.

Um we need to extend this because when we talk about the practicalities of DeFi um we talk about a lot more than just calling an individual contract with a selector and some inputs those inputs may be arbitrarily complex. So if we look at something like unis swap uh or curve that can take an arrays or different types of tubes that need um different information. Enzo kind of did another iteration on top of this adding information that allows us to define dynamic uh inputs uh tpples as well as arrays and this allows us to deal with virtually any contract out there just through these additional flags on top of that and that's something that really made uh what we're going to talk about uh with mechan possible we deal with arbitrarily contract uh difficult contracts arbitrarily difficult interactions uh with DeFi or it can be used outside of DeFi of course um and bringing that control as I said on a longunning basis defining what we do and do not want to be able to customize like we may have uh an instance where uh we can pass in commands for a set list of stable coins that can be swapped against ETH but not other stable coins and that could be defined through a single instruction so very quickly uh how do we use this how do we put this into practice um as I said kind of uh coming back to it it's a crosschain asset management protocol we can deal with anything EVM Using liquidity bridges, we plug in with a wormhole CCQ to kind of send information and what can and can't be verified across chains through L2 ecosystems. Um, and we solve essentially a problem that exists in the vault infrastructure, which is how do you get away from rigid uh inputs. Things change over time.

We need different strategies over time. We need to be able to control and not move from one free state to another free state. We need to make sure that it goes through a process. But we also don't want to force users to migrate every time they want to do something new. This is a lot of headaches for users uh to say I want to invest into this thing.

Now this thing no longer uh brings the value it did. I want to move someplace else. It's easier to pass something that has a little bit of flexibility within a controlled uh infrastructure as well as potentially moving across chains where new opportunities may exist. So we leverage way roll specifically to get there. We don't have custom adapters as I said uh because we can use way roll as our interaction interface and we control what can and can't be done through a separation of church and state effectively what we call operators which is our term for uh strategists or curators a risk management control that says what is and is not out of uh in scope through a simple Merkel infrastructure that checks an individual instruction that's being sent to way roll before it's executed allows us to read is this allowable and then passes those inputs into the way roll VM deployed on each chain that we work with executes that transaction and brings the value those positions back into the vault itself because we have that power to be able to do these things we can onboard and we can integrate much more quickly in a controlled manner we can ensure that we're not passing around information or potentially um positions and transactions are held in adapter contract that opens new services again as I said needs to be audited needs to be checked at each time we're firing through the same VM We can simulate those outputs.

We can see how those outputs will interact uh with the chain itself and bring that position back in in a secure manner that adheres to what institutional investors expect based on what they get from Tradfi. As I said, um we have a little bit different uh architecture. If I were to kind of show you this image that's in front of us, um machine our term for vaults will have lots of different adapters based on what you need to deal with. So if we go back to our original thing, talking to Uniswap, talking to Pendle, talking to Morpho would require three different interactions. This allows us to just target that lightweight VM on chain, pass those instructions in and talk to protocol 1, 2, and three.

The other power is because we can define this on mainet, we can also carry that through CCQ into L2s and say we want exactly this. That means that as soon as money is bridged over from our vaults on L1's into an L2, we can enforce that same level of risk and control without needing to rebuild the entire infrastructure without needing to rebuild all of those adapters and plugging into those. We simply put in the protocols live here, the assets live here, follow the rules in how we do it elsewhere. It's extremely powerful and extremely lightweight. Beyond EVM, uh hopefully this shows.

Um there's also some really cool things. I'm going to show you a quick demo here today. Uh we effectively use Hyperlid EVM. If those of you that aren't familiar with it, um Hyperlid has kind of two chains in one. Uh an EVM setup as well as their core, which is if you've dealt with the per uh protocol, they have some cool custom pre-ompiles that allow you to use the EVM layer with their core layer.

And what I'm going to show you today is just kind of a quick demo here of us using that uh pre pre-ompile in our controlled structure to execute per transactions directly on core. So if this plays, here we go. We can see on the left here, this is us passing information to the VM on uh hyperlid EVM. On the right side, this is a screen looking at core. This is taken about 10 days ago, so the prices are a bit higher than where they are now.

Um, we're going to go in, we're going to open a position uh with Bitcoin USD on core through the EVM layer against a Wayroll instance. Takes a second. We'll be able to see in just a second those orders come across in entering information about what we want to trade. Uh, different information that's passed in through a normal call data. We're on the EVM layer here.

Reminder information's put in. We can see the order open here on the right. So we've actually opened an order here directly on hyperlquid core from the EVM. We can control this in the same structure from the EVM. This allows us to potentially do things for the first time that EVM layer non-custodial vaults have been able to do.

We can do this directly where user deposits from mainet carry it across to hyperlquid EVM through a bridge transact do hedging transact do per um per spaces trading all kinds of things that open up new possibilities to get new alpha and bring that back to the users without them needing to move across chain without them needing to trust somebody else's deployments without needing to trust that the bridge on the other side receives it and does only what they've been instructed to do. We think this is extremely powerful in our uh implementation. We also think there's a lot of power for way roll well beyond this. Highly recommend people to check out some of these uh resources that I'll share in just a second. Um and uh talk to you a bit more about what's been done if you have time after this.

Um but just kind of recap way gas efficient lightweight scripting VM on EVM anywhere you want it. Enzo way role bringing that into DeFi reality machin we bring that together with vaults um if anybody's looking at setting up vaults operating vaults would love to chat with you that is that as well if you'd just like to learn a lot more about what's going on in the background or if you'd like to get uh in touch with me or find out more about Machina all the information is here highly recommend the resources we have and thank you very

Automatic transcript — names and jargon may be misspelled.