{"modulePath":"github.com/QuantProcessing/exchanges","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package venue\n\nPackage venue defines platform-facing ports implemented by exchange adapters.\n\n## Variables\n\n```go\nvar ErrUnknownVenue = errors.New(\"unknown venue\")\n```\n\n## Functions\n\n```go\nfunc Register(v model.Venue, ctor Constructor)\n```\n\n## Types\n\n```go\ntype AccountCapabilities struct {\n\tSnapshot bool\n}\n```\n\n```go\ntype Adapter interface {\n\tVenue() model.Venue\n\tInstruments() InstrumentProvider\n\tData() DataClient\n\tExecution() ExecutionClient\n\tCapabilities() DeclaredCapabilities\n\tClose(context.Context) error\n}\n```\n\n```go\nfunc Open(ctx context.Context, v model.Venue, cfg map[string]string) (Adapter, error)\n```\n\n```go\ntype Constructor func(context.Context, map[string]string) (Adapter, error)\n```\n\n```go\ntype DataClient interface {\n\tVenue() model.Venue\n\tClientID() string\n\tInstruments() InstrumentProvider\n\tConnect(context.Context) error\n\tDisconnect(context.Context) error\n\tHealth() DataHealth\n\tFetchTicker(context.Context, model.InstrumentID) (model.Ticker, error)\n\tFetchOrderBook(context.Context, model.InstrumentID, int) (model.OrderBook, error)\n}\n```\n\n```go\ntype DataHealth struct {\n\tConnected       bool\n\tInstrumentReady bool\n\tLastEventTime   time.Time\n\tLastError       error\n}\n```\n\n```go\ntype DeclaredCapabilities struct {\n\tVenue       model.Venue\n\tInstruments bool\n\tMarketData  MarketDataCapabilities\n\tExecution   ExecutionCapabilities\n\tAccount     AccountCapabilities\n}\n```\n\n```go\ntype ExecutionCapabilities struct {\n\tSubmit          bool\n\tCancel          bool\n\tModify          bool\n\tQuery           bool\n\tOrderReports    bool\n\tFillReports     bool\n\tPositionReports bool\n\tPrivateStream   bool\n\tResubscribe     bool\n\tMassStatus      bool\n\tOrderLists      bool\n}\n```\n\n```go\ntype ExecutionClient interface {\n\tVenue() model.Venue\n\tAccountID() model.AccountID\n\tConnect(context.Context) error\n\tDisconnect(context.Context) error\n\tHealth() ExecutionHealth\n\tQueryAccount(context.Context) (model.AccountSnapshot, error)\n\tSubmitOrder(context.Context, model.SubmitOrder) (model.OrderStatusReport, error)\n\tCancelOrder(context.Context, model.CancelOrder) (model.OrderStatusReport, error)\n\tGenerateOrderStatusReports(context.Context, model.InstrumentID) ([]model.OrderStatusReport, error)\n\tEvents() \u003c-chan model.ExecutionEvent\n}\n```\n\n```go\ntype ExecutionHealth struct {\n\tConnected     bool\n\tAccountReady  bool\n\tLastEventTime time.Time\n\tLastError     error\n}\n```\n\n```go\ntype ExecutionMassStatusGenerator interface {\n\tGenerateExecutionMassStatus(context.Context, model.GenerateExecutionMassStatus) (model.ExecutionMassStatus, error)\n}\n```\n\n```go\ntype ExecutionResubscriber interface {\n\tResubscribeExecution(context.Context) error\n}\n```\n\n```go\ntype FillReportGenerator interface {\n\tGenerateFillReports(context.Context, model.InstrumentID) ([]model.FillReport, error)\n}\n```\n\n```go\ntype FundingRateProvider interface {\n\tFetchFundingRate(context.Context, model.InstrumentID) (model.FundingRate, error)\n}\n```\n\n```go\ntype InstrumentProvider interface {\n\tLoadAll(context.Context) error\n\tGet(model.InstrumentID) (model.Instrument, bool)\n\tList() []model.Instrument\n}\n```\n\n```go\ntype MarketDataCapabilities struct {\n\tSnapshots         bool\n\tTicker            bool\n\tOrderBook         bool\n\tTickerStream      bool\n\tOrderBookStream   bool\n\tTradeTicks        bool\n\tQuoteTicks        bool\n\tBars              bool\n\tFundingRates      bool\n\tFundingRateStream bool\n\tStreams           bool\n}\n```\n\n```go\ntype OrderListSubmitter interface {\n\tSubmitOrderList(context.Context, model.SubmitOrderList) ([]model.OrderStatusReport, error)\n}\n```\n\n```go\ntype OrderModifier interface {\n\tModifyOrder(context.Context, model.ModifyOrder) (model.OrderStatusReport, error)\n}\n```\n\n```go\ntype OrderQuerier interface {\n\tQueryOrder(context.Context, model.QueryOrder) (model.OrderStatusReport, error)\n}\n```\n\n```go\ntype PositionStatusReportGenerator interface {\n\tGeneratePositionStatusReports(context.Context, model.InstrumentID) ([]model.PositionStatusReport, error)\n}\n```\n\n```go\ntype Registry struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewRegistry() *Registry\n```\n\n```go\nfunc (r *Registry) Open(ctx context.Context, venue model.Venue, cfg map[string]string) (Adapter, error)\n```\n\n```go\nfunc (r *Registry) Register(venue model.Venue, ctor Constructor)\n```\n\n```go\ntype StreamingDataClient interface {\n\tSubscribeMarketData(context.Context, model.SubscribeMarketData) error\n\tUnsubscribeMarketData(context.Context, model.SubscribeMarketData) error\n\tEvents() \u003c-chan model.MarketEvent\n}\n```\n\n","path":"github.com/QuantProcessing/exchanges/venue","name":"venue","synopsis":"Package venue defines platform-facing ports implemented by exchange adapters.","isRedistributable":true}
