types

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "full_node_streaming"
)

Variables

View Source
var (
	ErrNotImplemented          = errorsmod.Register(ModuleName, 1, "Not implemented")
	ErrInvalidStreamingRequest = errorsmod.Register(
		ModuleName,
		2,
		"Invalid full node streaming request",
	)
	ErrInvalidSubaccountFilteringRequest = errorsmod.Register(
		ModuleName,
		3,
		"Invalid subaccount ID filtering request",
	)
)

Functions

This section is empty.

Types

type FullNodeStreamingManager

type FullNodeStreamingManager interface {
	Enabled() bool
	Stop()

	// Subscribe to streams
	Subscribe(
		clobPairIds []uint32,
		subaccountIds []*satypes.SubaccountId,
		marketIds []uint32,
		filterOrdersBySubaccountId bool,
		srv OutgoingMessageSender,
	) (
		err error,
	)

	// L3+ Orderbook updates.
	InitializeNewStreams(
		getOrderbookSnapshot func(clobPairId clobtypes.ClobPairId) *clobtypes.OffchainUpdates,
		subaccountSnapshots map[satypes.SubaccountId]*satypes.StreamSubaccountUpdate,
		priceSnapshots map[uint32]*pricestypes.StreamPriceUpdate,
		blockHeight uint32,
		execMode sdk.ExecMode,
	)
	GetSubaccountSnapshotsForInitStreams(
		getSubaccountSnapshot func(subaccountId satypes.SubaccountId) *satypes.StreamSubaccountUpdate,
	) map[satypes.SubaccountId]*satypes.StreamSubaccountUpdate
	GetPriceSnapshotsForInitStreams(
		getPriceSnapshot func(marketId uint32) *pricestypes.StreamPriceUpdate,
	) map[uint32]*pricestypes.StreamPriceUpdate
	SendOrderbookUpdates(
		offchainUpdates *clobtypes.OffchainUpdates,
		ctx sdk.Context,
	)
	SendOrderbookFillUpdate(
		orderbookFill clobtypes.StreamOrderbookFill,
		ctx sdk.Context,
		perpetualIdToClobPairId map[uint32][]clobtypes.ClobPairId,
	)
	SendTakerOrderStatus(
		takerOrder clobtypes.StreamTakerOrder,
		ctx sdk.Context,
	)
	SendSubaccountUpdate(
		ctx sdk.Context,
		subaccountUpdate satypes.StreamSubaccountUpdate,
	)
	SendPriceUpdate(
		ctx sdk.Context,
		priceUpdate pricestypes.StreamPriceUpdate,
	)
	GetStagedFinalizeBlockEvents(
		ctx sdk.Context,
	) []clobtypes.StagedFinalizeBlockEvent
	TracksSubaccountId(id satypes.SubaccountId) bool
	TracksMarketId(marketId uint32) bool
	StreamBatchUpdatesAfterFinalizeBlock(
		ctx sdk.Context,
		orderBookUpdatesToSyncLocalOpsQueue *clobtypes.OffchainUpdates,
		perpetualIdToClobPairId map[uint32][]clobtypes.ClobPairId,
	)
}

type OutgoingMessageSender

type OutgoingMessageSender interface {
	Send(*clobtypes.StreamOrderbookUpdatesResponse) error
}

Jump to

Keyboard shortcuts

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