wip
This commit is contained in:
@@ -2,6 +2,7 @@ package ana
|
||||
|
||||
import (
|
||||
"maps"
|
||||
"math"
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
@@ -27,7 +28,8 @@ func NewInterestPredictor(namePattern string, currencyPattern string, apy float6
|
||||
if !currencyMatcher.MatchString(string(currency)) {
|
||||
continue
|
||||
}
|
||||
result[name][currency] *= 1.0 + apy/12.0
|
||||
percentOfYearPassed := float64(delta) / float64(time.Hour*365)
|
||||
result[name][currency] *= math.Pow(1.0+apy/12.0, percentOfYearPassed)
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user