Portfolio Playground

Introduction

This portfolio calculation tool provides a framework for understanding the dynamics of DeFi lending and borrowing. It helps users explore the impact of different strategies while highlighting risk factors. However, this tool should not be used as financial advice, and users should conduct further research before making any financial decisions.

Inputs and Constraints

The portfolio calculation tool considers the following user-defined inputs:

  1. Timeframe Selection: Users can choose from five different timeframes for portfolio analysis.

  2. Deposit Amounts: The amount of each asset supplied.

  3. Borrow Amounts: The amount of each asset borrowed.

  4. Minimum Health Score: The lowest allowable health score before liquidation risk is triggered.

  5. Minimum Diversification: A threshold to ensure the portfolio holds a mix of assets to reduce exposure to any single asset.

  6. Volatility Considerations: Historical volatility data is used to assess potential risk.

Calculation of Deposits, Borrows, and Swaps

The tool employs a step-by-step approach to model the interactions between deposits, borrows, and swaps within the portfolio.

1. Deposits

  • Deposits are considered based on their respective collateral factors.

  • Each deposit adds to the available liquidity, affecting the Loan-to-Value (LTV) ratio.

  • The collateral weight of each asset influences how much borrowing power is granted.

2. Borrows

  • The borrowing power is calculated as: [ \text{Max Borrow} = \sum \left( \text{Collateral Asset Value} \times \text{LTV Ratio} \right) ]

  • Interest accrues over time based on variable or fixed-rate borrow options.

  • A health factor is calculated to ensure the portfolio remains above the liquidation threshold: [ \text{Health Factor} = \frac{\text{Total Collateral Value} \times \text{Liquidation Threshold}}{\text{Total Borrow Value}} ]

3. Swaps

  • Users can swap assets within their portfolio to rebalance their exposure.

  • Slippage and swap fees are considered in the calculation.

  • Swaps are evaluated based on their impact on diversification and health score.

Risk Analysis

  • Health Score Monitoring: Continuous tracking ensures that a user’s portfolio remains above the liquidation threshold.

  • Diversification Optimization: The tool suggests allocation adjustments to reduce single-asset risk.

  • Volatility Simulations: Historical price movements are used to stress-test different portfolio scenarios.

Last updated