From 698b6716eafc7cd446db9d318ee3ce100d3cd8d5 Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 15 Jun 2023 10:19:44 +1000 Subject: [PATCH] okx: REST orderbook depth fix (#1228) * orderbook depth fix * more data, more power * fx splln misteaks --- contrib/spellcheck/exclude_lines.txt | 1 + exchanges/okx/okx_test.go | 2 +- exchanges/okx/okx_types.go | 2 +- exchanges/okx/okx_wrapper.go | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/spellcheck/exclude_lines.txt b/contrib/spellcheck/exclude_lines.txt index 075cc6ee..f3d4b8f8 100644 --- a/contrib/spellcheck/exclude_lines.txt +++ b/contrib/spellcheck/exclude_lines.txt @@ -14,6 +14,7 @@ currency.GARD: 100, currency.DASHS: 0.01, currency.ALIS: 0.05, + currency.MIS: 0.002, const pressXToJSON = `[0,"bu",[4131.85,4131.85]]` wsTradeExecuted = "te" wsBalanceUpdate = "bu" diff --git a/exchanges/okx/okx_test.go b/exchanges/okx/okx_test.go index bcbca667..b3319826 100644 --- a/exchanges/okx/okx_test.go +++ b/exchanges/okx/okx_test.go @@ -104,7 +104,7 @@ func TestGetTicker(t *testing.T) { func TestGetOrderBookDepth(t *testing.T) { t.Parallel() - _, err := ok.GetOrderBookDepth(context.Background(), "BTC-USDT", 2) + _, err := ok.GetOrderBookDepth(context.Background(), "BTC-USDT", 400) if err != nil { t.Error("OKX GetOrderBookDepth() error", err) } diff --git a/exchanges/okx/okx_types.go b/exchanges/okx/okx_types.go index 2a35605f..5ece9342 100644 --- a/exchanges/okx/okx_types.go +++ b/exchanges/okx/okx_types.go @@ -63,7 +63,7 @@ const ( operationLogin = "login" ) -// Market Data Endoints +// Market Data Endpoints // TickerResponse represents the market data endpoint ticker detail type TickerResponse struct { diff --git a/exchanges/okx/okx_wrapper.go b/exchanges/okx/okx_wrapper.go index 617bd89d..4568a8e3 100644 --- a/exchanges/okx/okx_wrapper.go +++ b/exchanges/okx/okx_wrapper.go @@ -485,7 +485,7 @@ func (ok *Okx) UpdateOrderbook(ctx context.Context, pair currency.Pair, assetTyp return nil, errIncompleteCurrencyPair } instrumentID = format.Format(pair) - orderbookNew, err = ok.GetOrderBookDepth(ctx, instrumentID, 0) + orderbookNew, err = ok.GetOrderBookDepth(ctx, instrumentID, 400) if err != nil { return book, err }