Skip to the content.

2. Returns on the ‘Generic Leverage Compound Farm’ strategy

The ‘Generic Leverage Compound Farm’ is a USDC yVault strategy that accepts USDC deposits and transfers them to the Compound money market, where they generate interest. The approach is a leveraged one that utilises dYdX’s flash loans. USDC deposits are accepted by the yVault, which is then allocated to the strategy . We’ll look into how the strategy works and how yield is generated in detail.

The Compound money market provides yield in two different forms

So supplying and borrowing generates a positive yield the yearn strategy both supplies and borrows from compound to take on yield. The strategy also uses flash loans for leverage.

Now we look in detail how the strategy works, the base assets for this strategy USDC

  1. Users deposit USDC into yVault which uses a collection of strategies to generate yield.
  2. yVault transfers USDC to the ‘Generic Leverage Compound Farm’ for depositing into the Compound USDC Money Market.
  3. The strategy uses the USDC transferred from the vault and also adds a flash loan from dYdX and deposits both the amounts into the market.
  4. cTokens are minted for the amount equivalent to the sum of yVault transfer and flash loans.
  5. Next the amount equivalent to the amount loaned from the dYdX using flash loan is borrowed from Compound USDC market.
  6. The flash loan is paid in full and closed.
  7. Now the overall position of the strategy in the Compound USDC Money Market is, for supply its the sum of the transfers from yVault and the amount loaned using dYdX flash loan. For borrows it’s the amount loaned using dYdX flash loan.
  8. The strategy now earns interest and COMP rewards for the amount supplied and for the amount borrowed it pays interest but also earns COMP rewards. The APY rates are decided by the market but overall earns a positive APY due to COMP rewards.
  9. The farmed COMP rewards are swapped to USDC and deposited back making the strategy an auto compounding one.

The below dashboard shows the overall deposits in the strategy - 466 million USDC. It also shows the overall deposits split by deposit amount vs flash loans. You could see the leveraged flash loans exceed the user deposits but since it is a single asset strategy the chances of liquidation are very minimal.

.

Now we’ll look at estimating the strategy’s returns. We should compute the APY at the conclusion of each block, but we’ll do it at the end of each day to keep things simple. Also we don’t use the cToken exchange rates for the calculation as the rates aren’t linear when calculating the APY daily.

For each day we get the total deposits, borrows and COMP reward tokens. We are calculating the APY in the below dashboard as the following,

As you can see the COMP governance token rewards make up for the bulk of the total rewards and the flash loans help to leverage the deposits, increasing the overall APY.

.

Decoded TX’sTX_Analysis.pdf