/
params.go
59 lines (49 loc) · 1.75 KB
/
params.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/petri-labs/kaiju/x/maker/types"
)
// GetParams get all parameters as types.Params
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramstore.GetParamSet(ctx, ¶ms)
return params
}
// SetParams set the params
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramstore.SetParamSet(ctx, ¶ms)
}
// BackingRatioStep is backing ratio adjust step
func (k Keeper) BackingRatioStep(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyBackingRatioStep, &res)
return
}
// BackingRatioPriceBand is price band within which backing ratio will not be adjusted
func (k Keeper) BackingRatioPriceBand(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyBackingRatioPriceBand, &res)
return
}
// BackingRatioCooldownPeriod is minimum cooldown period after which backing ratio can be adjusted
func (k Keeper) BackingRatioCooldownPeriod(ctx sdk.Context) (res int64) {
k.paramstore.Get(ctx, types.KeyBackingRatioCooldownPeriod, &res)
return
}
// MintPriceBias is mint price bias ratio
func (k Keeper) MintPriceBias(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyMintPriceBias, &res)
return
}
// BurnPriceBias is burn price bias ratio
func (k Keeper) BurnPriceBias(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyMintPriceBias, &res)
return
}
// RebackBonus is reback bonus ratio
func (k Keeper) RebackBonus(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyRebackBonus, &res)
return
}
// LiquidationCommissionFee is liquidation commission fee ratio
func (k Keeper) LiquidationCommissionFee(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyLiquidationCommissionFee, &res)
return
}