-
Notifications
You must be signed in to change notification settings - Fork 39
/
params.go
37 lines (30 loc) · 1.18 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
package keeper
import (
"github.com/classic-terra/core/v2/x/market/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// BasePool is liquidity pool(usdr unit) which will be made available per PoolRecoveryPeriod
func (k Keeper) BasePool(ctx sdk.Context) (res sdk.Dec) {
k.paramSpace.Get(ctx, types.KeyBasePool, &res)
return
}
// MinStabilitySpread is the minimum spread applied to swaps to / from Luna.
// Intended to prevent swing trades exploiting oracle period delays
func (k Keeper) MinStabilitySpread(ctx sdk.Context) (res sdk.Dec) {
k.paramSpace.Get(ctx, types.KeyMinStabilitySpread, &res)
return
}
// PoolRecoveryPeriod is the period required to recover Terra&Luna Pools to the MintBasePool & BurnBasePool
func (k Keeper) PoolRecoveryPeriod(ctx sdk.Context) (res uint64) {
k.paramSpace.Get(ctx, types.KeyPoolRecoveryPeriod, &res)
return
}
// GetParams returns the total set of market parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSetIfExists(ctx, ¶ms)
return params
}
// SetParams sets the total set of market parameters.
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, ¶ms)
}