DeFi strategy aggregated PnL

Imagine you supplied 2 wETH to Aave, borrowed 400 USDT, and then borrowed $200 two more times. You want to know how profitable your strategy is. In other words, whether the yield from supplying ETH covers the cost of servicing the USDT debt.

📘

Use the Lambda App Analytics page to create multi-asset, multi-DeFi reports that aggregate balances, rewards, and price metrics, with the ability to drill down into a single asset.

PnL = SUM( Rewards[token_i] ) + SUM ( Price_growth[token_i] ) - SUM ( Price_fall[token_i] )

In the video:

  1. We supplied 2 wETH - you can see on the chart and Balance history table
  2. We borrowed 400 + 200 + 200 = 800 USDT
  3. We earned $ 5.75 on supplying wETH
  4. We lost $ 1.48 on borrow fees for USDT
  5. Total rewards = $ 5.75 - $ 1.48 = $4.27
  6. PnL = Rewards + Price changes = $4.27 + $ 207.55 = $ 211.82

What’s Next