The Uniswap Market is Live on Aave Protocol!

Jordan LG
Aave Blog
Published in
6 min readMay 28, 2020

This is the story of unicorn meets ghost, a love story for the ages with a fairytale ending — the new Uniswap Market on Aave! The Uniswap Market is the second market of Aave Protocol, the protocol for money markets. We believe this new market will bolster DeFi composability, and this is the beginning of a new chapter with more markets to come.

Understanding Uniswap

Uniswap is a decentralized automated liquidity protocol where developers, liquidity providers, and traders can participate in an open financial marketplace. It is comprised of a series of “pair smart contracts” which each have their own ERC-20⇄ERC=20 pair. These pair smart contracts hold reserves of these underlying pair tokens. Anyone can be a liquidity provider for an ERC-20 pair by depositing an equivalent value of each token (for example: deposit 50% ETH and 50% DAI).

When you provide liquidity to Uniswap, you receive an ownership token in the form of a Uniswap Liquidity Provider Token (UNI), which represent the underlying liquidity you deposited, like Aave’s aTokens.

Introducing the Newest Aave Money Market: The Uniswap Market

Flash Loans have taught us how to reuse the so called “Locked Value” in DeFi. Staying true to our philosophy of innovation, the creation of the second money market of Aave Protocol will teach us how tokenized value across DeFi protocols can be used to grow the total market size of DeFi by increasing the stable coin demand while providing deep value to existing DeFi users.

New Markets

Algorithmic borrowing against liquidity provider shares is another DeFi-specific primitive brought by Aave to empower innovation within Decentralized Finance. Furthermore, enabling liquidity providers of DEXs to leverage their liquidity will greatly reduce decentralized exchange slippage, as the borrowed value from Aave Protocol can be deposited back into the DEXs.

The position of Aave as the protocol for money market creation is not only one of the fundamental building blocks of the upcoming LEND tokenomics, but most importantly it’s a stance on asset management and risk profiling.

As the diversity of asset types grows, along with increasingly complex business models and risk profiles, it became clear that the DeFi dream of having one market, one “decentralized central bank” for all assets which would meet all our decentralization needs, is neither sustainable nor scalable. What can be seen as “liquidity fragmentation” is nothing other than potentially huge markets still taking shape and optimizing for their use cases. It is the materialization of the resilient nature that DeFi aims to embody, resulting in a net positive for protocols which can adapt to their current and future context.

As a strong supporter and believer in tokenization of real-world assets and financial instruments, Aave Protocol aims to empower the existing and upcoming holders of tokenized assets through collateralization.

A peek at the Uniswap Market

DeFi is currently seen through a “primary issuer / secondary market” dichotomy with the like of MakerDAO and Synthetix as primary issuers and Aave, Compound and others as secondary markets. At Aave, our mental model is a bit different and we see a much greater number of DApps as primary issuers. Indeed, Uniswap can finally be apprehended as a primary issuer of tokenized liquidity provider shares and TokenSets as a primary issuer of tokenized trading strategies.

This understanding requires us to look at “primary assets” and “primary issuers” from a DeFi-specific angle and to try to fit them in the context of decentralization, market pricing, institutional requirements and the evolution of business models for those newly considered primary issuers.

In the last couple of months, the average rate on stable coins in DeFi has been quite low (especially if you are not using Aave), yet we’ve experienced a past growth of the Decentralized Finance market size driven by high lending rates. Therefore, by enabling UNI token holders to collateralize their position and borrow against it (while still earning LP fees) the Aave Protocol liberates the economic bandwidth of the Uniswap Protocol to be used in DeFi lending and increase stable coin demand.

Risks & Security

The Aave protocol has been built from the beginning with the idea of instantiating multiple, isolated but interconnected markets. A new market can be created by simply deploying a new instance of the original Aave contracts. As with any new market instantiation containing assets not listed before in the Aave Protocol though, the most critical addition to the current code base is the logic to handle the correct pricing of the new assets.

In the case of UNI tokens, a new contract has been connected to our main source of prices in order to calculate the value of a UNI in ETH at any point of time.

The calculation on the general case is simple: for our system, the price of a complex asset (composed by multiple sub-assets) is equivalent to the sum of value in ETH of those sub-assets divided by the total supply of the complex asset; with UNI it means the sum of value in ETH of the ETH/token sides, divided by the UNI total supply. As the price to convert the token side of the UNI to ETH is taken from our Chainlink price source, there is no possibility of tampering that price by any mean. However, the general case is not enough, because by doing swaps on Uniswap prior to the UNI oracle price calculation, it’s possible to tamper the balances’ equilibrium of the token and ETH sides on the liquidity pool. To avoid this and protect the protocol, the code contemplates a secondary case where we check for deviations above a certain threshold between the price to swap tokens to ETH on Uniswap and the Chainlink prices. If this deviation exists, instead of using the current token/ETH balances of Uniswap, we assume that the situation is temporary (it probably involves an attack) and calculate how the balances token/ETH should be, to have a price within Uniswap equal to the price on Chainlink. Finally, we use those “hypothetical” balances on Uniswap to do the calculation described in the general case. Our price discovery solution has been audited by Consensys Diligence, the link to the audit report can be found here.

Liquidity tokens are backed by underlying currencies. This means the counterparty risk is mitigated by the underlying asset which can be redeemed to counter losses. Liquidity tokens therefore bear the risks of their underlying currencies: derivatives of currencies already accepted in the protocol can be added with limited additional risks.

This approach can be seen through our Risk framework and LTV assessments table:

LTV assessments table

As always when depositing and borrowing, users should keep in mind the risks attached to volatile assets! Using a volatile UNI as collateral to borrow stable coins in Aave could be risky if the price of the underlying UNI assets drops and leave you in a position to get liquidated if the position is not refilled. A more in-depth risk analysis can be found here.

Join us and stay tuned…

New markets are on the horizon, and the future is bright. Additionally, Uniswap v2 will make a stunning addition to Aave Protocol once it is more battle-tested in the market and there is sufficient liquidity.

We can’t wait to hear your feedback as you explore the new market! Community responses and suggestions help us improve Aave every day, and this is our best asset. For developers or hackers who want to build on Aave, check out our developer’s documentation or hit up our #Developers channel on Discord. Be sure to stay tuned and keep up with the latest on Twitter

--

--