simulation

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LiquidityPoolTypes     = "liquidity_pool_types"
	MinInitDepositAmount   = "min_init_deposit_amount"
	InitPoolCoinMintAmount = "init_pool_coin_mint_amount"
	MaxReserveCoinAmount   = "max_reserve_coin_amount"
	PoolCreationFee        = "pool_creation_fee"
	SwapFeeRate            = "swap_fee_rate"
	WithdrawFeeRate        = "withdraw_fee_rate"
	MaxOrderAmountRatio    = "max_order_amount_ratio"
	UnitBatchHeight        = "unit_batch_height"
)

Simulation parameter constants

View Source
const (
	OpWeightMsgCreatePool          = "op_weight_msg_create_pool"
	OpWeightMsgDepositWithinBatch  = "op_weight_msg_deposit_to_pool"
	OpWeightMsgWithdrawWithinBatch = "op_weight_msg_withdraw_from_pool"
	OpWeightMsgSwapWithinBatch     = "op_weight_msg_swap"
)

Simulation operation weights constants.

Variables

This section is empty.

Functions

func GenInitPoolCoinMintAmount

func GenInitPoolCoinMintAmount(r *rand.Rand) sdk.Int

GenInitPoolCoinMintAmount randomized InitPoolCoinMintAmount

func GenLiquidityPoolTypes

func GenLiquidityPoolTypes(r *rand.Rand) (liquidityPoolTypes []types.PoolType)

GenLiquidityPoolTypes return default PoolType temporarily, It will be randomized in the liquidity v2

func GenMaxOrderAmountRatio

func GenMaxOrderAmountRatio(r *rand.Rand) sdk.Dec

GenMaxOrderAmountRatio randomized MaxOrderAmountRatio ranging from 0.00001 to 1

func GenMaxReserveCoinAmount

func GenMaxReserveCoinAmount(r *rand.Rand) sdk.Int

GenMaxReserveCoinAmount randomized MaxReserveCoinAmount

func GenMinInitDepositAmount

func GenMinInitDepositAmount(r *rand.Rand) sdk.Int

GenMinInitDepositAmount randomized MinInitDepositAmount

func GenPoolCreationFee

func GenPoolCreationFee(r *rand.Rand) sdk.Coins

GenPoolCreationFee randomized PoolCreationFee list of 1 to 4 coins with an amount greater than 1

func GenSwapFeeRate

func GenSwapFeeRate(r *rand.Rand) sdk.Dec

GenSwapFeeRate randomized SwapFeeRate ranging from 0.00001 to 1

func GenUnitBatchHeight

func GenUnitBatchHeight(r *rand.Rand) uint32

GenUnitBatchHeight randomized UnitBatchHeight ranging from 1 to 20

func GenWithdrawFeeRate

func GenWithdrawFeeRate(r *rand.Rand) sdk.Dec

GenWithdrawFeeRate randomized WithdrawFeeRate ranging from 0.00001 to 1

func NewDecodeStore

func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string

NewDecodeStore returns a decoder function closure that unmarshals the KVPair's Value to the corresponding liquidity type.

func ParamChanges

func ParamChanges(r *rand.Rand) []simtypes.ParamChange

ParamChanges defines the parameters that can be modified by param change proposals on the simulation

func RandomizedGenState

func RandomizedGenState(simState *module.SimulationState)

RandomizedGenState generates a random GenesisState for liquidity

func SimulateMsgCreatePool

func SimulateMsgCreatePool(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation

SimulateMsgCreatePool generates a MsgCreatePool with random values

func SimulateMsgDepositWithinBatch

func SimulateMsgDepositWithinBatch(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation

SimulateMsgDepositWithinBatch generates a MsgDepositWithinBatch with random values

func SimulateMsgSwapWithinBatch

func SimulateMsgSwapWithinBatch(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation

SimulateMsgSwapWithinBatch generates a MsgSwapWithinBatch with random values

func SimulateMsgWithdrawWithinBatch

func SimulateMsgWithdrawWithinBatch(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation

SimulateMsgWithdrawWithinBatch generates a MsgWithdrawWithinBatch with random values.

func WeightedOperations

WeightedOperations returns all the operations from the module with their respective weights.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL