Documentation
¶
Index ¶
- Constants
- type DerivativeMarket
- func (derivativeMarket DerivativeMarket) CalculateMarginInChainFormat(humanReadableQuantity, humanReadablePrice, leverage decimal.Decimal) sdkmath.LegacyDec
- func (derivativeMarket DerivativeMarket) MarginFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) MarginFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) MarginToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec
- func (derivativeMarket DerivativeMarket) NotionalFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) NotionalFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) NotionalToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec
- func (derivativeMarket DerivativeMarket) PriceFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) PriceFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) PriceToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec
- func (derivativeMarket DerivativeMarket) QuantityFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) QuantityFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (derivativeMarket DerivativeMarket) QuantityToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec
- type SpotMarket
- func (spotMarket SpotMarket) NotionalFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (spotMarket SpotMarket) NotionalFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (spotMarket SpotMarket) NotionalToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec
- func (spotMarket SpotMarket) PriceFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (spotMarket SpotMarket) PriceFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (spotMarket SpotMarket) PriceToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec
- func (spotMarket SpotMarket) QuantityFromChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (spotMarket SpotMarket) QuantityFromExtendedChainFormat(chainValue sdkmath.LegacyDec) decimal.Decimal
- func (spotMarket SpotMarket) QuantityToChainFormat(humanReadableValue decimal.Decimal) sdkmath.LegacyDec
- type Token
- type TokenMetadata
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
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 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"`
Logo string `json:"logo"`
Creator string `json:"creator"`
Denom string `json:"denom"`
TokenType string `json:"tokenType"`
ExternalLogo string `json:"externalLogo"`
}
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 (TokenMetadata) GetLogo ¶ added in v1.51.0
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
Click to show internal directories.
Click to hide internal directories.