Versions in this module Expand all Collapse all v0 v0.11.1 Mar 16, 2021 v0.10.1 Mar 16, 2021 Changes in this version + const DefaultBookSize + func GetDealFee(order *types.Order, fillAmt sdk.Dec, ctx sdk.Context, keeper GetFeeKeeper, ...) sdk.SysCoins + func GetOrderCostFee(order *types.Order, ctx sdk.Context) sdk.SysCoins + func GetOrderNewFee(order *types.Order) sdk.SysCoins + func GetZeroFee() sdk.SysCoins + func MakeTestCodec() *codec.Codec + func ModuleAccountInvariant(keeper Keeper) sdk.Invariant + func NewQuerier(keeper Keeper) sdk.Querier + func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper) + type BookRes struct + Asks []BookResItem + Bids []BookResItem + type BookResItem struct + Price string + Quantity string + type Cache struct + func NewCache() *Cache + func (c *Cache) DecreaseCancelNum() int64 + func (c *Cache) DecreaseFullFillNum() int64 + func (c *Cache) DecreasePartialFillNum() int64 + func (c *Cache) GetCancelNum() int64 + func (c *Cache) GetExpireNum() int64 + func (c *Cache) GetFullFillNum() int64 + func (c *Cache) GetPartialFillNum() int64 + func (c *Cache) IncreaseCancelNum() int64 + func (c *Cache) IncreaseExpireNum() int64 + func (c *Cache) IncreaseFullFillNum() int64 + func (c *Cache) IncreasePartialFillNum() int64 + type DepthBookMap struct + type DexKeeper interface + CheckTokenPairUnderDexDelist func(ctx sdk.Context, product string) (isDelisting bool, err error) + GetLockedProductsCopy func(ctx sdk.Context) *types.ProductLockMap + GetOperator func(ctx sdk.Context, addr sdk.AccAddress) (operator dex.DEXOperator, isExist bool) + GetTokenPair func(ctx sdk.Context, product string) *dex.TokenPair + GetTokenPairs func(ctx sdk.Context) []*dex.TokenPair + IsAnyProductLocked func(ctx sdk.Context) bool + IsTokenPairLocked func(ctx sdk.Context, product string) bool + LockTokenPair func(ctx sdk.Context, product string, lock *types.ProductLock) + SaveTokenPair func(ctx sdk.Context, tokenPair *dex.TokenPair) error + SortProducts func(ctx sdk.Context, products []string) + UnlockTokenPair func(ctx sdk.Context, product string) + UpdateTokenPair func(ctx sdk.Context, product string, tokenPair *dex.TokenPair) + type DiskCache struct + func (c *DiskCache) DecreaseStoreOrderNum(num int64) int64 + func (c *DiskCache) GetClosedOrderIDs() []string + func (c *DiskCache) GetNewDepthbookKeys() []string + func (c *DiskCache) GetOrderIDsMapCopy() *OrderIDsMap + func (c *DiskCache) GetUpdatedDepthbookKeys() []string + func (c *DiskCache) GetUpdatedOrderIDKeys() []string + type GetFeeKeeper interface + GetLastPrice func(ctx sdk.Context, product string) sdk.Dec + type Keeper struct + func NewKeeper(tokenKeeper TokenKeeper, supplyKeeper SupplyKeeper, dexKeeper DexKeeper, ...) Keeper + func (k Keeper) AddCollectedFees(ctx sdk.Context, coins sdk.SysCoins, from sdk.AccAddress, feeType string, ...) error + func (k Keeper) AddFeeDetail(ctx sdk.Context, from sdk.AccAddress, coins sdk.SysCoins, feeType string) + func (k Keeper) AddTxHandlerMsgResult(resultSet bitset.BitSet) + func (k Keeper) AnyProductLocked(ctx sdk.Context) bool + func (k Keeper) BalanceAccount(ctx sdk.Context, addr sdk.AccAddress, outputCoins sdk.SysCoins, ...) + func (k Keeper) Cache2Disk(ctx sdk.Context) + func (k Keeper) CancelOrder(ctx sdk.Context, order *types.Order, logger log.Logger) sdk.SysCoins + func (k Keeper) DropBlockOrderNum(ctx sdk.Context, blockHeight int64) + func (k Keeper) DropExpireBlockHeight(ctx sdk.Context, blockHeight int64) + func (k Keeper) DropExpiredOrdersByBlockHeight(ctx sdk.Context, expiredBlockHeight int64) + func (k Keeper) DropOrder(ctx sdk.Context, orderID string) + func (k Keeper) DumpStore(ctx sdk.Context) + func (k Keeper) ExpireOrder(ctx sdk.Context, order *types.Order, logger log.Logger) + func (k Keeper) FilterDelistedProducts(ctx sdk.Context, products []string) []string + func (k Keeper) GetBestBidAndAsk(ctx sdk.Context, product string) (sdk.Dec, sdk.Dec) + func (k Keeper) GetBlockMatchResult() *types.BlockMatchResult + func (k Keeper) GetBlockOrderNum(ctx sdk.Context, blockHeight int64) int64 + func (k Keeper) GetCache() *Cache + func (k Keeper) GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.SysCoins + func (k Keeper) GetDepthBookCopy(product string) *types.DepthBook + func (k Keeper) GetDepthBookFromDB(ctx sdk.Context, product string) *types.DepthBook + func (k Keeper) GetDexKeeper() DexKeeper + func (k Keeper) GetDiskCache() *DiskCache + func (k Keeper) GetExpireBlockHeight(ctx sdk.Context, blockHeight int64) []int64 + func (k Keeper) GetLastClosedOrderIDs(ctx sdk.Context) []string + func (k Keeper) GetLastExpiredBlockHeight(ctx sdk.Context) int64 + func (k Keeper) GetLastPrice(ctx sdk.Context, product string) sdk.Dec + func (k Keeper) GetMetric() *monitor.OrderMetric + func (k Keeper) GetOpenOrderNum(ctx sdk.Context) int64 + func (k Keeper) GetOperationMetric() OrderOperationMetric + func (k Keeper) GetOrder(ctx sdk.Context, orderID string) *types.Order + func (k Keeper) GetParams(ctx sdk.Context) *types.Params + func (k Keeper) GetProductFeeReceiver(ctx sdk.Context, product string) (sdk.AccAddress, error) + func (k Keeper) GetProductPriceOrderIDs(key string) []string + func (k Keeper) GetProductPriceOrderIDsFromDB(ctx sdk.Context, key string) []string + func (k Keeper) GetProductsFromDepthBookMap() []string + func (k Keeper) GetStoreOrderNum(ctx sdk.Context) int64 + func (k Keeper) GetTokenKeeper() TokenKeeper + func (k Keeper) GetTxHandlerMsgResult() []bitset.BitSet + func (k Keeper) GetUpdatedDepthbookKeys() []string + func (k Keeper) GetUpdatedOrderIDs() []string + func (k Keeper) InsertOrderIntoDepthBook(order *types.Order) + func (k Keeper) IsProductLocked(ctx sdk.Context, product string) bool + func (k Keeper) LockCoins(ctx sdk.Context, addr sdk.AccAddress, coins sdk.SysCoins, lockCoinsType int) error + func (k Keeper) PlaceOrder(ctx sdk.Context, order *types.Order) error + func (k Keeper) RemoveOrderFromDepthBook(order *types.Order, feeType string) + func (k Keeper) ResetCache(ctx sdk.Context) + func (k Keeper) SendFeesToProductOwner(ctx sdk.Context, coins sdk.SysCoins, from sdk.AccAddress, feeType string, ...) (feeReceiver string, err error) + func (k Keeper) SetBlockMatchResult(result *types.BlockMatchResult) + func (k Keeper) SetBlockOrderNum(ctx sdk.Context, blockHeight int64, orderNum int64) + func (k Keeper) SetDepthBook(product string, book *types.DepthBook) + func (k Keeper) SetExpireBlockHeight(ctx sdk.Context, blockHeight int64, expireBlockHeight []int64) + func (k Keeper) SetLastClosedOrderIDs(ctx sdk.Context, orderIDs []string) + func (k Keeper) SetLastExpiredBlockHeight(ctx sdk.Context, expiredBlockHeight int64) + func (k Keeper) SetLastPrice(ctx sdk.Context, product string, price sdk.Dec) + func (k Keeper) SetMetric() + func (k Keeper) SetOrder(ctx sdk.Context, orderID string, order *types.Order) + func (k Keeper) SetOrderIDs(key string, orderIDs []string) + func (k Keeper) SetParams(ctx sdk.Context, params *types.Params) + func (k Keeper) SetProductLock(ctx sdk.Context, product string, lock *types.ProductLock) + func (k Keeper) StoreDepthBook(ctx sdk.Context, product string, depthBook *types.DepthBook) + func (k Keeper) StoreOrderIDsMap(ctx sdk.Context, key string, orderIDs []string) + func (k Keeper) TryPlaceOrder(ctx sdk.Context, order *types.Order) (fee sdk.SysCoins, err error) + func (k Keeper) UnlockCoins(ctx sdk.Context, addr sdk.AccAddress, coins sdk.SysCoins, lockCoinsType int) + func (k Keeper) UnlockProduct(ctx sdk.Context, product string) + func (k Keeper) UpdateOrder(order *types.Order, ctx sdk.Context) + type OrderIDsMap struct + Data map[string][]string + type OrderOperationMetric struct + CancelNum int64 + ExpireNum int64 + FullFillNum int64 + OpenNum int64 + PartialFillNum int64 + type QueryDepthBookParams struct + Product string + Size uint + func NewQueryDepthBookParams(product string, size uint) QueryDepthBookParams + type StoreStatistic struct + BookOrderIDsNum map[string]int64 + DepthBookNum map[string]int64 + StoreOrderNum int64 + type SupplyKeeper interface + GetModuleAccount func(ctx sdk.Context, moduleName string) exported.ModuleAccountI + GetModuleAddress func(moduleName string) sdk.AccAddress + MintCoins func(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error + SendCoinsFromAccountToModule func(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, ...) sdk.Error + SendCoinsFromModuleToAccount func(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) sdk.Error + type TestInput struct + AccountKeeper auth.AccountKeeper + Cdc *codec.Codec + Ctx sdk.Context + DexKeeper dex.Keeper + OrderKeeper Keeper + SupplyKeeper supply.Keeper + TestAddrs []sdk.AccAddress + TokenKeeper token.Keeper + func CreateTestInput(t *testing.T) TestInput + func CreateTestInputWithBalance(t *testing.T, numAddrs, initQuantity int64) TestInput + type TokenKeeper interface + AddFeeDetail func(ctx sdk.Context, from string, fee sdk.SysCoins, feeType string, ...) + BalanceAccount func(ctx sdk.Context, addr sdk.AccAddress, outputCoins sdk.SysCoins, ...) error + GetAllLockedCoins func(ctx sdk.Context) (locks []token.AccCoins) + GetCoins func(ctx sdk.Context, addr sdk.AccAddress) sdk.SysCoins + IterateLockedFees func(ctx sdk.Context, cb func(acc sdk.AccAddress, coins sdk.SysCoins) (stop bool)) + LockCoins func(ctx sdk.Context, addr sdk.AccAddress, coins sdk.SysCoins, lockCoinsType int) error + SendCoinsFromAccountToAccount func(ctx sdk.Context, from, to sdk.AccAddress, amt sdk.SysCoins) error + UnlockCoins func(ctx sdk.Context, addr sdk.AccAddress, coins sdk.SysCoins, lockCoinsType int) error