Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func CanCancelOrderInvariant(k Keeper) sdk.Invariant
- func FitPriceToPriceInterval(price, interval sdk.Dec, roundUp bool) sdk.Dec
- func HandleMarketParameterChangeProposal(ctx sdk.Context, k Keeper, p *types.MarketParameterChangeProposal) error
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NumMMOrdersInvariant(k Keeper) sdk.Invariant
- func OrderBookInvariant(k Keeper) sdk.Invariant
- func OrderBookOrderInvariant(k Keeper) sdk.Invariant
- func OrderStateInvariant(k Keeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Keeper
- func (k Keeper) CancelAllOrders(ctx sdk.Context, ordererAddr sdk.AccAddress, marketId uint64) (orders []types.Order, err error)
- func (k Keeper) CancelExpiredOrders(ctx sdk.Context) (err error)
- func (k Keeper) CancelOrder(ctx sdk.Context, ordererAddr sdk.AccAddress, orderId uint64) (order types.Order, err error)
- func (k Keeper) ConstructMemOrderBookSide(ctx sdk.Context, market types.Market, opts types.MemOrderBookSideOptions, ...) *types.MemOrderBookSide
- func (k Keeper) CreateMarket(ctx sdk.Context, creatorAddr sdk.AccAddress, baseDenom, quoteDenom string) (market types.Market, err error)
- func (k Keeper) DeleteNumMMOrders(ctx sdk.Context, ordererAddr sdk.AccAddress, marketId uint64)
- func (k Keeper) DeleteOrder(ctx sdk.Context, order types.Order)
- func (k Keeper) DeleteOrderBookOrderIndex(ctx sdk.Context, order types.Order)
- func (k Keeper) DeleteOrdersByOrdererIndex(ctx sdk.Context, order types.Order)
- func (k Keeper) EscrowCoins(ctx sdk.Context, market types.Market, addr sdk.AccAddress, amt ...sdk.Coin) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FindAllRoutes(ctx sdk.Context, fromDenom, toDenom string, maxRoutesLen int) (allRoutes [][]uint64)
- func (k Keeper) GetBestOrderPrice(ctx sdk.Context, marketId uint64, isBuy bool) (bestPrice sdk.Dec, found bool)
- func (k Keeper) GetFees(ctx sdk.Context) (fees types.Fees)
- func (k Keeper) GetLastMarketId(ctx sdk.Context) (marketId uint64)
- func (k Keeper) GetLastOrderId(ctx sdk.Context) (orderId uint64)
- func (k Keeper) GetMarket(ctx sdk.Context, marketId uint64) (market types.Market, found bool)
- func (k Keeper) GetMarketCreationFee(ctx sdk.Context) (fee sdk.Coins)
- func (k Keeper) GetMarketIdByDenoms(ctx sdk.Context, baseDenom, quoteDenom string) (marketId uint64, found bool)
- func (k Keeper) GetMarketState(ctx sdk.Context, marketId uint64) (state types.MarketState, found bool)
- func (k Keeper) GetMaxNumMMOrders(ctx sdk.Context) (maxNum uint32)
- func (k Keeper) GetMaxOrderLifespan(ctx sdk.Context) (maxLifespan time.Duration)
- func (k Keeper) GetMaxOrderPriceRatio(ctx sdk.Context) (maxRatio sdk.Dec)
- func (k Keeper) GetMaxSwapRoutesLen(ctx sdk.Context) (maxLen uint32)
- func (k Keeper) GetNextMarketIdWithUpdate(ctx sdk.Context) (marketId uint64)
- func (k Keeper) GetNextOrderIdWithUpdate(ctx sdk.Context) (orderId uint64)
- func (k Keeper) GetNumMMOrders(ctx sdk.Context, ordererAddr sdk.AccAddress, marketId uint64) (num uint32, found bool)
- func (k Keeper) GetOrder(ctx sdk.Context, orderId uint64) (order types.Order, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IterateAllMarkets(ctx sdk.Context, cb func(market types.Market) (stop bool))
- func (k Keeper) IterateAllNumMMOrders(ctx sdk.Context, ...)
- func (k Keeper) IterateAllOrderBookOrderIds(ctx sdk.Context, cb func(orderId uint64) (stop bool))
- func (k Keeper) IterateAllOrders(ctx sdk.Context, cb func(order types.Order) (stop bool))
- func (k Keeper) IterateOrderBookSide(ctx sdk.Context, marketId uint64, isBuy bool, priceLimit *sdk.Dec, ...)
- func (k Keeper) IterateOrderBookSideByMarket(ctx sdk.Context, marketId uint64, isBuy bool, ...)
- func (k Keeper) IterateOrdersByMarket(ctx sdk.Context, marketId uint64, cb func(order types.Order) (stop bool))
- func (k Keeper) IterateOrdersByOrderer(ctx sdk.Context, ordererAddr sdk.AccAddress, ...)
- func (k Keeper) IterateOrdersByOrdererAndMarket(ctx sdk.Context, ordererAddr sdk.AccAddress, marketId uint64, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) LookupMarket(ctx sdk.Context, marketId uint64) (found bool)
- func (k Keeper) LookupOrder(ctx sdk.Context, orderId uint64) (found bool)
- func (k Keeper) LookupOrderBookOrderIndex(ctx sdk.Context, marketId uint64, isBuy bool, price sdk.Dec, orderId uint64) (found bool)
- func (k Keeper) MustGetMarket(ctx sdk.Context, marketId uint64) (market types.Market)
- func (k Keeper) MustGetMarketState(ctx sdk.Context, marketId uint64) types.MarketState
- func (k Keeper) MustGetOrder(ctx sdk.Context, orderId uint64) (order types.Order)
- func (k Keeper) PlaceBatchLimitOrder(ctx sdk.Context, marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, ...) (order types.Order, err error)
- func (k Keeper) PlaceLimitOrder(ctx sdk.Context, marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, ...) (orderId uint64, order types.Order, res types.ExecuteOrderResult, err error)
- func (k Keeper) PlaceMMBatchLimitOrder(ctx sdk.Context, marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, ...) (order types.Order, err error)
- func (k Keeper) PlaceMMLimitOrder(ctx sdk.Context, marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, ...) (orderId uint64, order types.Order, res types.ExecuteOrderResult, err error)
- func (k Keeper) PlaceMarketOrder(ctx sdk.Context, marketId uint64, ordererAddr sdk.AccAddress, isBuy bool, ...) (orderId uint64, res types.ExecuteOrderResult, err error)
- func (k Keeper) ReleaseCoins(ctx sdk.Context, market types.Market, addr sdk.AccAddress, amt ...sdk.Coin) error
- func (k Keeper) RunBatchMatching(ctx sdk.Context, market types.Market) (err error)
- func (k Keeper) SetFees(ctx sdk.Context, fees types.Fees)
- func (k Keeper) SetLastMarketId(ctx sdk.Context, marketId uint64)
- func (k Keeper) SetLastOrderId(ctx sdk.Context, orderId uint64)
- func (k Keeper) SetMarket(ctx sdk.Context, market types.Market)
- func (k Keeper) SetMarketByDenomsIndex(ctx sdk.Context, market types.Market)
- func (k Keeper) SetMarketCreationFee(ctx sdk.Context, fee sdk.Coins)
- func (k Keeper) SetMarketState(ctx sdk.Context, marketId uint64, state types.MarketState)
- func (k Keeper) SetMaxNumMMOrders(ctx sdk.Context, maxNum uint32)
- func (k Keeper) SetMaxOrderLifespan(ctx sdk.Context, maxLifespan time.Duration)
- func (k Keeper) SetMaxOrderPriceRatio(ctx sdk.Context, maxRatio sdk.Dec)
- func (k Keeper) SetMaxSwapRouteLen(ctx sdk.Context, maxLen uint32)
- func (k Keeper) SetNumMMOrders(ctx sdk.Context, ordererAddr sdk.AccAddress, marketId uint64, num uint32)
- func (k Keeper) SetOrder(ctx sdk.Context, order types.Order)
- func (k Keeper) SetOrderBookOrderIndex(ctx sdk.Context, order types.Order)
- func (k *Keeper) SetOrderSources(sources ...types.OrderSource) *Keeper
- func (k Keeper) SetOrdersByOrdererIndex(ctx sdk.Context, order types.Order)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SwapExactAmountIn(ctx sdk.Context, ordererAddr sdk.AccAddress, routes []uint64, ...) (output sdk.DecCoin, results []types.SwapRouteResult, err error)
- type Querier
- func (k Querier) AllMarkets(c context.Context, req *types.QueryAllMarketsRequest) (*types.QueryAllMarketsResponse, error)
- func (k Querier) AllOrders(c context.Context, req *types.QueryAllOrdersRequest) (*types.QueryAllOrdersResponse, error)
- func (k Querier) BestSwapExactAmountInRoutes(c context.Context, req *types.QueryBestSwapExactAmountInRoutesRequest) (*types.QueryBestSwapExactAmountInRoutesResponse, error)
- func (k Querier) MakeMarketResponse(ctx sdk.Context, market types.Market) types.MarketResponse
- func (k Querier) MakeOrderBooks(ctx sdk.Context, market types.Market, maxNumPriceLevels int) []types.OrderBook
- func (k Querier) Market(c context.Context, req *types.QueryMarketRequest) (*types.QueryMarketResponse, error)
- func (k Querier) Order(c context.Context, req *types.QueryOrderRequest) (*types.QueryOrderResponse, error)
- func (k Querier) OrderBook(c context.Context, req *types.QueryOrderBookRequest) (*types.QueryOrderBookResponse, error)
- func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
func CanCancelOrderInvariant ¶
func FitPriceToPriceInterval ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func NumMMOrdersInvariant ¶
func OrderBookInvariant ¶
func OrderBookOrderInvariant ¶
func OrderStateInvariant ¶
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the module's store.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramSpace paramstypes.Subspace, bankKeeper types.BankKeeper, ) Keeper
NewKeeper creates a new Keeper instance.
func (Keeper) CancelAllOrders ¶
func (Keeper) CancelExpiredOrders ¶
func (Keeper) CancelOrder ¶
func (Keeper) ConstructMemOrderBookSide ¶
func (Keeper) CreateMarket ¶
func (Keeper) DeleteNumMMOrders ¶
func (Keeper) DeleteOrderBookOrderIndex ¶
func (Keeper) DeleteOrdersByOrdererIndex ¶
func (Keeper) EscrowCoins ¶
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the module's exported genesis.
func (Keeper) FindAllRoutes ¶
func (Keeper) GetBestOrderPrice ¶
func (Keeper) GetMarketCreationFee ¶
func (Keeper) GetMarketIdByDenoms ¶
func (Keeper) GetMarketState ¶
func (Keeper) GetMaxNumMMOrders ¶
func (Keeper) GetMaxOrderLifespan ¶
func (Keeper) GetMaxOrderPriceRatio ¶
func (Keeper) GetMaxSwapRoutesLen ¶
func (Keeper) GetNextMarketIdWithUpdate ¶
func (Keeper) GetNextOrderIdWithUpdate ¶
func (Keeper) GetNumMMOrders ¶
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the module's state from a provided genesis state.
func (Keeper) IterateAllMarkets ¶
func (Keeper) IterateAllNumMMOrders ¶
func (Keeper) IterateAllOrderBookOrderIds ¶
func (Keeper) IterateAllOrders ¶
func (Keeper) IterateOrderBookSide ¶
func (Keeper) IterateOrderBookSideByMarket ¶
func (Keeper) IterateOrdersByMarket ¶
func (Keeper) IterateOrdersByOrderer ¶
func (Keeper) IterateOrdersByOrdererAndMarket ¶
func (Keeper) LookupMarket ¶
func (Keeper) LookupOrder ¶
func (Keeper) LookupOrderBookOrderIndex ¶
func (Keeper) MustGetMarket ¶
func (Keeper) MustGetMarketState ¶
func (Keeper) MustGetOrder ¶
func (Keeper) PlaceBatchLimitOrder ¶
func (Keeper) PlaceLimitOrder ¶
func (Keeper) PlaceMMBatchLimitOrder ¶
func (Keeper) PlaceMMLimitOrder ¶
func (Keeper) PlaceMarketOrder ¶
func (Keeper) ReleaseCoins ¶
func (Keeper) RunBatchMatching ¶
func (Keeper) SetMarketByDenomsIndex ¶
func (Keeper) SetMarketCreationFee ¶
func (Keeper) SetMarketState ¶
func (Keeper) SetMaxOrderLifespan ¶
func (Keeper) SetMaxOrderPriceRatio ¶
func (Keeper) SetMaxSwapRouteLen ¶
func (Keeper) SetNumMMOrders ¶
func (Keeper) SetOrderBookOrderIndex ¶
func (*Keeper) SetOrderSources ¶
func (k *Keeper) SetOrderSources(sources ...types.OrderSource) *Keeper
func (Keeper) SetOrdersByOrdererIndex ¶
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.
func (Querier) AllMarkets ¶
func (k Querier) AllMarkets(c context.Context, req *types.QueryAllMarketsRequest) (*types.QueryAllMarketsResponse, error)
func (Querier) AllOrders ¶
func (k Querier) AllOrders(c context.Context, req *types.QueryAllOrdersRequest) (*types.QueryAllOrdersResponse, error)
func (Querier) BestSwapExactAmountInRoutes ¶
func (k Querier) BestSwapExactAmountInRoutes(c context.Context, req *types.QueryBestSwapExactAmountInRoutesRequest) (*types.QueryBestSwapExactAmountInRoutesResponse, error)
func (Querier) MakeMarketResponse ¶
func (Querier) MakeOrderBooks ¶
func (Querier) Market ¶
func (k Querier) Market(c context.Context, req *types.QueryMarketRequest) (*types.QueryMarketResponse, error)
func (Querier) Order ¶
func (k Querier) Order(c context.Context, req *types.QueryOrderRequest) (*types.QueryOrderResponse, error)
func (Querier) OrderBook ¶
func (k Querier) OrderBook(c context.Context, req *types.QueryOrderBookRequest) (*types.QueryOrderBookResponse, error)
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the parameters of the module.
Click to show internal directories.
Click to hide internal directories.