Hello everyone. My name is Caleb, I'm from 1inch, and today I'll be presenting the reimagining of AMM with 1inch Aqua. First, I will review the current state of DEX. After that, I'll talk about Aqua, how it works, and just walk you through the process. I'll talk a little about Aqua outside of AMM.
What can be done beyond a simple AMM, and I will also talk about the benefits for everyone: developers, liquidity providers, and traders. Uh-huh. So first I'll break down the standard AMM flow. So we have Bob, and Bob wants to provide liquidity. So he will simply transfer his tokens to the Uniswap liquidity pool.
This is a regular Uniswap pool. And Alice is a trader. This could be any of you with tokens, such as Ethereum. And Alice is going to interact with this liquidity pool. She will send her ETH to the pool.
And the pool will send USDC in response. And the pool changes its balance. Alice receives her USDC , and everyone is happy. Now, if Bob wants to get his LP back, let's say he needs USDC for something, he will have to take those tokens. From that pool those tokens.
From that pool . And after that, there are no tokens left in the pool. Alice cannot exchange anything. So, Alice still has her USDC. Bob has all his tokens.
And there is no more liquidity. And Uniswap no more liquidity. And Uniswap is not the only liquidity pool. There are also things like Curve and SushiSwap. So how does Alice or Bob know what to use?
And this is where 1inch comes to the rescue. So, 1inch is a liquidity aggregator, DEX is an liquidity aggregator, DEX is an aggregator. We review all these options and find liquidity for the trader. So the result is that with the aggregator, liquidity appears to be pooled. And DEX competition leads to innovative and better rates.
But every time a new AMM appears, contracts are reworked, storage, accounting, and settlements are re-implemented. So you have all these routers, all these AMMs, and more audits and a bigger attack surface. This is not very intuitive for traders. You also get liquidity fragmentation, and overall being a trader is not much fun. So, there are some disadvantages from the liquidity provider's perspective.
So, choosing where to make a deposit is quite difficult. Bob, as a liquidity provider (LP), sees Dodo, sees Uniswap sees Dodo, sees Uniswap , sees Curve, and Sushi. Each of them has its pros and cons. But he has no idea where to make the deposit. In addition, participating as an LP has a high opportunity cost.
Bob can deposit his tokens into Uniswap, for example, but he can't deposit them anywhere else. So in that respect it is limited. In this slide you see that Bob has tokens A and ETH, which he provides to Uniswap in this case. In this situation, he actually loses access to control. Because A is a management token.
He has no right to vote. In addition, the movement of funds is associated with great difficulties. You have to, you know, add them to the pool, remove them from the pool. If you are mining liquidity, it can only be within a certain range. So every time you range.
So every time you need to rebalance or change positions, it requires many transactions. And in general, this is not desirable for LP. So, back to Bob again. He can safely deposit his tokens. Since liquidity mining is active liquidity mining is active .
And as soon as the rewards stop being distributed, he will want to take the tokens, because there are no more opportunities. Therefore, he can find another opportunity on Dodo, because there he can earn more in commissions. So he will bring them in there. This is generally what LPs are looking for: opportunities LPs are looking for: opportunities , better commission collection, and things like that. And if he ever wants to access the capital again, he will have to withdraw it.
So new projects stimulate fragmentation and all the other cases I mentioned earlier. We already have all these projects, so what happens when a new one comes along, and then another one? How can Bob even decide where to allocate liquidity? The current model requires directed interaction with AMM contracts. Bob provides liquidity, and Alice, the trader, uses it.
So what if there was no smart contract between all of this ? Alice could trade directly with Bob's balances. This is where 1inch Aqua comes in 1inch Aqua comes in . In Aqua, liquidity remains in the LP wallet and is not tied to a single strategy. Calculations are always atomic.
You see atomic. You see that we have an architecture: Aqua router, Aqua applications, and custom strategies custom strategies . So first I'll talk about the Aqua router. It is just an 80-line smart contract that is responsible for three main functions. Deploying and connecting strategies, tracking virtual balances and token movement, i.
e. moving them out of your wallet. Aqua apps, uh, are implementations of swap logic. For example, a permanent product, Dutch auction Dutch auction , concentrated liquidity, as well as our Aqua strategies. These strategies are the commitments of liquidity providers (LPs) to Aqua apps.
For example, a perpetual product with wrapped ETH and USDC: one ETH or 1500 USDC; for example, concentrated liquidity—it could be USDT and USDS, thousands of each. So liquidity providers are contributing to Aqua apps. Ahem. This is the same slide, sorry, my mistake. Um, and in this case it's a traditional AMM, and that's how Aqua works overall.
So, first we remove the liquidity pool. In this model, there are no more, you know, swaps. Uh, we have an Aqua router. Bob will do the following: he will approve the use of his tokens for the Aqua router. He still believes that a permanent AMM product is probably the best for his token pair.
Therefore, he subscribes to the Aqua app with the permanent AMM product. Alice...Oh AMM product. Alice...Oh , sorry, first Bob will approve and allow Aqua router to collect and send his tokens.
After that, he will deploy his strategy. This is, in fact strategy. This is, in fact , his intention. Uh, subscribe to the app. Now Aqua router stores virtual balances and also broadcasts the state.
He says this is the strategy Bob subscribed to Bob subscribed to . An off-chain indexer can get this information about Aqua- information about Aqua- strategy: which tokens and which strategy are subscribed to. And if any trader, like any trader, like Alice, wants to make a swap, she'll get that information from the indexer, and from there indexer, and from there ...she'll take that data and request a swap. This is what will happen: Aqua app will check Bob's commitment and ask Aqua to withdraw tokens from Bob's balance tokens from Bob's balance .
So Aqua router will do just that if everything goes well. After that, the tokens that, the tokens are eventually transferred to the trader, after the Aqua app verifies that everything is correct. And after that, Bob still needs to get back his tokens received as a result of the trade. So the Aqua app will ask the Aqua router to send tokens to Bob's balance. So, the tokens are removed from Alice's wallet and sent to Bob's wallet.
And what do we have as a result? We see that liquidity providers can send staked tokens to anyone. Liquidity providers can still participate in governance as the tokens are stored in their wallet, and they can also reuse them in other Aqua applications and strategies. So, here is an example of token reuse . Let's say Bob has ETH, USDC, and USDT.
He has $1,000 each $1,000 each , for a total of $4,000. So, it can interact with the Aqua router. In this case, the ETH/ this case, the ETH/ USDC pair, at a thousand each, is approximately $2,000. He also has ETH that he wants to place a position for $2,000 position for $2,000 : again $1,000 in ETH and $1,000 in A. He can do the same with USDT, so Bob's actual liquidity is $4,000.
This is what is in his wallet, but his effective liquidity is $6,000 because this ETH is reused in every position. So Alice can trade this USDC. Tony can trade A. Craig can trade USDT with Bob. All at the same time, within the same AMM strategy.
What if two big deals happen in the same block? Everyone wants to buy ETH from Bob. So Tony and Craig compete, and whoever's transaction goes through first will make the valid deal. valid deal. Any attempt to exchange an amount that exceeds Bob's balance will result in an error.
Now let's move on to Swap VM. We've already talked about " already talked about " sustainable product" as an Aqua application. There are also concentrated liquidity and stable swap, which are also Aqua add-ons. Each of them is a separate strategy and a separate smart separate smart contract. We realized that this code is often repeated.
That's why we developed Swap VM. It combines all of this into single reusable opcodes. Swap VM is a kind of set of functional blocks for swap. You have price curves, taker limits, fees, decay functions. And so this is the example I want to demonstrate.
We have the Aqua app for sustainable production. You can see that this is quite a lot of lines of code. Whereas when using Swap VM for a stable product, you just define a few opcodes to say, "Hey, I want my tokens to be used like this ." So, Swap VM ." So, Swap VM is the building blocks of opcodes under the hood.
It can call external contracts to retrieve information, and you can also write your own custom opcodes. And the Aqua platform itself goes far beyond AMM. So, you can create prediction markets, privacy pools, flash privacy pools, flash loans, payment clearing, lending markets. Um, all of this can be done with uh Aqua. Here is an example of a flash loan.
Um, Bob can use the AMM strategy, but if he wants, he can switch to, say, a flash to, say, a flash loan or add it in addition to the AMM. And again, as before, trader Alice says, "Hey, I want to borrow some tokens. Here's the payload." The VM for the flash loan swap will check Bob's commitment. Bob's tokens will be withdrawn and sent to Alice or to the flash or to the flash loan contract.
The flash loan can execute the payload payload , and then the tokens are returned to Bob. So we see that Bob is subscribed to this flash loan, but he may also be subscribed to the ETHUSDC pool. It can also be subscribed to a stablecoin swap pool. Here, all of its tokens, in this case USDC, can be reused and subscribed to many different strategies. The impact of this on the DeFi market is that for liquidity providers, higher levels of fund utilization provide better returns.
If your tokens are in multiple strategies, they can be used multiple times. This is great for DeFi users as they get better prices. There is a lot of idle capital idle capital , so accessing it will be much more profitable for traders and developers. This is a faster way to launch. Swapvm is a set of proven formulas with guarantees, so you can build on them build on them without worrying about custody and redevelopment.
Now let's move on to the rewards. We have prepared several tasks for this hackathon. The first is tasks for this hackathon. The first is creating a new Aqua app. The prize pool of $5,000 will be distributed among the top three, and there is also a continuity track: if you have a finished product, you can integrate Aqua or Swapvm into your project; Prize pool— $2,000 for two projects.
Thank you for your attention. If you have any questions, please questions, please ask them. Question. We currently do not offer the indexer as a standalone product. You will have to use existing solutions.
For example, The Graph, Golden Eye, it seems, or others; You can come to our booth to discuss this in more detail. Yes. Therefore. applications must always be settled in i.e.
you cannot defer accounting schemes like B3 or, sorry, B4, or it must be the same transaction token movement. Um, that's not a requirement. The Aqua application can receive tokens and then send them later . Um, it's not necessary that receiving and sending occur. So you can do some counting when you temporarily get tokens and then return them.
Of course. So send them right away, just in case they get approved later. Um, not necessarily. It just depends on the strategy. This does not require any sending or receiving to occur at all.
But usually you get tokens for a specific purpose and then you can send them if, for example, you distribute fees back to the protocol. Any more questions? using flash loans is more of an addition to providing stable... Um, I mean, you can do it as long as you have tokens on your balance; If you subscribe to this flash loan strategy, anyone can view your balance and see what tokens they can temporarily receive. For example, self-liquidation, perhaps with esoteric assets or something similar, could be useful.
but no more than right. Yes, you can only receive as much as you have on your balance. So, I prevented this. Yes. In swapvm there is a function called called decay.
This opcode allows the price to approach a certain mark over a set period. For example, in a traditional AMM with a constant product, you might have a five-minute decay. This would prevent back-runs prevent back-runs , as the buy and sell price in the same block would be exactly the same. But after about 5 minutes it will get closer to the actual price, which is what the AMM should be. So you can't do a front- do a front- run and then back-run someone like you can with a traditional pool with a constant product.
You can also set the fade to, say, the Chainlink price or any Chainlink price or any other price you want to set. No, you can use an opcode and specify a price it should approach. Yes. For example, oracle or AMM price, average price. Yes.
Are there any examples? At a minimum, this is probably an interface for interacting with the Aqua protocol to see your position. This is what I expect. If this is used, I guess you want to see what tokens are distributed, maybe what exactly is happening, something like that. As for examples, we have some sample Aqua applications in the repositories.
We have documentation here. If you want to take a look at our bounties, there are links to resources below. We have Aqua application examples, swap VM application examples that people can use. So if you want to view the documentation, please go ahead.
Automatic transcript — names and jargon may be misspelled.