Documentation
¶
Index ¶
- func CreatePerpInfo(id uint32, atomicResolution int32, price uint64, priceExponent int32) perptypes.PerpInfo
- func GeneratePerpetual(optionalModifications ...PerpetualModifierOption) *perptypes.Perpetual
- func MustHumanSizeToBaseQuantums(humanSize string, atomicResolution int32) (baseQuantums uint64)
- func SetUpDefaultPerpOIsForTest(t testing.TB, ctx sdk.Context, k perptypes.PerpetualsKeeper, ...)
- type PerpetualModifierOption
- func WithAtomicResolution(atomicResolution int32) PerpetualModifierOption
- func WithId(id uint32) PerpetualModifierOption
- func WithLiquidityTier(liquidityTier uint32) PerpetualModifierOption
- func WithMarketId(id uint32) PerpetualModifierOption
- func WithMarketType(marketType perptypes.PerpetualMarketType) PerpetualModifierOption
- func WithPerpetual(perp perptypes.Perpetual) PerpetualModifierOption
- func WithTicker(ticker string) PerpetualModifierOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePerpInfo ¶
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 ¶
MustHumanSizeToBaseQuantums converts a human-readable size to quantums. It uses the inverse of the exponent to convert the human size to quantums, since the exponent applies to the quantums to derive the human-readable size.
func SetUpDefaultPerpOIsForTest ¶
func SetUpDefaultPerpOIsForTest( t testing.TB, ctx sdk.Context, k perptypes.PerpetualsKeeper, perps []perptypes.Perpetual, )
Helper function to set up default open interest for input perpetuals.
Types ¶
type PerpetualModifierOption ¶
func WithAtomicResolution ¶
func WithAtomicResolution(atomicResolution int32) PerpetualModifierOption
func WithId ¶
func WithId(id uint32) PerpetualModifierOption
func WithLiquidityTier ¶
func WithLiquidityTier(liquidityTier uint32) PerpetualModifierOption
func WithMarketId ¶
func WithMarketId(id uint32) PerpetualModifierOption
func WithMarketType ¶
func WithMarketType(marketType perptypes.PerpetualMarketType) PerpetualModifierOption
func WithPerpetual ¶
func WithPerpetual(perp perptypes.Perpetual) PerpetualModifierOption
func WithTicker ¶
func WithTicker(ticker string) PerpetualModifierOption