From 29fe2d8749d72bbf270154a21e5e3a0ebf4907a1 Mon Sep 17 00:00:00 2001 From: chiahung Date: Tue, 11 Feb 2025 17:23:31 +0800 Subject: [PATCH] FEATURE: [exchange] new interface and field for otc --- pkg/types/exchange.go | 4 ++++ pkg/types/order.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/pkg/types/exchange.go b/pkg/types/exchange.go index 0576b706a..dbf7087c9 100644 --- a/pkg/types/exchange.go +++ b/pkg/types/exchange.go @@ -140,6 +140,10 @@ type ExchangeMarketDataService interface { QueryKLines(ctx context.Context, symbol string, interval Interval, options KLineQueryOptions) ([]KLine, error) } +type OTCExchange interface { + RequestForQuote(ctx context.Context, symbol string, side SideType, quantity fixedpoint.Value) (submitOrder SubmitOrder, err error) +} + type CustomIntervalProvider interface { SupportedInterval() map[Interval]int IsSupportedInterval(interval Interval) bool diff --git a/pkg/types/order.go b/pkg/types/order.go index 7b977e5ff..e3a2f62a9 100644 --- a/pkg/types/order.go +++ b/pkg/types/order.go @@ -135,6 +135,9 @@ func (o OrderStatus) Closed() bool { type SubmitOrder struct { ClientOrderID string `json:"clientOrderID,omitempty" db:"client_order_id"` + // QuoteID is for OTC exchange + QuoteID string `json:"quoteID,omitempty" db:"quote_id"` + Symbol string `json:"symbol" db:"symbol"` Side SideType `json:"side" db:"side"` Type OrderType `json:"orderType" db:"order_type"`