Here I'm referring to https://compound.finance, which is quite an awesome product.
One thing inspires me most is that the interests accrued in Compound are updated per block. How's that even possible?
From its FAQ (https://medium.com/compound-finance/faq-1a2636713b69):
How often is interest calculated?
The interest rates you see in the Interface and Market Overview are quoted as annual interest rates. Interest accrues each Ethereum block; every ~15 seconds, your balance will increase by (1/2102400) of the quoted interest rate. Really!
I still couldn't figure out how to do that, as I'm seeing exactly it works even without frontend UI - by setting
requestedAmount to be 0xff...ff.
Can someone please educate me on this? Thanks.