core

package
v1.50.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AdditionalChainFormatDecimals = 18

Variables

This section is empty.

Functions

This section is empty.

Types

type DerivativeMarket

type DerivativeMarket struct {
	Id                     string
	Status                 string
	Ticker                 string
	OracleBase             string
	OracleQuote            string
	OracleType             string
	OracleScaleFactor      uint32
	InitialMarginRatio     decimal.Decimal
	MaintenanceMarginRatio decimal.Decimal
	QuoteToken             Token
	MakerFeeRate           decimal.Decimal
	TakerFeeRate           decimal.Decimal
	ServiceProviderFee     decimal.Decimal
	MinPriceTickSize       decimal.Decimal
	MinQuantityTickSize    decimal.Decimal
}

func (DerivativeMarket) CalculateMarginInChainFormat

func (derivativeMarket DerivativeMarket) CalculateMarginInChainFormat(humanReadableQuantity decimal.Decimal, humanReadablePrice decimal.Decimal, leverage decimal.Decimal) cosmtypes.Dec

func (DerivativeMarket) MarginFromChainFormat

func (derivativeMarket DerivativeMarket) MarginFromChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (DerivativeMarket) MarginFromExtendedChainFormat added in v1.50.0

func (derivativeMarket DerivativeMarket) MarginFromExtendedChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (DerivativeMarket) MarginToChainFormat

func (derivativeMarket DerivativeMarket) MarginToChainFormat(humanReadableValue decimal.Decimal) cosmtypes.Dec

func (DerivativeMarket) PriceFromChainFormat

func (derivativeMarket DerivativeMarket) PriceFromChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (DerivativeMarket) PriceFromExtendedChainFormat added in v1.50.0

func (derivativeMarket DerivativeMarket) PriceFromExtendedChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (DerivativeMarket) PriceToChainFormat

func (derivativeMarket DerivativeMarket) PriceToChainFormat(humanReadableValue decimal.Decimal) cosmtypes.Dec

func (DerivativeMarket) QuantityFromChainFormat

func (derivativeMarket DerivativeMarket) QuantityFromChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (DerivativeMarket) QuantityFromExtendedChainFormat added in v1.50.0

func (derivativeMarket DerivativeMarket) QuantityFromExtendedChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (DerivativeMarket) QuantityToChainFormat

func (derivativeMarket DerivativeMarket) QuantityToChainFormat(humanReadableValue decimal.Decimal) cosmtypes.Dec

type SpotMarket

type SpotMarket struct {
	Id                  string
	Status              string
	Ticker              string
	BaseToken           Token
	QuoteToken          Token
	MakerFeeRate        decimal.Decimal
	TakerFeeRate        decimal.Decimal
	ServiceProviderFee  decimal.Decimal
	MinPriceTickSize    decimal.Decimal
	MinQuantityTickSize decimal.Decimal
}

func (SpotMarket) PriceFromChainFormat

func (spotMarket SpotMarket) PriceFromChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (SpotMarket) PriceFromExtendedChainFormat added in v1.50.0

func (spotMarket SpotMarket) PriceFromExtendedChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (SpotMarket) PriceToChainFormat

func (spotMarket SpotMarket) PriceToChainFormat(humanReadableValue decimal.Decimal) cosmtypes.Dec

func (SpotMarket) QuantityFromChainFormat

func (spotMarket SpotMarket) QuantityFromChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (SpotMarket) QuantityFromExtendedChainFormat added in v1.50.0

func (spotMarket SpotMarket) QuantityFromExtendedChainFormat(chainValue cosmtypes.Dec) decimal.Decimal

func (SpotMarket) QuantityToChainFormat

func (spotMarket SpotMarket) QuantityToChainFormat(humanReadableValue decimal.Decimal) cosmtypes.Dec

type Token

type Token struct {
	Name     string
	Symbol   string
	Denom    string
	Address  string
	Decimals int32
	Updated  int64
}

func (Token) ChainFormattedValue

func (t Token) ChainFormattedValue(humanReadableValue decimal.Decimal) decimal.Decimal

Jump to

Keyboard shortcuts

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