perpetuals

package
v0.0.0-...-a9c8dba Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePerpetual

func GeneratePerpetual(optionalModifications ...PerpetualModifierOption) *perptypes.Perpetual

GeneratePerpetual returns a `Perpetual` object set to default values. Passing in `PerpetualModifierOption` methods alters the value of the `Perpetual` returned. It will start with the default, valid `Perpetual` value defined within the method and make the requested modifications before returning the object.

Example usage: `GeneratePerpetual(WithId(10))` This will start with the default `Perpetual` object defined within the method and return the newly-created object after overriding the values of `Id` to 10.

func MustHumanSizeToBaseQuantums

func MustHumanSizeToBaseQuantums(
	humanSize string,
	atomicResolution int32,
) (baseQuantums uint64)

func SetUpDefaultPerpOIsForTest

func SetUpDefaultPerpOIsForTest(
	t *testing.T,
	ctx sdk.Context,
	k perptypes.PerpetualsKeeper,
	perps []perptypes.Perpetual,
)

Helper function to set up default open interest for input perpetuals.

Types

type PerpetualModifierOption

type PerpetualModifierOption func(cp *perptypes.Perpetual)

func WithId

func WithLiquidityTier

func WithLiquidityTier(liquidityTier uint32) PerpetualModifierOption

func WithMarketId

func WithMarketId(id uint32) PerpetualModifierOption

func WithTicker

func WithTicker(ticker string) PerpetualModifierOption

Jump to

Keyboard shortcuts

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