Use Aave's aTokens and Compound's cTokens

Aave and Compound offer composable tokens which represent deposits on their respective platforms. We explore key benefits of using the same tokens for higher yields and lower borrowing rates.

Why Support Aave and Compound Tokens?

Parallel is a true one-stop shop for all things NFT’s and capital efficiency in web3. In order to do so it will build out its NFT-focused borrowing/lending protocol to provide maximum liquidity to users and capital efficiency.

We seek to support Aave's aTokens and Compound's cTokens in order to provide additional yield and allow both Aave and Compound to earn more on their crypto investments. Further liquidity on Parallel will likewise allow borrowers to pay less for loans and achieve greater capital efficiency.

User Goals/Stories:

  1. As a Parallel user I am able to deposit and borrow against a wide range of tokens, both fungible and non-fungible, which allow me to maximize my returns on investment.

  2. As an Aave and/or Compound user I am able to generate additional yield on my existing deposits in order to maximize my returns on investment.

  3. As the Parallel protocol I would like to extend support to the widest range of tokens possible in order to solve the greatest number of users' problems.

Executive Summary on Earning More and Paying Less via Aave and Compound's Composable Tokens

Aave and Compound are blue-chip protocols with very large TVL and user bases. We will support their respective aToken and cToken contracts in order to solve problems and improve outcomes for the largest possible audience of users. Their tokens represent composable interest-bearing deposits on each Aave and Compound which will in turn earn greater yields on Parallel.

Depositors will be incentivized to deposit aTokens and cTokens into Parallel as long as they receive positive interest rates (in addition to Aave and Compound yields) and they feel it is safe to do so.

Borrowers will be incentivized to borrow aTokens and cTokens as long as their post-borrow interest rate is less than the borrow on the underlying ERC20. Given that both aTokens and cTokens are directly fungible with their underlying ERC20 or ETH tokens we will be able to instantly transfer their preferred tokens from our protocol's front-end via Aave and Compound's contracts.

In order to ensure maximum capital efficiency we will likewise build a tool which calculates blended interest rates for ERC20. i.e. as user I enter the amount I would like to borrow of a given ERC20. The system then calculates based on Utilization ratio and interest rate curves whether I would pay lower rates in borrowing the ERC20 or the equivalent aToken/cToken. If I attempt to borrow the ERC20 directly when it’s more expensive to do so there is a pop-up which suggests I should instead borrow at lower net rates against cUSDC or aUSDC. We can likewise add a calculator tool such that the user can calculate savings (if any) proactively.

NB: Depositors and Borrowers are similar sets of users. Borrowers should always prefer the additional liquidity made available via Aave and Compound’s aToken and cTokens to lower overall protocol borrow rates.

Brief intro Aave and Compound

Aave is currently the single-largest protocol by TVL ($6.1B excluding borrows and double-counts) across DeFi according to Defillama, while Compound is the ninth-largest ($2.6B) but the second-largest lending platform on Ethereum. Both Aave and Compound are among the earliest and certainly the most significant decentralized borrowing/lending platforms on Ethereum and in many regards helped define Decentralized Finance.

In fact Compound’s COMP token launch in May, 2020 served as catalyst for the so-called “DeFi summer” which catapulted the broader industry to orders of magnitude more TVL.

Or in sum: both Aave and Compound are among the most trusted and actively used protocols in all of Decentralized Finance and crypto.

What are aTokens and cTokens?

Compound introduced ‘cTokens’ as ‘cERC20’ or cETH tokens which represent deposits on the Compound protocol. They did so such that the protocol's contracts no longer had to keep track of which users held deposits on its platform, simplifying their smart contracts, gas usage, security, and adding composability to deposits on Compound's protocol.

Aave released aTokens to accomplish the same and eventually overtook Compound to become the largest decentralized borrowing and lending protocol in all of crypto.

Why would we care to support aTokens and cTokens on Parallel?

With a collective $6.1B in aTokens ($2.03B net of existing borrows) and $2.63B in cTokens ($1.62B net of borrows) it’s clear there is substantial capital deposited both on Aave and Compound. According to queries on Dune Analytics there have been an aggregate 118,635 depositors onto Aave and a further 342,739 users on Compound. This clearly overstates the number of still-active users, but it speaks to the scale of the addressable audience.

With this user base we can solve users' problems and add additional value to a larger audience whether or not they use Aave or Compound.

Why would the user care to deposit aTokens and cTokens on Parallel?

The answer to the more critical question is relatively straightforward—a user with aTokens and/or cTokens in their wallet could potentially earn further yields or likewise borrow at different rates on Parallel. Examples help clarify the same:

  • User A has deposited 10,000 USDC into Aave and now holds 10,000 aUSDC, collecting 5% interest on their deposit. The same user sees they can earn a further 5% on Parallel if they deposit their 10,000 aUSDC into the protocol or up to 10.25% total yield on their USDC. This is made possible by User B who borrows aUSDC and pays interest:

  • User B would like to borrow 10,000 USDC against their ERC-721 asset. They see, however, that the USDC borrow rate is 20% but the borrow rate on aUSDC is 5%. As long as the net-borrow rate on aUSDC is below 20%, the user then borrows 10,000 aUSDC and immediately redeems it for USDC on our platform.

