Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SolanaRawUpdate ¶
type SolanaRawUpdate struct { Data *solanaws.AccountResult Side gserum.Side }
type SolanaUpdate ¶
type SolanaUpdate struct { Side gserum.Side Orders []*pb.OrderbookItem // contains filtered or unexported fields }
func (SolanaUpdate) IsRedundant ¶
func (s SolanaUpdate) IsRedundant() bool
type Source ¶
type Source[T any, R any] interface { // Name returns an identifier for the source for printing Name() string // Run collects stream updates for the context duration. Run should avoid doing any other work besides collecting updates, so as to have accurate timestamps. Run(context.Context) ([]StreamUpdate[T], error) // Process deserializes the messages received by Run into useful formats for comparison. Process(updates []StreamUpdate[T], removeDuplicates bool) (map[int][]ProcessedUpdate[R], map[int][]ProcessedUpdate[R], error) }
Source represents any streaming interface that provides timestamped updates for comparison.
func NewAPIOrderbookStream ¶
func NewAPIOrderbookStream(address, market, authHeader string) (Source[[]byte, TraderAPIUpdate], error)
func NewSolanaOrderbookStream ¶
func NewSolanaOrderbookStream(ctx context.Context, rpcAddress string, wsAddress, marketAddr string) (Source[SolanaRawUpdate, SolanaUpdate], error)
type StreamUpdate ¶
func NewStreamUpdate ¶
func NewStreamUpdate[T any](data T) StreamUpdate[T]
type TraderAPIUpdate ¶
type TraderAPIUpdate struct { Asks []*pb.OrderbookItem Bids []*pb.OrderbookItem // contains filtered or unexported fields }
func (TraderAPIUpdate) IsRedundant ¶
func (s TraderAPIUpdate) IsRedundant() bool
Click to show internal directories.
Click to hide internal directories.