in the compound whitepaper there is a section on how to calculate accured interest rate. It is calculated with historical index of the borrowing interest rate.
This is the how they calculate it:
How can I "translate" this into solidity?
Thanks a lot!