DFP-1: Add Aave Integration

Header Content
Author Edson Ayllon (relativeread), Philippe
Created 2021-8-16
Status Planned

Motivation

Through user interviews, managers have expressed interest in strategies utilizing leverage, as well as depositing assets such as stable coins for yield.

Adding Aave would introduce the following:

  1. Interest on assets through lending
  2. Leveraged shorts and longs through borrowing
  3. Yield farming strategies through borrowing and using borrowed funds on other protocols
  4. Hedging strategies utilizing shorts

Description

Aave is a lending and borrowing platform on Ethereum mainnet and Polygon.

Implementation

Aave will be added by adding a new transaction guard to dHEDGE V2 contracts whitelisting Aave as a protocol.

The initial implementation will allow lending multiple assets, and borrowing one asset for simplicity and speed of implementation.

To allow for withdrawals with open borrowing positions, Aave’s flash loan service will be used within the guard.

Vote

Voting passed

Roadmap card(s):

3 Likes

Excited about this one as it opens up so many possibilities for the first time. Do we think there need to be a limit on leverage to limit the risk for LPs?

1 Like

Aave integration allowing shorts will indeed massively increase the possibilities on the platform!

I think theoretically the maximum leverage is close to 2x on Aave as the colleteralization ratio must be 2 - 1.

I’m not sure if there’s an easy way to add limits to leverage, as increasing leverage is done through multiple txs, switching between Sushi and Aave. (Lend, borrow, trade borrowed asset, lend borrowed/traded asset, borrow more, trade borrowed asset, etc.)

My previous comment was somewhat back of the hand math and not very accurate.

I will below describe that there is a theoretical maximum to the leverage when using Aave (or any other lending/borrowing platform)

Let r be the colleteralization ratio (on Aave r typically lies somewhere in between 0.4 and 0.8).

Then, when lending the borrowed assets recursively on the platform, you create a leveraged position in whatever asset is being used. Assuming one can do this infinitely many times the maximum theoretical leverage you could get is:

sum_(n=1)^∞ r^n = -r/(r - 1) when abs(r)<1

where n is the amount of tx/reinvestments of the borrowed assets. As you can see, r must be smaller than 1 otherwise the sum diverges to infinity! Plotting this result yields:

image

where the horizontal axis is the colleteralization ratio r and the vertical axis the theoretical maximum leverage one could get by reinvesting the borrowed assets into Aave. As we see, for r = 1 it blows up! Ouch. Luckily, Aave ensures this can never happen.
So, depending on what the value of r is, for the maximum leverage we obtain r ~ 5. This is not even that much!

Note that this is not very feasible because of tx gas costs so the practical maximum is probably somewhat lower.

Thanks for calculating this!

1 Like

AAVE is now live on dHEDGE! :partying_face: