The Art of AMM I Anton Bukov
ETHGlobal·Tue, Dec 9, 2025, 12:00 AM
Join Anton Bukov for a workshop titled "The Art of AMM", featured at ETHGlobal Buenos Aires 2025! _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 🇦🇷 *ETHGlobal Buenos Aires* This workshop is specifically for ETHGlobal Buenos Aires, a 3-day hackathon held November 21-23 at the Centro de Convenciones Buenos Aires, bringing together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! Watch the full ETHGlobal New Delhi 2025 playlist here: https://www.youtube.com/playlist?list=PLXzKMXK2aHh76O7FfAHPJkZcqTIfYpoyf _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ✅ *Follow ETHGlobal* X: https://x.com/ETHGlobal Warpcast: https://warpcast.com/ethglobal Website: https://ethglobal.com YouTube: https://www.youtube.com/c/ETHGlobal _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Are you interested in Ethereum development and entrepreneurship?_ 👉 Sign up for the next ETHGlobal event: https://ethglobal.com/events 🎁 Get exclusive access and perks with ETHGlobal Plus! https://ethglobal.com/plus 📣 Want us to throw an event in your city? Tell us where! https://ethglobal.com/city
Transcript
I think we are ready to start now. So yeah, uh my name is Anton Bukov. I am co-founder of 1 in and I'm here to show you some amazing thing which are happening to AMMs nowadays. So I'll start with the question. What is capital efficiency?
So I found out that there are like tens of different research papers analyzing capital efficiency of different AMMs comparing them with each other and yeah they actually define this thing differently. Some of them define it as ability to attract volumes per capital. Some define as ability to earn fees per capita. Some do normalization like yield or other things. But at the end reading all those papers I realized that I do not understand what is capital efficiency and yeah I will help you to forget about this also.
So yeah and we came from other side we decided to check what we could spot and highlight as an efficiency. So yeah we just decided to start from liquidity pools IMM and we try to analyze how much of their liquidity is being really utilized during the swaps. So we just measured minimal amounts, average amounts taken into account deposits, withdrawals and we found out that significant share of liquidity in the hugest AMM pools is not leaving the balance. So it's sitting idle but what for the most of the time so maybe a few times a year it is being participated but those numbers are for 90 percentages of the days in this year so yeah I think this is an efficiency but what this liquidity is doing there why it's sparked in those pools so yeah the thing is that is it is being partially used but not being utilized. It's defining the price curve.
So prices are based on this liquidity. That's true. But it's not participating in the swaps. This means that it is not actually producing or generating you trading fees. It's not okay.
Let's let's move on to what we could see as more inefficiencies here. That's how classic AMM pools works. Liquidity provider provide liquidity into set of pools covering different payers ranges different parameters. And yeah, if you would try to provide your liquidity to tens or hundreds of different assets, it's easy to notice that you have to fragment your most liquid assets like USDC, wrapped ether, wrapped bitcoin. they are the most liquid in DeFi and you have to fragment them to provide liquidity to long tail of assets.
That's very inefficient because it's uh less likely this liquidity will be ever utilized properly. It will be underutilized in every pair. So that's also inefficiency high fragmentation for liquidity provider. One more inefficiency here is that this liquidity is being locked in the pools. But what I mean on the word locked, you see it have red locks.
Red means bad. So actually being locked means that this capital is being restricted in its functionality. It can be only used for transferring during swaps. So takers can transfer them in and out but any other defy functionality is disabled. Pools do not let you do anything with your capital.
I would say it's defy disabled. That's one more inefficiency. So I highlighted three inefficiencies now. Idle liquidity, fragmented liquidity and locked liquidity. And we tried to solve it with our new architecture 1 in aqua which is being shared liquidity layer protocol.
We provide new approach. All liquidity is being parked in liquidity provider wallet. You see it have lock which is open which is green. Green means good. So yeah, all those AMMs they can get shared access to the same liquidity to use it on demand when taker is willing to swap.
And if each of those AMMs will be underutilizing the same liquidity and the same manner what you saw in the previous slide, combining multiple strategies, you could achieve much higher capital utilization. And moreover this capital is unlocked on your wallet. This means it is defy enabled. I have more slides about this. So how exactly aqua is working?
I have very nice visualization here which our art director drawn for me. So yeah you could see that maker have some assets on their wallet and maker could also define virtual balances per strategy. These virtual balances will be stored inside of Aqua. And yeah, whenever taker is coming to AMM to make a swap, AMM can get access to those virtual balances dedicated to specific strategy can compute swap amounts based on these virtual balances and then MM can use pool and push interface to get access to those funds right from maker wallet. pulling assets from maker wallet makes uh those virtual balances decrease.
Pushing balance makes it increase. So initially amm could get access to like initial balances but whenever it's changing balances it can get access to everything what was brought there. So for example it could pull all USDC here and push a lot of wrapped either at the next phase. it could pull wrapped either and push a lot of USDC. So this AMM is working within balances which is being accounted by Aqua.
That's actually think how maker can dedicate different virtual balances to multiple strategies and Aqua would be like an security layer for AMM it's settlement layer and balance accounting layer. Second feature well like two features like first is your liquidity could be shared among positions and second feature is that it's unlocked by unlocking your liquidity you're making it defy enabled this means that you could vote in DA with your tokens oh nice you could participate in v tokenomics you could play around with other defy stuff your tokens are providing to you finally And moreover, you could play around with different DeFi protocols like money markets. I have slide about this. You could like leverage your liquidity or you could borrow from money market on demand if you're willing to build such position. So, how you could leverage yourself with money market?
You could turn your 1,000 bucks of liquidity into 3,000 bucks of collateral and 2,000 bucks of depth. So you will have tokenized collaterals. You can't withdraw them. If you would try to withdraw collateral, money market will check if you are if you deserve liquidation and they would just revert your transaction. So yeah, you should keep collateral in the same wallet where dep is.
But here you can put your tokenized collaterals. For example, in three different pairs of liquidity and you would get like 6K of virtual liquidity, you came with 1K got 3K by unlocked assets by using money market. You get you got like 3x amplification and you also got two more X amplification due to shared liquidity feature. Those capital efficiencies are being compounded with each other. You could dramatically increase amount of liquidity of yours.
You could have in money market you could have 5x leverage and five tokens can be provided in like 10 different positions. So you could get like 50k virtual liquidity. That sounds insane but yeah the only thing how we should support this Aqua itself supports it natively without any additional piece of code no line of code but AMM itself to fully support this use case they should support plug for taker which would make it first push liquidity on maker wallet and then pull because you can't withdraw 1k liquidity from this it will be reverted. Money market would not let you withdraw 1k liquidity. You will be not really over culturized as it would expect.
But yeah, if my if AMM would support push and then pull, then yeah, you could trade here any amount. So what is capital efficiency? Now I think we are redefining this meme actually. I think it's no more a protocol metric. It's metric of liquidity provider effort and risk appetite.
It depends how much liquidity provider is dedicated to supporting their balances above zero. If you want to spend like once a month or once a week, you could have some leverage. But if you are like really dedicated to this and do this like every hour, yeah, you could be probably 10 times more efficient. So yeah, capital efficiency is not a protocol metric anymore at least for AMMs. So yeah, there was a conception of toxic flow and I would like to redefine it.
I would say that no flow is tax toxic anymore. It was called toxic because people decided that they can't earn on toxic flow. Toxic flow is like arbitrage volumes. Imagine no one is sending you volumes you in worst case you was you would get arbitrage volumes for sure and it was called toxic floor but for me if you have AMM and price went somewhere and you was arbitrageed and then price went back and you was arbitrared again only arbitrage volume at the end you have no impermanent loss but you collected fees nice you earned but on toxic flow how is that possible yeah that's possible But yeah, toxic flow usually means that your earnings are less than the risk of impermanent loss. So yeah, I think with this share liquidity and unlocked utility leverage, you could earn even on toxic flow, even on arbitrage volumes.
But I would like to redefine it would be much better to talk about volumes on chain as a fair and unfair volumes where where fair volumes means that these volumes are deserved by your protocol by the prices it's offering and whenever someone is trying to use every liquidity provider every liquidity source like DEX aggregators solvers networks they're optimizing exchange rate for taker They are incentivized to consider every opportunity on chain and they usually distribute their volumes fairly. That's what's a fair flow. But unfair volumes is something like using unfair competitive advantage. When you sending all your volumes from your wallet or from your website to your own protocol or some protocol without considering other opportunities. This is definitely unfair volumes.
I would say if you would check fair and unfair volumes for a long period of time. We're going to build analytics for this but not yet. Uh it is being more and more fairly distributed. I see more and more confirm confirmations to this fact from different analytics. But yeah, we are going to summarize this at the end.
So yeah and here we end it with Aqua. Here we comes to next section of my presentation. Aqua is defining a shared liquidity layer protocol. This is a layer for others to build on top. This is a layer for AMMs to finally compete with their formulas, not with TVLs.
no more lock liquidity. So we tried to build our own AMM. We spent some time building different models and in the end we somehow came up to something really cool. I'm really happy to present you this new architecture. It's called swap VM for a reason.
VM means virtual machine. But yeah, it's not competition to EVM or Salana VM or any other VM. It's name of the architecture. This means that this program operates subprograms which we could call instructions and their model and composible. These slides visualize what it actually is.
It's like a swap leg. You could define your swap strategy for AMM but not only AMM. It could be for anything what could be considered as a scope like Dutch auctions, TVs, DCAs, whatever. But here is example for AMMs. We're talking about AMMs.
You could decide which invariant, which swap formula you're willing to have. I'm starting from bottom. Yeah. Then you could define the flat fee you're willing to charge or it could be progressive fee or any other instruction fee which you could write on your own or this could be a concentration you could be willing to concentrate your liquidity within some range or maybe limit it from one side only from another side it's also possible and yeah the other thing here decay spread is something like when swap is happening swap open back direction doesn't start immediately from improved price. It starts like a Dutch auction trying to sell it to arbitrage traders and since it's Dutch auction price is more favorable for liquidity provider and yeah those instructions are composable to each other they can be enabled and disabled and yeah different options could be provided but why we call it instructions why it's swap VM it could be like a one piece of code with a lot of conditions No, it isn't.
Every instruction is a separate function and those functions are being executed one by one and they are only possible because of the data model which we invented. This data model is swap registers. It's four registers. It's balance in and out amount in and out. This visualization shows that balances are actually balances of token in and token out.
In means this token is being uh sent to maker. Out means maker is spending this asset and balances are obvious. This is like virtual balances from uh Aqua for example. Yeah. And one of the amounts is defined by taker.
They taker could either define amount they willing to spend or amount they willing to get. And the whole idea of instructions is to finally compute the missing amount. When both amounts will be computed, they will be non zero. This means that this is something what should happen. So those instructions they only taking care about computing the missing amount.
I have few examples here of instructions. How do how does they work on top of this data model? The very first and very obvious one is constant product. It makes sure that the balances multiplication before swap and balances multiplication after swap matches. So yeah, it's only checks which of the amounts is missing and computes it basic based on simple formula.
It's pretty simple to derive it like few lines of code for sure. And this formula does not have any fees in it because we have a separate instruction for flat fees. But this instruction is a little bit more difficult than we expected originally. You could check it in the code. I don't have it in slides because I don't want to like dig deep into flat fees.
Sounds simple, but implementation was a little bit tricky because we tried to make it symmetric for exact in and exact out. We don't want one of the exact swaps to be more favorable than another one. This would make another option to swap uh nonsustainable economically. So we will I only have simple instructions here as examples like concentrated liquidity. Yeah, want to see it.
Okay, that's it. To have concentrated liquidity, we only have to increase balances by some deltas computed offchain. There are cool formulas to compute those deltas. Yes, it's easy. You can do it with a with a school math.
But the thing is that for smart contract those deltas are kind of constants and yeah your real balances would walk on the bottom line. It will be naturally preventing you from getting out of the range by draining the balance virtual balance. Meanwhile, virtual balances which were increased and which were used for constant product formula, they would work on this invariant. So idea was that if we would just increase balances then constant product formula would try to spend too much balances during trading and the idea was to find constants which would increase it that way that when it will it will spend all the balance you will reach the desired price range. It's a bit tricky that if you would try to collect fees, this range will increase actually.
But yeah, it's also manageable. We have two instruction for this. One instruction is growing in price range when collect fees. Another instruction is growing in liquidity, maintaining price range. We have a little bit different name like XYC concentrate grow price range and grow price grow liquidity.
So yeah the only thing is different for maintaining range is that after collecting fees after computing swap amounts we readjust those deltas by invariant increase. Invariant is multiplication of balances. So we check new multiplication of balances we check old balances and then we easily get how to readjust those deltas multiply by one and divide by another. So yeah, this was easy and yeah, one more instruction here is for Dutch auction. So yeah, it's actually starts it's like uh chart for balances and it starts where red line starts and some swap happens and where real balances are where blue line starts.
And what happen next? When you try to swap into opposite direction, it does not starts where blue line starts. It starts on the old place where red line starts and then red is like a virtual balances which are trying to go to real balances and at some point arbitrage happens. I'll show you here it is arbitrage swap. So it's being computed via virtual balances where red line is but being also applied to real balances.
It's the same swap and then again virtual balances are trying to reach real balances and at some point are arbitrage happens. Yeah, you see it. So yeah, this continues until virtual balances matches with real balances. Yeah, and this would be more efficient for liquidity provider. liquidity provider is not giving away this arbitrage opportunity but selling it with Dutch auctions where arbitrage traders compete with each other and yeah we we implemented this thing originally like 5 years ago it was project called money swap and we saw that liquidity providers earning increased two times meanwhile arbitrage traders profit decreased like 10 times because at that time they were earning pretty comparable amount of money arbitrage traders and liquidity providers.
So now you could use this instruction as part of the logic of your swap program swap strategy and now this instruction is also composable with concentrated liquidity. So yeah that's final information for builders. If you are willing to build AMM, we're giving you new way to have this. For sure, you could build your own AMM on top of Aqua. It's permissionless from Aqua point of view.
AMM is just an address which can use their APIs, balances, pull and push. But you are also enabled to try to build AMMs by building instructions for virtual machine. This means that whenever you want willing to develop AMM, you are actually coming with a cool formula. You you you came with your secret source. But previously you were required to make a lot of things.
Write code for deposits, withdrawals, balances, shares, accounting, swap, settlement. Yeah. You had how it's called code level composibility. He was able to use any code you can find online according to his licenses. Yeah, but yeah, what swapvm offers you, if you would be able to implement your secret source logic as instruction on this data model, you would effectively avoid avoid writing a lot of code and your instruction will be composable with some other instructions, not with every instruction, but with some of them.
So yeah, it's definitely possible to compose programs which makes no sense with those instructions. But yeah, you're developers and you can write programs out of those instructions which make sense. So yeah, understanding those instructions how they work and maybe paying attention to their names in the code would give you a clue how which of them are composable which with each other. Some instruction are single directional, some of them are birectional like for AMM. So yeah, I see a huge opportunity to build in this specific space now because there is like a possibility to compete on absolutely new level.
You don't need to compete for TVL anymore. No more locked assets. You can compete with your formulas for specific market. You could try something interesting. You could try to find something interesting where your formula would work perfect for some specific market, specific pair, specific range, specific nature of order flow.
the more it would be beneficial for liquidity providers, the more efficient it will be making the market for takers. So I hope to see this AMM market pushing like really forward for efficiency and be much more efficient than traditional finance in a few years. Thank you. We have time for questions. Hello.
Uh, so I was on I think I came for the session on Monday, but I still have a few questions. So when you're implementing like the op code, you say you do not need to have deposit and withdrawals, but how you going to essentially match the takers and makers given a swap VM instruct?
Yeah, I think I got the question. Yeah, the question is taking care about takers here. Yeah, the thing is that takers are getting smarter and smarter. actually takers nowadays are dex aggregators solvers networks which are considering all the possible opportunities aqua itself is doing nothing for this it's a settlement and accounting layer for AMMs it's a business of a taker to take care of which liquidity sources positions strategies to use because takers are optimizing their trades for the best price. This means that they would be considering every opportunity.
We have 1 in aggregator. We know how it works and we are already dedicating our volumes to these positions. Whenever these positions will be appearing, we will be using them to improve exchange rate of every trade. So yeah, but even like if you would not believe me, uh anyway you would get arbitrage volumes and yeah for sure there is like a direct incentive incentive for every solver for every DEX aggregator to integrate every position because the more positions they have the better prices they could offer for takers. They're very incentivized and we have to do nothing with this on aqua layer.
Thank you.
Uh one more question. So the maker USDC web rep bitcoin accounted as like ERC 4626 vault or like so for example if it's on a or 4626 like how uh would you program like uh a series of op codes to withdraw liquidity and and trigger like the trade on Aqua.
Yeah. You you asked if those uh assets will be involved which are 46 to six. Yeah. or even like on RV like how would the up codes look like?
That that's interesting. Uh I'm I do not remember if this ERC is compatible with ERC20 if it's shares are tokenized or not but if it is tokenized yeah I think this would work. Anything what looks as ERC20 would work here. NFTTS also probably would work, but I'm not sure it makes any sense to have AMM with NFT here. Yeah, but yeah, you can make limit order AMM if you are willing to.
Hello, I just wanted to ask, would it be possible to find AMMs across different chains with Aqua using the same assets?
Uh, no. No, nothing related to crosschain here. But yeah, regarding the chains, that's actually a very good news that every chain would be getting a much deeper liquidity with Aqua and Ether the mainet liquidity will be infinite deep. Thank you. Uh hello.
Um, I read the the white paper and it said that once you put the the position that you open the virtual balance is not being tracked afterwards by Aqua. Is there any way to to make it trackable because that will make you lose some trades if it's not being tracked or like
Yeah, that's actually I think like a two questions. Yeah, what would happen if you have not enough balance for the swap? Yeah, takers will not be able to provide you volumes. You will be like in an illquid state and for everyone who is in a liquid state, I would recommend close illquid positions first and then refill your balances. But even if you would refill balances without closing those positions, you would uh experience immediate impermanent loss.
This is not uh something good because it's like arbitrage traders earning on you. But this is impermanent loss. So it's manageable we can and you can work with it. And from other side from the taker point of view it this problem is very similar to limit order protocols which are currently running on chain. The thing is that you could have limit order with balances but you can have no balances on the wallet.
is still take your business to recognize this and not to drive volumes to not get reverts because when Ako will try to pull it will call ERC20 transfer from and it will just revert due to not enough balance and it's business of taker to not fall into this trap. So yeah we are running aggregator and we are taking this into account and other solvers and tax aggregators will do the same. But the the taker will think that there's balance because of the virtual balance. But when he actually execute the transaction, it will fail. Or am I missing something?
Yeah. Yeah. But takers are getting smarter and smarter. All those solver networks, they understand how those things working. So they're not just quoting and swapping.
They have deeper understanding of this thing as we are and as others do. They read documentation. They understand how it works. it maybe like in the first integration they would see something went wrong they would analyze and do this I mean that's inevitable for them to understand and take this thing into account but initially when they will approach this they may face some problems for sure but yeah that's like debugging and understanding of the protocol anyway takers are getting smarter for the past five years
thank Welcome. Okay, thank you for the questions guys. I will be still here for some time. Uh not here but uh near the booth. So yeah, if you have additional questions, you can meet me or my teammates and ask them.
Yeah, you can ask questions online. We also have this workshop recorded uh earlier this week. It's available on YouTube. 1 in on YouTube. Yeah.
Thank you.
Automatic transcript — names and jargon may be misspelled.