Yield Math
Why not standard Solidity Math?
The Iterative Algorithm
Instead of an estimation, we run a precise loop for every day that has passed.
The Logic:
(Repeated $N$ times, where $N$ is days elapsed)
Rust Implementation:
let mut current_value = principal;
// Iterate for every day elapsed
for _ in 0..days {
// 1% daily growth
current_value = (current_value * 101) / 100;
}