simulation

package
v0.1.0-nebula.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultWeightMsgSupply            int = 100
	DefaultWeightMsgWithdraw          int = 85
	DefaultWeightMsgBorrow            int = 80
	DefaultWeightMsgCollateralize     int = 65
	DefaultWeightMsgDecollateralize   int = 60
	DefaultWeightMsgRepay             int = 70
	DefaultWeightMsgLiquidate         int = 75
	OperationWeightMsgSupply              = "op_weight_msg_supply"
	OperationWeightMsgWithdraw            = "op_weight_msg_withdraw"
	OperationWeightMsgBorrow              = "op_weight_msg_borrow"
	OperationWeightMsgCollateralize       = "op_weight_msg_collateralize"
	OperationWeightMsgDecollateralize     = "op_weight_msg_decollateralize"
	OperationWeightMsgRepay               = "op_weight_msg_repay"
	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 GenDirectLiquidationFee

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

GenDirectLiquidationFee produces a randomized DirectLiquidationFee in the range of [0, 1000]

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 GenSmallLiquidationSize

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

GenSmallLiquidationSize produces a randomized SmallLiquidationSize in the range of [0, 1000]

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 SimulateMsgBorrow

SimulateMsgBorrow tests and runs a single msg borrow where an account attempts to borrow some assets.

func SimulateMsgCollateralize

func SimulateMsgCollateralize(
	ak simulation.AccountKeeper,
	bk bankkeeper.Keeper,
	lk keeper.Keeper,
) simtypes.Operation

SimulateMsgCollateralize tests and runs a single msg which adds some collateral to a user.

func SimulateMsgDecollateralize

func SimulateMsgDecollateralize(
	ak simulation.AccountKeeper,
	bk bankkeeper.Keeper,
	lk keeper.Keeper,
) simtypes.Operation

SimulateMsgDecollateralize tests and runs a single msg which removes some collateral from a user.

func SimulateMsgLiquidate

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

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

func SimulateMsgRepay

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

func SimulateMsgSupply

func SimulateMsgSupply(ak simulation.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation

SimulateMsgSupply tests and runs a single msg supply where an account supplies some available assets.

func SimulateMsgWithdraw

func SimulateMsgWithdraw(ak simulation.AccountKeeper, bk bankkeeper.Keeper, lk keeper.Keeper) simtypes.Operation

SimulateMsgWithdraw tests and runs a single msg withdraw where an account attempts to withdraw some supplied 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