

Editor's Note: This article comes fromChain Academy (ID: gh_16a912371734), Author: Blockchain Robin, reproduced by Odaily with authorization.
Chain Academy (ID: gh_16a912371734)"exchange", Author: Blockchain Robin, reproduced by Odaily with authorization.
Today, Uniswap is the biggest one on DeFi
exchange
. Its daily transaction volume exceeds that of most centralized exchanges. Uniswap has revolutionized DeFi, bringing in billions of dollars in trading volume and sparking a revival of AMM (Automated Market Maker) designs. In my previous article, I explained how Uniswap works and why AMMs dominate DeFi trading volume.
But I believe that Uniswap will inevitably be subverted.
I know that statement is bold. So what will happen after Uniswap?
To understand where this market is headed, it is important to first understand the four key features that Uniswap bundles together.
Decentralized stock supply
consistent offer
Constant product pricing function (x/ y = k*)
If you look closely at each of the constraints, you'll see that once you unpack this bundle, the design space for on-chain market-making opens up.
Decentralized inventory supply
Your new pool can collect a mixture of REN and ETH from anyone willing to give it, capitalizing its balance sheet. Then, if the pool is profitable, these investors can later withdraw proportionally back the remaining reserves and generated profits. That's painless decentralized fundraising - it's awesome and makes perfect sense."liquidity provider"image description
Uniswap's reserves come from investment capital"liquidity provider". Source: Uniswap"but if you take off"cool cypherpunks
glasses, put on
Market making business
glasses, then you'll find that weird. What promising market maker would sell all their equity in exchange for reserves?"In the normal world, most profitable market makers are debt-funded. Think about it, if you can reliably earn a 20% market making ROI, you might want to finance it by taking out 10% a year in loans and keep the profits for yourself. But Uniswap is not keeping any profits for itself, at least for now."Suppose you know that the AMM pool you are about to create will be very profitable. If you're rich enough, you can create a pool, fund it all with your own money, and then lock the pool so it doesn't allow decentralized fundraising. It just makes sense, doesn't it? Why would you want it to give equity to anyone if you knew it would make money?
In fact, such an AMM already exists: look at this DAI/USDC AMM, its liquidity provision needs to be approved, and only the 0x team can approve it. The use of this AMM does not change its core value proposition at all. This AMM still does not allow transaction price, still uses the pricing curve on the chain, and has the advantages of all standard AMMs. It's just that it doesn't accept reserves from anyone other than the 0x team, so profits are kept by them alone. Balancer also supports
This intuitively makes sense! If you knew you had a profitable market making opportunity, why would you give it away? No normal market maker would think that way. Even if the market maker wants to raise more inventory, selling equity in exchange for inventory at a ratio of 1:1 is crazy. As long as the market makers really have a clear advantage in the market, they will have an incentive to keep the equity for themselves.
charging mode
Keep this in mind as we'll come back to this later.
charging mode
The next element Uniswap bundles is the fees LPs earn on each trade. I discussed this issue in detail in the previous article, so I won't repeat it here.
image description
How impermanent loss scales with fees in Uniswap. Source: Charlie Noyes
secondary title
consistent offer
There is also the always-on nature of Uniswap. No matter what the circumstances, Uniswap will quote you a price. In order to maintain this characteristic, most AMMs will let the tail pricing go to infinity (note the gradient line at both ends of the curve).
image description
Uniswap's constant product curve. Source: Dmitriy Berenzon
As long as it has reserves, these AMMs will not stop making offers. This gives confidence to Dapps plugging into these AMMs that they can transact on them at any time. But it's a weird thing to always offer quotes, promises - no normal market maker will promise to offer quotes anyway!
Consider Black Thursday. Most market makers are pulling orders as crypto markets melt amid historic volatility. They don't know what's going on and don't want to be run over, so they hide from the market and liquidity dries up. This is bad for everyone else, but really good for market makers who can manage risk.
Obviously, such a modification would break Uniswap's x * y = k invariant, since pricing would need to be reset somehow once market makers were turned back on.
But please understand what is meant here. These are the different dimensions between Uniswap and fully intelligent market makers. To the extent you can mimic the behavior of a common market maker, you may be able to increase your profitability.
This leads back, naturally, to the most important part of the Uniswap bundle: the pricing function.
secondary title
Unchaining Uniswap Pricing
In a previous post, we talked about how protocols such as Curve, Balancer, and Foundation achieve different pricing curves. But the universe of pricing functions is much more than curves.
Right now, almost every AMM pricing function is a continuous curve with the only input being the number of assets in the pool. We call these pure pricing functions because they do not require observation of anything other than contract inventory. However, there are also a whole bunch of impure pricing functions!
Here's just one of them: imagine a pricing function that peeks at prices offered by Uniswap and Curve across contracts, and then nets them down by 10 bips. (Depending on how you operate, this will be manipulated by flashloans, so you need to design it carefully.)
(Coinbase oracle is a free signed price input, which can be cryptographically verified by Coinbase’s public key and updated every minute. Therefore, if Coinbase’s mid-market price is 387.80 USDC/ETH, then if you put the currently signed Coinbase If the order price is sent to the blockchain, it will charge you 387.80 * 1.005 = 389.74 USDC. It can fulfill the order at this price until its inventory is depleted, or it can do something when the inventory is depleted. a gradual price reduction).
These are just a few thoughts off the top of my head. It should be noted that both of these proposals are premature, but workable in principle. But these two solutions are strictly speaking inferior to a specific pricing function, which I guess will account for the vast majority of future DeFi spot transactions.
One of the most disruptive pricing features will be a simple signature-based pricing feature. This pricing function will serve as a bridge between DeFi and CeFi; it will turn DeFi into a shadow market for all liquidity in CeFi."secondary title"Signature Based Pricing"39,Today, if you want to trade with a regular OTC desk, this is it. You make this request to the trading desk:"Hey, I want to exchange my 100ETH for USDC
A price will be given at the counter"900 USDC. Take it or leave it."If you like the price, you execute the trade. A significant portion of crypto trading volume is executed this way via OTC desks every day.
Imagine that instead of trusting the OTC desk and signing a legally binding OTC agreement, the OTC desk just gives you a cryptographically signed quote
39900 USDC for 100 ETH
. All of its reserves are sitting on-chain, ready to execute the trades it quotes you. If you like the offer, you submit it to their on-chain smart contract. The contract verifies their cryptographic signature, then uses their on-chain reserves to fill the order at that price."It's the exact same experience as the OTC desk, except it's fully programmatic. You just go to a website/API, request a quote, and you send the quote to their smart contract to execute the trade. I'm talking about sending an offer, but really you just click a button and click through a single Metamask popup, just like Uniswap."This contract is almost exactly the same as Uniswap, except that you tear off the pricing function of x * y = k and replace it with signature verification. If the signature is verified and the offer is valid, then it automatically executes the trade on its inventory. A quote may only require a few parameters: a transaction pair such as ETH/DAI, price, Ethereum block number, number of blocks for which the quote is valid, and then a signature.
this
OTC desk
It is an AMM. But unlike Uniswap, this AMM can use whatever pricing functionality it wants. It can look at other on-chain liquidity and sell at a low price, it can look at Binance or Coinbase order books, it can use fancy ML and Twitter sentiment analysis or track traffic on blockchain exchanges, when the market is crazy, it A quote can be stopped or its spread removed to reduce losses. It can do all the messy, complicated things that normal market makers do! And if the contract's stock is insufficient, the market makers can recapitalize themselves.
This market maker is centralized, but for its customers, it is atomic and trustless. Even if the market maker gives you a bad price, just don't submit it on-chain! Don't trust anything in this scheme anymore.
In fact, this market maker could even solicit funds from decentralized LPs if it wanted to! Of course, centralized market makers can scam their decentralized LPs out of their money by giving themselves an offer that will All funds stolen. Although, many token projects raised from decentralized LPs are already like this - the founders can run away with the money. But you can mitigate this with trusted hardware like Intel SGX, pre-committing to an off-chain pricing algorithm whose execution can be verified on-chain. This makes fundraising trustless for both LPs and clients.
But this is science fiction for now. I expect the first version to be self-funded by market makers who already have off-chain systems generating quotes. This would allow current market makers or OTC desks to trivially set up systems to accept DeFi order flow.
But wait, why wouldn't someone just grab a signing offer, sit back and wait for the market to move, and then 20 seconds later, if the price suddenly moves in their favor, execute? In a sense, isn't this AMM constantly writing free options?
Yes, it is! Just like any off-exchange quote or order on the order book. You can imagine this AMM using behavioral signals from Ethereum addresses and IPs to give better offers to high-trust buyers and worse offers to offer-badgers. Alternatively, you could set a decaying price offer so that if a user wants a long-term offer and stays on it for too long, the offer gets programmatically worse.
Imagine that each market maker can set up its own API by deploying a standardized contract and template software, thus establishing its own small market. Each contract will have a configurable IP pointer so users and matchmakers will know where to check the current price or request a quote, and once their standardized contract is deployed to mainnet it will be automatically indexed by the matchmaker. Market makers anywhere in the world can set up their signboards and within minutes, like magic, start serving DeFi traffic.
Come on, come on all the DeFi markets.
Of course, due to regulatory reasons, many market makers cannot do this. But you don't need as many market makers involved to get the net effect here. As long as there are a few well-capitalized market makers running on DeFi somewhere in the world and competing with each other, they can bridge price and liquidity between centralized exchanges and DeFi."We know that order book exchanges will ultimately be the most efficient form of trading and price discovery. But right now, it is too expensive to replicate the order book on-chain. True DeFi market makers will be the bridge that exposes DeFi users to the world of centralized order book liquidity. It’s almost as if order books are hosted off-chain on centralized exchanges, and DeFi becomes a shadow broker — a trustless front end for all the liquidity in the crypto space. Prices, assets, and liquidity on Binance suddenly become available to anyone in DeFi."Kyber Network sees this too and adopts what they call
Fed Price Reserve
(FPR), which is essentially an interface for professional market makers to buy and sell to Kyber users. So how does Kyber do it?
secondary title
Kyber's professional market-making function is as follows: each market maker has on-chain inventory and on-chain orders, as well as slippage function. As long as these menus are on it, anyone is free to buy at these prices. Each market maker has to update its own on-chain order book as the market changes.
For example, I am a market maker, and my on-chain order currently says 1 ETH / 300 DAI. If the ETH/DAI price moves to 1 ETH / 320 DAI, then I submit an on-chain transaction to update my order. If I don't update in time, or my update gets stuck during periods of high congestion, my past tense prices get picked up by arbitrageurs (of course, any of my menu updates are likely to be front-loaded immediately). Due to the problem of gas fees, this practice of continuously updating menu prices means that I must bear continuous costs and risks in order to continue to provide orders. That's the problem with free options, but three-dimensional.
Even with this design, professional market making on Kyber is exploding! Currently, about 2/3 of volume on Kyber is routed to professional market makers.
image description
Kyber volume sources for June 2020. Source: Kyber Network
Having said that, I understand why Kyber is designed this way. Kyber wants its smart order routing to be entirely on-chain, which requires its prices to always be on-chain. But with gas fees so high today, putting these computations and prices on-chain would just result in a higher net fee for the end user than the signature-based scheme above.
If even a few market makers set up shop in DeFi and started offering programmatic, permissionless offers, they would become more competitive than simple AMMs. Over time, normal market makers will win nearly all of the retail traffic, which will make most AMMs primarily arbitrageurs volume.
This is not just theoretical. It is already happening.
secondary title
aggregate market maker
1inch is a DEX aggregator that routes almost 20% of all DEX volume, and they already route a significant portion of their orders to private market makers.
This gives these orders better price execution than every single form of on-chain liquidity. It’s not as simple or elegant as Uniswap, but it’s also trustless, and it will bring better price execution to nearly all users of DeFi.
The net effect of this is that liquidity is commoditized. Aggregators will be the front end of DeFi - they will have users - and on-chain market makers will compete alongside AMMs.
The future of DeFi
Fully algorithmic AMMs will always have a place in DeFi. They will be critical for contract fillable liquidity, and they are amazing for bootstrapping liquidity for incentivized pools and long-tail assets. But most of the trading volume in cryptocurrencies has always been power-law distributed in the core trading pairs. Almost all the traffic on DeFi today comes from retail investors buying and selling conventional assets from one interface. I expect the majority of DeFi volume to become dominated by professional market makers through such a mechanism."secondary title"
The future of DeFi
I could have to check which exchange has this token listed, see which exchange has real liquidity, transfer my ETH over, and then trade, but this is extremely troublesome. I bought it now with just a few clicks through 1inch, and to be honest, the price is pretty good already."true decentralization"This was a revelation for me.
People won't trade on DeFi because it's
true decentralization
, or because they prefer non-custodial transactions, or any of this crap. People do it because they are lazy.
Once DeFi becomes a brokerage that can fill huge volumes of trades on almost any asset with minimal slippage, it will start to look more and more attractive compared to centralized exchanges. For users who are not actively trading but just want to buy and hold some cryptocurrencies, using DeFi will look as good as using a centralized broker like Coinbase.