-
Notifications
You must be signed in to change notification settings - Fork 201
/
constants.go
37 lines (30 loc) · 1.31 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
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
// minimum number of assets a pool may have
MinPoolAssets = 2
// maximum number of assets a pool may have
MaxPoolAssets = 2
// the exponent of a pool display share compared to a pool base share (one pool display share = 10^18 pool base shares)
DisplayPoolShareExponent = 18
// Scaling factor for every weight. The pool weight is:
// weight_in_MsgCreateBalancerPool * GuaranteedWeightPrecision
//
// This is done so that smooth weight changes have enough precision to actually be smooth.
GuaranteedWeightPrecision int64 = 1 << 30
)
var (
// OneDisplayPoolShare represents one display pool share
OneDisplayPoolShare sdk.Int = sdk.NewIntWithDecimal(1, DisplayPoolShareExponent)
// InitPoolSharesSupply is the amount of new shares to initialize a pool with.
InitPoolSharesSupply sdk.Int = OneDisplayPoolShare.MulRaw(100)
// Pool creators can specify a weight in [1, MaxUserSpecifiedWeight)
// for every token in the balancer pool.
//
// The weight used in the balancer equation is then creator-specified-weight * GuaranteedWeightPrecision.
// This is done so that LBP's / smooth weight changes can actually happen smoothly,
// without complex precision loss / edge effects.
MaxUserSpecifiedWeight sdk.Int = sdk.NewIntFromUint64(1 << 20)
)