core

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const AdditionalChainFormatDecimals = 18

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryOptionMarket added in v1.54.0

type BinaryOptionMarket struct {
	Id                  string
	Status              string
	Ticker              string
	OracleSymbol        string
	OracleProvider      string
	OracleType          string
	OracleScaleFactor   uint32
	ExpirationTimestamp int64
	SettlementTimestamp int64
	QuoteToken          Token
	MakerFeeRate        decimal.Decimal
	TakerFeeRate        decimal.Decimal
	ServiceProviderFee  decimal.Decimal
	MinPriceTickSize    decimal.Decimal
	MinQuantityTickSize decimal.Decimal
	MinNotional         decimal.Decimal
	SettlementPrice     *decimal.Decimal
}

func (BinaryOptionMarket) CalculateMarginInChainFormat added in v1.54.0

func (market BinaryOptionMarket) CalculateMarginInChainFormat(humanReadableQuantity, humanReadablePrice, leverage decimal.Decimal) sdkmath.LegacyDec

func (BinaryOptionMarket) MarginFromChainFormat added in v1.54.0

func (market BinaryOptionMarket) MarginFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) MarginFromExtendedChainFormat added in v1.54.0

func (market BinaryOptionMarket) MarginFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) MarginToChainFormat added in v1.54.0

func (market BinaryOptionMarket) MarginToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (BinaryOptionMarket) NotionalFromChainFormat added in v1.54.0

func (market BinaryOptionMarket) NotionalFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) NotionalFromExtendedChainFormat added in v1.54.0

func (market BinaryOptionMarket) NotionalFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) NotionalToChainFormat added in v1.54.0

func (market BinaryOptionMarket) NotionalToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (BinaryOptionMarket) PriceFromChainFormat added in v1.54.0

func (market BinaryOptionMarket) PriceFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) PriceFromExtendedChainFormat added in v1.54.0

func (market BinaryOptionMarket) PriceFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) PriceToChainFormat added in v1.54.0

func (market BinaryOptionMarket) PriceToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (BinaryOptionMarket) QuantityFromChainFormat added in v1.54.0

func (market BinaryOptionMarket) QuantityFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) QuantityFromExtendedChainFormat added in v1.54.0

func (market BinaryOptionMarket) QuantityFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (BinaryOptionMarket) QuantityToChainFormat added in v1.54.0

func (market BinaryOptionMarket) QuantityToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

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
	MinNotional            decimal.Decimal
}

func (DerivativeMarket) CalculateMarginInChainFormat

func (derivativeMarket DerivativeMarket) CalculateMarginInChainFormat(humanReadableQuantity, humanReadablePrice, leverage decimal.Decimal) sdkmath.LegacyDec

func (DerivativeMarket) MarginFromChainFormat

func (derivativeMarket DerivativeMarket) MarginFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) MarginFromExtendedChainFormat added in v1.50.0

func (derivativeMarket DerivativeMarket) MarginFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) MarginToChainFormat

func (derivativeMarket DerivativeMarket) MarginToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (DerivativeMarket) NotionalFromChainFormat added in v1.51.1

func (derivativeMarket DerivativeMarket) NotionalFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) NotionalFromExtendedChainFormat added in v1.51.1

func (derivativeMarket DerivativeMarket) NotionalFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) NotionalToChainFormat added in v1.51.1

func (derivativeMarket DerivativeMarket) NotionalToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (DerivativeMarket) PriceFromChainFormat

func (derivativeMarket DerivativeMarket) PriceFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) PriceFromExtendedChainFormat added in v1.50.0

func (derivativeMarket DerivativeMarket) PriceFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) PriceToChainFormat

func (derivativeMarket DerivativeMarket) PriceToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (DerivativeMarket) QuantityFromChainFormat

func (derivativeMarket DerivativeMarket) QuantityFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) QuantityFromExtendedChainFormat added in v1.50.0

func (derivativeMarket DerivativeMarket) QuantityFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (DerivativeMarket) QuantityToChainFormat

func (derivativeMarket DerivativeMarket) QuantityToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

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
	MinNotional         decimal.Decimal
}

func (SpotMarket) NotionalFromChainFormat added in v1.51.1

func (spotMarket SpotMarket) NotionalFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (SpotMarket) NotionalFromExtendedChainFormat added in v1.51.1

func (spotMarket SpotMarket) NotionalFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (SpotMarket) NotionalToChainFormat added in v1.51.1

func (spotMarket SpotMarket) NotionalToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (SpotMarket) PriceFromChainFormat

func (spotMarket SpotMarket) PriceFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (SpotMarket) PriceFromExtendedChainFormat added in v1.50.0

func (spotMarket SpotMarket) PriceFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (SpotMarket) PriceToChainFormat

func (spotMarket SpotMarket) PriceToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

func (SpotMarket) QuantityFromChainFormat

func (spotMarket SpotMarket) QuantityFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (SpotMarket) QuantityFromExtendedChainFormat added in v1.50.0

func (spotMarket SpotMarket) QuantityFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal

func (SpotMarket) QuantityToChainFormat

func (spotMarket SpotMarket) QuantityToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec

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

type TokenMetadata added in v1.51.0

type TokenMetadata struct {
	Address           string `json:"address"`
	IsNative          bool   `json:"isNative"`
	TokenVerification string `json:"tokenVerification"`
	Decimals          int32  `json:"decimals"`
	CoinGeckoId       string `json:"coinGeckoId"`
	Name              string `json:"name"`
	Symbol            string `json:"symbol"`
	Creator           string `json:"creator"`
	Denom             string `json:"denom"`
	TokenType         string `json:"tokenType"`
}

func LoadTokens added in v1.51.0

func LoadTokens(tokensFileURL string) ([]TokenMetadata, error)

LoadTokens loads tokens from the given file URL

func (TokenMetadata) GetAddress added in v1.51.0

func (tm TokenMetadata) GetAddress() string

func (TokenMetadata) GetDecimals added in v1.51.0

func (tm TokenMetadata) GetDecimals() int32
func (tm TokenMetadata) GetLogo() string

func (TokenMetadata) GetName added in v1.51.0

func (tm TokenMetadata) GetName() string

func (TokenMetadata) GetSymbol added in v1.51.0

func (tm TokenMetadata) GetSymbol() string

func (TokenMetadata) GetUpdatedAt added in v1.51.0

func (tm TokenMetadata) GetUpdatedAt() int64

Jump to

Keyboard shortcuts

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