calculate_net_profit

Documentation for eth_defi.research.vault_metrics.calculate_net_profit function.

calculate_net_profit(start, end, share_price_start, share_price_end, management_fee_annual, performance_fee, deposit_fee, withdrawal_fee, seconds_in_year=31557600.0, sample_count=None)

Calculate profit after external fees have been reduced from the share price change.

Parameters
  • start (datetime.datetime) – Start datetime of the investment period.

  • end (datetime.datetime) – End datetime of the investment period.

  • share_price_start (float) – Share price at the start of the investment period.

  • share_price_end (float) – Share price at the end of the investment period.

  • management_fee_annual (float) – Annual management fee as a percent (0.02 = 2% per year).

  • performance_fee (float) – Performance fee as a percent (0.20 = 20% of profits).

  • deposit_fee (float | None) – Deposit fee as a percent (0.01 = 1% fee), or None if no fee.

  • withdrawal_fee (float | None) – Withdrawal fee as a percent (0.01 = 1% fee), or None if no fee.

  • sample_count (int | None) – If we have not enough returns data, do not try to calculate profit.

Returns

Net profit as a floating point (0.10 = 10% profit).

Return type

float