-
Notifications
You must be signed in to change notification settings - Fork 276
/
constants.go
43 lines (36 loc) · 1.51 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package types
import sdk "github.com/cosmos/cosmos-sdk/types"
const (
NanosecondsPerSecond = 1_000_000_000
SecondsPerMinute = 60
MinutesPerHour = 60
HoursPerDay = 24
// DaysPerYear is the mean length of the Gregorian calendar year. Note this
// value isn't 365 because 97 out of 400 years are leap years. See
// https://en.wikipedia.org/wiki/Year
DaysPerYear = 365.2425
SecondsPerYear = int64(SecondsPerMinute * MinutesPerHour * HoursPerDay * DaysPerYear) // 31,556,952
NanosecondsPerYear = NanosecondsPerSecond * SecondsPerYear // 31,556,952,000,000,000
// InitialInflationRate is the inflation rate that the network starts at.
InitialInflationRate = 0.08
// DisinflationRate is the rate at which the inflation rate decreases each year.
DisinflationRate = 0.1
// TargetInflationRate is the inflation rate that the network aims to
// stabilize at. In practice, TargetInflationRate acts as a minimum so that
// the inflation rate doesn't decrease after reaching it.
TargetInflationRate = 0.015
)
var (
initialInflationRateAsDec = sdk.NewDecWithPrec(InitialInflationRate*1000, 3)
disinflationRateAsDec = sdk.NewDecWithPrec(DisinflationRate*1000, 3)
targetInflationRateAsDec = sdk.NewDecWithPrec(TargetInflationRate*1000, 3)
)
func InitialInflationRateAsDec() sdk.Dec {
return initialInflationRateAsDec
}
func DisinflationRateAsDec() sdk.Dec {
return disinflationRateAsDec
}
func TargetInflationRateAsDec() sdk.Dec {
return targetInflationRateAsDec
}