Skip to main content

IInterestCalculator.sol

IInterestCalculator

Interface for an interest calculator contract.

calculateInterest

function calculateInterest(address token, uint256 amount, uint256 from, uint256 to) external view returns (uint256)

Calculates the interest accrued for a given token and amount within a specified time range.

  • Parameters:

    NameTypeDescription
    tokenaddressThe address of the token.
    amountuint256The amount of the token.
    fromuint256The starting timestamp (inclusive) of the time range.
    touint256The ending timestamp (exclusive) of the time range.
  • Return Values:

    NameTypeDescription
    [0]uint256The accrued interest for the specified token and amount within the given time range.