Versions in this module Expand all Collapse all v11 v11.0.0 Aug 29, 2022 Changes in this version + const KeySeparator + const ModuleName + const QuerierRoute + const RouterKey + const StoreKey + const TransientStoreKey + var ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + var ErrIntOverflowTwapRecord = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrInvalidLengthTwapRecord = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") + var ErrUnexpectedEndOfGroupTwapRecord = fmt.Errorf("proto: unexpected end of group") + var HistoricalTWAPPoolIndexPrefix = historicalTWAPPoolIndexNoSeparator + KeySeparator + var HistoricalTWAPTimeIndexPrefix = historicalTWAPTimeIndexNoSeparator + KeySeparator + var KeyPruneEpochIdentifier = []byte("PruneEpochIdentifier") + var KeyRecordHistoryKeepPeriod = []byte("RecordHistoryKeepPeriod") + func AccumDiffDivDuration(accumDiff sdk.Dec, timeDelta time.Duration) sdk.Dec + func FormatHistoricalPoolIndexTWAPKey(poolId uint64, accumulatorWriteTime time.Time, denom1, denom2 string) []byte + func FormatHistoricalPoolIndexTimePrefix(poolId uint64, accumulatorWriteTime time.Time) []byte + func FormatHistoricalTimeIndexTWAPKey(accumulatorWriteTime time.Time, poolId uint64, denom1, denom2 string) []byte + func FormatMostRecentTWAPKey(poolId uint64, denom1, denom2 string) []byte + func GetAllUniqueDenomPairs(denoms []string) ([]string, []string) + func LexicographicalOrderDenoms(denom0, denom1 string) (string, string, error) + func MustGetSpotPrice(k AmmInterface, ctx sdk.Context, poolId uint64, baseAssetDenom string, ...) sdk.Dec + func ParamKeyTable() paramtypes.KeyTable + func ParseTimeFromHistoricalPoolIndexKey(key []byte) (time.Time, error) + func ParseTimeFromHistoricalTimeIndexKey(key []byte) time.Time + func SpotPriceTimesDuration(sp sdk.Dec, timeDelta time.Duration) sdk.Dec + type AmmInterface interface + CalculateSpotPrice func(ctx sdk.Context, poolID uint64, baseAssetDenom string, quoteAssetDenom string) (price sdk.Dec, err error) + GetPoolDenoms func(ctx sdk.Context, poolId uint64) (denoms []string, err error) + type GenesisState struct + Params Params + Twaps []TwapRecord + func DefaultGenesis() *GenesisState + func NewGenesisState(params Params, twapRecords []TwapRecord) *GenesisState + func (*GenesisState) Descriptor() ([]byte, []int) + func (*GenesisState) ProtoMessage() + func (g *GenesisState) Validate() error + func (m *GenesisState) GetParams() Params + func (m *GenesisState) GetTwaps() []TwapRecord + func (m *GenesisState) Marshal() (dAtA []byte, err error) + func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) + func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *GenesisState) Reset() + func (m *GenesisState) Size() (n int) + func (m *GenesisState) String() string + func (m *GenesisState) Unmarshal(dAtA []byte) error + func (m *GenesisState) XXX_DiscardUnknown() + func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *GenesisState) XXX_Merge(src proto.Message) + func (m *GenesisState) XXX_Size() int + func (m *GenesisState) XXX_Unmarshal(b []byte) error + type Params struct + PruneEpochIdentifier string + RecordHistoryKeepPeriod time.Duration + func DefaultParams() Params + func NewParams(pruneEpochIdentifier string, recordHistoryKeepPeriod time.Duration) Params + func (*Params) Descriptor() ([]byte, []int) + func (*Params) ProtoMessage() + func (m *Params) GetPruneEpochIdentifier() string + func (m *Params) GetRecordHistoryKeepPeriod() time.Duration + func (m *Params) Marshal() (dAtA []byte, err error) + func (m *Params) MarshalTo(dAtA []byte) (int, error) + func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Params) Reset() + func (m *Params) Size() (n int) + func (m *Params) String() string + func (m *Params) Unmarshal(dAtA []byte) error + func (m *Params) XXX_DiscardUnknown() + func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Params) XXX_Merge(src proto.Message) + func (m *Params) XXX_Size() int + func (m *Params) XXX_Unmarshal(b []byte) error + func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs + func (p Params) Validate() error + type TwapRecord struct + Asset0Denom string + Asset1Denom string + Height int64 + P0ArithmeticTwapAccumulator github_com_cosmos_cosmos_sdk_types.Dec + P0LastSpotPrice github_com_cosmos_cosmos_sdk_types.Dec + P1ArithmeticTwapAccumulator github_com_cosmos_cosmos_sdk_types.Dec + P1LastSpotPrice github_com_cosmos_cosmos_sdk_types.Dec + PoolId uint64 + Time time.Time + func GetAllMostRecentTwapsForPool(store sdk.KVStore, poolId uint64) ([]TwapRecord, error) + func ParseTwapFromBz(bz []byte) (twap TwapRecord, err error) + func (*TwapRecord) Descriptor() ([]byte, []int) + func (*TwapRecord) ProtoMessage() + func (m *TwapRecord) GetAsset0Denom() string + func (m *TwapRecord) GetAsset1Denom() string + func (m *TwapRecord) GetHeight() int64 + func (m *TwapRecord) GetPoolId() uint64 + func (m *TwapRecord) GetTime() time.Time + func (m *TwapRecord) Marshal() (dAtA []byte, err error) + func (m *TwapRecord) MarshalTo(dAtA []byte) (int, error) + func (m *TwapRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *TwapRecord) Reset() + func (m *TwapRecord) Size() (n int) + func (m *TwapRecord) String() string + func (m *TwapRecord) Unmarshal(dAtA []byte) error + func (m *TwapRecord) XXX_DiscardUnknown() + func (m *TwapRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *TwapRecord) XXX_Merge(src proto.Message) + func (m *TwapRecord) XXX_Size() int + func (m *TwapRecord) XXX_Unmarshal(b []byte) error