osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

Compounding might be broken #102

Closed uint closed 2 years ago

uint commented 2 years ago

In our interest calculations, it doesn't seem like we factor in compounding if there are more than one charge periods to handle at once: https://github.com/confio/isotonic/blob/61081fc3a31fc9f34ef03a8b039ef8ab5a53a1cb/contracts/lendex-market/src/contract.rs#L287

Interest tests seem to assume when charge_period is 300 seconds and interest rate is 20% (annual), we will get 20% interest after a year, which ignores compounding every 300 seconds.