Skip to content

Commit

Permalink
Merge pull request #235 from curveresearch/pandas-fix
Browse files Browse the repository at this point in the history
Use non-deprecated option with days
  • Loading branch information
chanhosuh authored Sep 7, 2023
2 parents 5ff34ed + 2a6b069 commit bf26139
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion curvesim/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def _get_cryptoswap_virtual_value(self, pool_state_row):

def compute_annualized_returns(self, data):
"""Computes annualized returns from a series of pool values."""
year_multipliers = timedelta64(1, "Y") / data.index.to_series().diff()
year_multipliers = timedelta64(365, "D") / data.index.to_series().diff()
log_returns = log(data).diff() # pylint: disable=no-member

return exp((log_returns * year_multipliers).mean()) - 1
Expand Down

0 comments on commit bf26139

Please sign in to comment.