Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) CalculateMedianPrice(prices []types.CurrentPrice) sdk.Dec
- func (k Keeper) GetAuthorizedAddresses(ctx sdk.Context) []sdk.AccAddress
- func (k Keeper) GetCurrentPrice(ctx sdk.Context, token0 string, token1 string) (currPrice types.CurrentPrice, err error)
- func (k Keeper) GetCurrentPrices(ctx sdk.Context) types.CurrentPrices
- func (k Keeper) GetCurrentTWAPPrice(ctx sdk.Context, token0 string, token1 string) (types.CurrentPrice, error)
- func (k Keeper) GetOracle(ctx sdk.Context, pairID string, address sdk.AccAddress) (sdk.AccAddress, error)
- func (k Keeper) GetOracles(ctx sdk.Context, pairID string) ([]sdk.AccAddress, error)
- func (k Keeper) GetPair(ctx sdk.Context, pairID string) (types.Pair, bool)
- func (k Keeper) GetPairs(ctx sdk.Context) types.Pairs
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetRawPrices(ctx sdk.Context, marketId string) types.PostedPrices
- func (k Keeper) IterateCurrentPrices(ctx sdk.Context, cb func(cp types.CurrentPrice) (stop bool))
- func (k Keeper) IterateRawPricesByPair(ctx sdk.Context, marketId string, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Oracles(goCtx context.Context, req *types.QueryOraclesRequest) (*types.QueryOraclesResponse, error)
- func (k Keeper) Pairs(goCtx context.Context, req *types.QueryPairsRequest) (*types.QueryPairsResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Price(goCtx context.Context, req *types.QueryPriceRequest) (*types.QueryPriceResponse, error)
- func (k Keeper) Prices(goCtx context.Context, req *types.QueryPricesRequest) (*types.QueryPricesResponse, error)
- func (k Keeper) RawPrices(goCtx context.Context, req *types.QueryRawPricesRequest) (*types.QueryRawPricesResponse, error)
- func (k Keeper) SetCurrentPrices(ctx sdk.Context, token0 string, token1 string) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPrice(ctx sdk.Context, oracle sdk.AccAddress, token0 string, token1 string, ...) (types.PostedPrice, error)
- func (k Keeper) SimSetPrice(ctx sdk.Context, token0 string, token1 string, price sdk.Dec) (types.PostedPrice, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, ) Keeper
func (Keeper) CalculateMedianPrice ¶
func (k Keeper) CalculateMedianPrice(prices []types.CurrentPrice) sdk.Dec
CalculateMedianPrice calculates the median prices for the input prices.
func (Keeper) GetAuthorizedAddresses ¶
func (k Keeper) GetAuthorizedAddresses(ctx sdk.Context) []sdk.AccAddress
GetAuthorizedAddresses returns a list of addresses that have special authorization within this module, eg the oracles of all markets.
func (Keeper) GetCurrentPrice ¶
func (k Keeper) GetCurrentPrice(ctx sdk.Context, token0 string, token1 string, ) (currPrice types.CurrentPrice, err error)
GetCurrentPrice fetches the current median price of all oracles for a specific market
func (Keeper) GetCurrentPrices ¶
func (k Keeper) GetCurrentPrices(ctx sdk.Context) types.CurrentPrices
GetCurrentPrices returns all current price objects from the store
func (Keeper) GetCurrentTWAPPrice ¶
func (k Keeper) GetCurrentTWAPPrice(ctx sdk.Context, token0 string, token1 string) (types.CurrentPrice, error)
GetCurrentTWAPPrice fetches the current median price of all oracles for a specific market TODO: Replace this with actual TWAP logic
func (Keeper) GetOracle ¶
func (k Keeper) GetOracle( ctx sdk.Context, pairID string, address sdk.AccAddress, ) (sdk.AccAddress, error)
GetOracle returns the oracle from the store or an error if not found
func (Keeper) GetOracles ¶
GetOracles returns the oracles in the pricefeed store
func (Keeper) GetRawPrices ¶
GetRawPrices fetches the set of all prices posted by oracles for an asset
func (Keeper) IterateCurrentPrices ¶
IterateCurrentPrices iterates over all current price objects in the store and performs a callback function
func (Keeper) IterateRawPricesByPair ¶
func (k Keeper) IterateRawPricesByPair(ctx sdk.Context, marketId string, cb func(record types.PostedPrice) (stop bool))
IterateRawPrices iterates over all raw prices in the store and performs a callback function
func (Keeper) Oracles ¶
func (k Keeper) Oracles(goCtx context.Context, req *types.QueryOraclesRequest) (*types.QueryOraclesResponse, error)
func (Keeper) Pairs ¶
func (k Keeper) Pairs(goCtx context.Context, req *types.QueryPairsRequest) (*types.QueryPairsResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Price ¶
func (k Keeper) Price(goCtx context.Context, req *types.QueryPriceRequest) (*types.QueryPriceResponse, error)
func (Keeper) Prices ¶
func (k Keeper) Prices(goCtx context.Context, req *types.QueryPricesRequest) (*types.QueryPricesResponse, error)
func (Keeper) RawPrices ¶
func (k Keeper) RawPrices(goCtx context.Context, req *types.QueryRawPricesRequest) (*types.QueryRawPricesResponse, error)
func (Keeper) SetCurrentPrices ¶
SetCurrentPrices updates the price of an asset to the median of all valid oracle inputs