simulation

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 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 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 borrow where an account attempts to borrow some assets.

func SimulateMsgLendAsset

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

SimulateMsgLendAsset tests and runs a single msg lend where an account lends some available assets.

func SimulateMsgLiquidate

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

SimulateMsgLiquidate tests and runs a single msg liquidate where one user attempts to liquidate another user's borrow.

func SimulateMsgRepayAsset

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

SimulateMsgRepayAsset tests and runs a single msg repay where an account repays some borrowed assets.

func SimulateMsgSetCollateralSetting

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

SimulateMsgSetCollateralSetting tests and runs a single msg set collateral where an account enables or disables a uToken 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 withdraw where an account attempts to withdraw some lent assets.

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