simulation

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWeightMsgLendAsset       int = 100
	DefaultWeightMsgWithdrawAsset   int = 85
	DefaultWeightMsgBorrowAsset     int = 80
	DefaultWeightMsgSetCollateral   int = 60
	DefaultWeightMsgRepayAsset      int = 70
	DefaultWeightMsgLiquidate       int = 75
	OperationWeightMsgLendAsset         = "op_weight_msg_lend_asset"
	OperationWeightMsgWithdrawAsset     = "op_weight_msg_withdraw_asset"
	OperationWeightMsgBorrowAsset       = "op_weight_msg_borrow_asset"
	OperationWeightMsgSetCollateral     = "op_weight_msg_set_collateral"
	OperationWeightMsgRepayAsset        = "op_weight_msg_repay_asset"
	OperationWeightMsgLiquidate         = "op_weight_msg_liquidate"
)

Default simulation operation weights for leverage messages

Variables

This section is empty.

Functions

func GenCompleteLiquidationThreshold

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

GenCompleteLiquidationThreshold produces a randomized CompleteLiquidationThreshold in the range of [0.050, 0.100]

func GenInterestEpoch

func GenInterestEpoch(r *rand.Rand) int64

GenInterestEpoch produces a randomized InterestEpoch in the range of [10, 100]

func GenMinimumCloseFactor

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

GenMinimumCloseFactor produces a randomized MinimumCloseFactor in the range of [0.001, 0.047]

func GenOracleRewardFactor

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

GenOracleRewardFactor produces a randomized OracleRewardFactor in the range of [0.005, 0.100]

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 leverage 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 oracle

func SimulateMsgBorrowAsset

func SimulateMsgBorrowAsset(ak simulation.AccountKeeper, bk types.BankKeeper, lk keeper.Keeper) simtypes.Operation

SimulateMsgBorrowAsset tests and runs a single msg send where an account borrow some asset.

func SimulateMsgLendAsset

func SimulateMsgLendAsset(ak simulation.AccountKeeper, bk types.BankKeeper) simtypes.Operation

SimulateMsgLendAsset tests and runs a single msg send where an account lends some available asset.

func SimulateMsgLiquidate

func SimulateMsgLiquidate(ak simulation.AccountKeeper, bk types.BankKeeper, lk keeper.Keeper) simtypes.Operation

SimulateMsgLiquidate tests and runs a single msg send where some asset borrowed is liquidated.

func SimulateMsgRepayAsset

func SimulateMsgRepayAsset(ak simulation.AccountKeeper, bk types.BankKeeper, lk keeper.Keeper) simtypes.Operation

SimulateMsgRepayAsset tests and runs a single msg send where an account repay some asset borrowed.

func SimulateMsgSetCollateralSetting

func SimulateMsgSetCollateralSetting(
	ak simulation.AccountKeeper,
	bk types.BankKeeper,
	lk keeper.Keeper,
) simtypes.Operation

SimulateMsgSetCollateralSetting tests and runs a single msg send where an account set some denom as collateral.

func SimulateMsgWithdrawAsset

func SimulateMsgWithdrawAsset(ak simulation.AccountKeeper, bk types.BankKeeper, lk keeper.Keeper) simtypes.Operation

SimulateMsgWithdrawAsset tests and runs a single msg send where an account withdraw some lended asset.

func WeightedOperations

WeightedOperations returns all the operations from the leverage 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