-
Notifications
You must be signed in to change notification settings - Fork 670
/
config.go
34 lines (26 loc) · 1.09 KB
/
config.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
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package reward
import (
"math/big"
"time"
)
// PercentDenominator is the denominator used to calculate percentages
const PercentDenominator = 1_000_000
// consumptionRateDenominator is the magnitude offset used to emulate
// floating point fractions.
var consumptionRateDenominator = new(big.Int).SetUint64(PercentDenominator)
type Config struct {
// MaxConsumptionRate is the rate to allocate funds if the validator's stake
// duration is equal to [MintingPeriod]
MaxConsumptionRate uint64 `json:"maxConsumptionRate"`
// MinConsumptionRate is the rate to allocate funds if the validator's stake
// duration is 0.
MinConsumptionRate uint64 `json:"minConsumptionRate"`
// MintingPeriod is period that the staking calculator runs on. It is
// not valid for a validator's stake duration to be larger than this.
MintingPeriod time.Duration `json:"mintingPeriod"`
// SupplyCap is the target value that the reward calculation should be
// asymptotic to.
SupplyCap uint64 `json:"supplyCap"`
}