venue

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package venue defines platform-facing ports implemented by exchange adapters.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownVenue = errors.New("unknown venue")

Functions

func Register

func Register(v model.Venue, ctor Constructor)

Types

type AccountCapabilities

type AccountCapabilities struct {
	Snapshot bool
}

type Adapter

type Adapter interface {
	Venue() model.Venue
	Instruments() InstrumentProvider
	Data() DataClient
	Execution() ExecutionClient
	Capabilities() DeclaredCapabilities
	Close(context.Context) error
}

func Open

func Open(ctx context.Context, v model.Venue, cfg map[string]string) (Adapter, error)

type Constructor

type Constructor func(context.Context, map[string]string) (Adapter, error)

type DataClient

type DataClient interface {
	Venue() model.Venue
	ClientID() string
	Instruments() InstrumentProvider
	Connect(context.Context) error
	Disconnect(context.Context) error
	Health() DataHealth
	FetchTicker(context.Context, model.InstrumentID) (model.Ticker, error)
	FetchOrderBook(context.Context, model.InstrumentID, int) (model.OrderBook, error)
}

type DataHealth

type DataHealth struct {
	Connected       bool
	InstrumentReady bool
	LastEventTime   time.Time
	LastError       error
}

type DeclaredCapabilities

type DeclaredCapabilities struct {
	Venue       model.Venue
	Instruments bool
	MarketData  MarketDataCapabilities
	Execution   ExecutionCapabilities
	Account     AccountCapabilities
}

type ExecutionCapabilities

type ExecutionCapabilities struct {
	Submit          bool
	Cancel          bool
	Modify          bool
	Query           bool
	OrderReports    bool
	FillReports     bool
	PositionReports bool
	PrivateStream   bool
	Resubscribe     bool
	MassStatus      bool
	OrderLists      bool
}

type ExecutionClient

type ExecutionClient interface {
	Venue() model.Venue
	AccountID() model.AccountID
	Connect(context.Context) error
	Disconnect(context.Context) error
	Health() ExecutionHealth
	QueryAccount(context.Context) (model.AccountSnapshot, error)
	SubmitOrder(context.Context, model.SubmitOrder) (model.OrderStatusReport, error)
	CancelOrder(context.Context, model.CancelOrder) (model.OrderStatusReport, error)
	GenerateOrderStatusReports(context.Context, model.InstrumentID) ([]model.OrderStatusReport, error)
	Events() <-chan model.ExecutionEvent
}

type ExecutionHealth

type ExecutionHealth struct {
	Connected     bool
	AccountReady  bool
	LastEventTime time.Time
	LastError     error
}

type ExecutionMassStatusGenerator

type ExecutionMassStatusGenerator interface {
	GenerateExecutionMassStatus(context.Context, model.GenerateExecutionMassStatus) (model.ExecutionMassStatus, error)
}

type ExecutionResubscriber

type ExecutionResubscriber interface {
	ResubscribeExecution(context.Context) error
}

type FillReportGenerator

type FillReportGenerator interface {
	GenerateFillReports(context.Context, model.InstrumentID) ([]model.FillReport, error)
}

type FundingRateProvider

type FundingRateProvider interface {
	FetchFundingRate(context.Context, model.InstrumentID) (model.FundingRate, error)
}

type InstrumentProvider

type InstrumentProvider interface {
	LoadAll(context.Context) error
	Get(model.InstrumentID) (model.Instrument, bool)
	List() []model.Instrument
}

type MarketDataCapabilities

type MarketDataCapabilities struct {
	Snapshots         bool
	Ticker            bool
	OrderBook         bool
	TickerStream      bool
	OrderBookStream   bool
	TradeTicks        bool
	QuoteTicks        bool
	Bars              bool
	FundingRates      bool
	FundingRateStream bool
	Streams           bool
}

type OrderListSubmitter

type OrderListSubmitter interface {
	SubmitOrderList(context.Context, model.SubmitOrderList) ([]model.OrderStatusReport, error)
}

type OrderModifier

type OrderModifier interface {
	ModifyOrder(context.Context, model.ModifyOrder) (model.OrderStatusReport, error)
}

type OrderQuerier

type OrderQuerier interface {
	QueryOrder(context.Context, model.QueryOrder) (model.OrderStatusReport, error)
}

type PositionStatusReportGenerator

type PositionStatusReportGenerator interface {
	GeneratePositionStatusReports(context.Context, model.InstrumentID) ([]model.PositionStatusReport, error)
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Open

func (r *Registry) Open(ctx context.Context, venue model.Venue, cfg map[string]string) (Adapter, error)

func (*Registry) Register

func (r *Registry) Register(venue model.Venue, ctor Constructor)

type StreamingDataClient

type StreamingDataClient interface {
	SubscribeMarketData(context.Context, model.SubscribeMarketData) error
	UnsubscribeMarketData(context.Context, model.SubscribeMarketData) error
	Events() <-chan model.MarketEvent
}

Jump to

Keyboard shortcuts

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