estimate_interest#

API documentation for tradeexecutor.strategy.interest.estimate_interest Python function.

estimate_interest(start_at, end_at, start_quantity, interest_rate, year=datetime.timedelta(days=365))[source]#

Calculate new token amount, assuming fixed interest.

Parameters:
  • interest_rate (float) –

    Yearly interest relative to.

    1 = 0%.

    E.g. 1.02 for 2% yearly gained interest.

    Always positive.

  • start_quantity (Decimal) – Tokens at the start of the period

  • year – Year length in Aave.

  • start_at (datetime) –

  • end_at (datetime) –

Returns:

Amount of token quantity with principal + interest after the period.

Return type:

Decimal