When does it make sense for a user to borrow or deposit aTokens and cTokens from/to Parallel?

We continue with the example above:

  • User B will pay x%x\% in post-borrow rates for aUSDC on Parallel and will likewise pay the additional 5% yield earned on aUSDC via Aave. We'll call this net-borrow rate z%z\%.​ As long as z%z\%​ is below 20% it makes sense for User B to borrow aUSDC and immediately withdraw the equivalent 10,000 USDC from Aave.

\begin{alignat}{1} z\% = (1+x\%)(1+y\%) - 1 && \end{alignat}
  • With the above equation we can solve for the maximum x%x\% of 14.29% such that it will make sense for User B to borrow aUSDC instead of USDC directly. ​

  • User A will be incentivized to deposit their aUSDC onto ParaSpace as long as they generate positive deposit yields and feel their deposits are safe. Their total deposit yield will thus be the 5% they earn on Aave plus whatever positive interest rate they receive on ParaSpace.

  • User C is a ParaSpace user or prospective ParaSpace user who has never used Aave or Compound. They will be incentivized to borrow against their ERC20 or ERC721 collateral if interest rates are lower. All else equal, the ability to borrow against aTokens and cTokens should indeed improve access to capital for this key set of borrowers. ParaSpace will support a mechanism by which the user will be told if it is more cost-effective to borrow the equivalent aToken or cToken to take advantage of the additional liquidity provided.

How do aTokens and cTokens Work?

cTokens: A user who deposits USDC into Compound receives cUSDC in return. If a user deposits 100 USDC they might receive 100x that amount in cUSDC, or 1,000 cUSDC. When the user returns said cUSDC to the Compound protocol they receive their original USDC in addition to any interest earned given a changed exchange rate between USDC ↔ cUSDC. If the cumulative interest adds to 5% of principle they would receive 105 USDC in exchange for the same 1,000 cUSDC they originally received; the USDC ↔ cUSDC exchange rate goes from 100 USDCcUSDC\frac{USDC}{cUSDC}to 105 USDCcUSDC\frac{USDC}{cUSDC}to account for the same on Compound.

aTokens: Aave uses a very similar model and issues aTokens as an interest-bearing token to represent the deposits a user has made into the Aave protocol. There is a key difference, however: aTokens rebase within a user’s wallet to account for interest earned on Aave. If the same user in the above example deposits 100 USDC into Aave they would receive 100 aUSDC. If over the same time period they achieved 5% returns their wallet balance would be 105 aUSDC without any transfers necessary due to automatic rebasing within the aToken contract. The exchange rate doesn’t change and instead returns are generated at regular increments.

Technical and Security considerations for aToken and cToken Composability

In order to support borrowing and lending of aTokens and cTokens we will need accurate pricing and the ability to exchange each for their underlying tokens:

  1. Pricing: Find an unbiased and resilient price Oracle for each in order to calculate value. Track the resulting value of the user's deposits accurately.

  2. Exchange: Exchange cTokens/aTokens to and from the underlying token and liquidate/exchange them for other tokens when necessary.

Here it bears mention that like Aave users receive a token to represent their deposits and borrows against ParaSpace--pTokens. And we will separate slightly different methods of support for the Aave and Compound derivative tokens:

aTokens:

  1. Pricing: Aave will redeem aTokens 1:1 with the underlying ETH or ERC20 token. Thus we will use a Chainlink oracle for each to price the aToken. ParaSpace will provide the user with a pToken which tracks the growing balance of the depositor's aToken and liability for the borrower.

  2. Exchange: aTokens are as liquid/fungible as the deposits they represent. ParaSpace may call Aave's contract to redeem the underlying ETH or ERC20 and liquidate them via normal channels.

cTokens:

  1. Pricing: Compound itself uses Chainlink oracles to track the value of ETH and ERC20 tokens, and we can call the Compound contracts to determine the cToken exchange rate. As a policy, however, we will avoid using on-chain instantaneous pricing due to risk of flashloan attacks. We will thus develop a Time Weighted Average Price (TWAP) for this exchange rate in order to support cTokens. But we will otherwise require no special treatment of pTokens representing cToken deposits.

  2. Exchange: We can at any time redeem cTokens via Compound for the underlying token and exchange/liquidate them via normal channels.

Summary and Future Work

As we make clear above we stand to solve further user problems in our support for Aave's aTokens and Compound's cTokens on the ParaSpace protocol. Specifically--higher deposit yields for Compound and Aave users and lower borrow rates for all ParaSpace users.

In the first phase we will build provide front-end prompts when a user requests to borrow a token and the corresponding aToken or cToken offers a better net-borrow rate. In the future we could make this experience even more user-friendly for borrowers if we implement custom borrow/repay functionality to optimally select which asset to borrow on-chain.

In this way a user who seeks to borrow, for example, USDC would simply see the lowest borrow rate available across USDC, cUSDC, and aUSDC. This could be done off-chain of course, but the ParaSpace smart contract would loop over the corresponding assets to confirm as much in a truly decentralized fashion.

The ParaSpace contract would then automatically choose the asset which results in the lowest rate. If necessary it would then swap the aToken/cToken to the token which the user has requested with no further input necessary. When the user repays the loan the contract would automatically exchange the token to match what was originally borrowed.

Last updated