types

package
v0.19.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookRes

type BookRes struct {
	Asks      [][]string `json:"asks"`
	Bids      [][]string `json:"bids"`
	Product   string     `json:"instrument_id"`
	Timestamp string     `json:"timestamp"`
}

func ConvertBookRes

func ConvertBookRes(product string, orderKeeper types.OrderKeeper, depthBook *order.DepthBook, size int) BookRes

type BookResItem

type BookResItem struct {
	Price      string `json:"price"`
	Quantity   string `json:"quantity"`
	OrderCount string `json:"order_count"`
}

type RedisBlock

type RedisBlock struct {
	Height        int64                      `json:"height"`
	OrdersMap     map[string][]backend.Order `json:"orders"`
	DepthBooksMap map[string]BookRes         `json:"depthBooks"`

	AccountsMap map[string]token.CoinInfo      `json:"accounts"`
	Instruments map[string]struct{}            `json:"instruments"`
	MatchesMap  map[string]backend.MatchResult `json:"matches"`
}

func NewRedisBlock

func NewRedisBlock() *RedisBlock

func (RedisBlock) BlockHeight

func (rb RedisBlock) BlockHeight() int64

BlockHeight impl IsStreamData interface

func (*RedisBlock) Clear

func (rb *RedisBlock) Clear()

func (RedisBlock) DataType

func (rb RedisBlock) DataType() types.StreamDataKind

func (*RedisBlock) Empty

func (rb *RedisBlock) Empty() bool

func (*RedisBlock) SetData

func (rb *RedisBlock) SetData(ctx sdk.Context, orderKeeper types.OrderKeeper, tokenKeeper types.TokenKeeper, dexKeeper types.DexKeeper, swapKeeper types.SwapKeeper, cache *common.Cache)

func (RedisBlock) String

func (rb RedisBlock) String() string

type Writer

type Writer interface {
	WriteSync(b *RedisBlock) (map[string]int, error) // atomic operation
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL