From 7754e575fba74894350cc0258bd16939f43edae8 Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Wed, 10 Jul 2024 14:24:09 +0700 Subject: [PATCH] Kucoin: Remove deprecated fundingBook endpoint --- exchanges/kucoin/kucoin_types.go | 13 ------------ exchanges/kucoin/kucoin_websocket.go | 22 +++++++++------------ exchanges/kucoin/testdata/wsHandleData.json | 1 - 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/exchanges/kucoin/kucoin_types.go b/exchanges/kucoin/kucoin_types.go index d66c5dac27e..2879a8f4560 100644 --- a/exchanges/kucoin/kucoin_types.go +++ b/exchanges/kucoin/kucoin_types.go @@ -956,19 +956,6 @@ type WsPriceIndicator struct { Value float64 `json:"value"` } -// WsMarginFundingBook represents order book changes on margin. -type WsMarginFundingBook struct { - Sequence int64 `json:"sequence"` - Currency string `json:"currency"` - DailyInterestRate float64 `json:"dailyIntRate"` - AnnualInterestRate float64 `json:"annualIntRate"` - Term int64 `json:"term"` - Size float64 `json:"size"` - Side string `json:"side"` - Timestamp convert.ExchangeTime `json:"ts"` // In Nanosecond - -} - // WsTradeOrder represents a private trade order push data. type WsTradeOrder struct { Symbol string `json:"symbol"` diff --git a/exchanges/kucoin/kucoin_websocket.go b/exchanges/kucoin/kucoin_websocket.go index f912989e9f4..01a2a2c6282 100644 --- a/exchanges/kucoin/kucoin_websocket.go +++ b/exchanges/kucoin/kucoin_websocket.go @@ -39,16 +39,15 @@ const ( privateBullets = "/v1/bullet-private" // spot channels - marketTickerChannel = "/market/ticker" // /market/ticker:{symbol},{symbol}... - marketSnapshotChannel = "/market/snapshot" // /market/snapshot:{symbol} - marketOrderbookChannel = "/market/level2" // /market/level2:{symbol},{symbol}... - marketOrderbookDepth5Channel = "/spotMarket/level2Depth5" // /spotMarket/level2Depth5:{symbol},{symbol}... - marketOrderbookDepth50Channel = "/spotMarket/level2Depth50" // /spotMarket/level2Depth50:{symbol},{symbol}... - marketCandlesChannel = "/market/candles" // /market/candles:{symbol}_{interval} - marketMatchChannel = "/market/match" // /market/match:{symbol},{symbol}... - indexPriceIndicatorChannel = "/indicator/index" // /indicator/index:{symbol},{symbol}.. - markPriceIndicatorChannel = "/indicator/markPrice" // /indicator/markPrice:{symbol},{symbol}... - marginFundingbookChangeChannel = "/margin/fundingBook" // /margin/fundingBook:{currency},{currency}... + marketTickerChannel = "/market/ticker" // /market/ticker:{symbol},... + marketSnapshotChannel = "/market/snapshot" // /market/snapshot:{symbol},... + marketOrderbookChannel = "/market/level2" // /market/level2:{symbol},... + marketOrderbookDepth5Channel = "/spotMarket/level2Depth5" // /spotMarket/level2Depth5:{symbol},... + marketOrderbookDepth50Channel = "/spotMarket/level2Depth50" // /spotMarket/level2Depth50:{symbol},... + marketCandlesChannel = "/market/candles" // /market/candles:{symbol}_{interval},... + marketMatchChannel = "/market/match" // /market/match:{symbol},... + indexPriceIndicatorChannel = "/indicator/index" // /indicator/index:{symbol},... + markPriceIndicatorChannel = "/indicator/markPrice" // /indicator/markPrice:{symbol},... // Private channels privateSpotTradeOrders = "/spotMarket/tradeOrders" @@ -237,9 +236,6 @@ func (ku *Kucoin) wsHandleData(respData []byte) error { case indexPriceIndicatorChannel, markPriceIndicatorChannel: var response WsPriceIndicator return ku.processData(resp.Data, &response) - case marginFundingbookChangeChannel: - var response WsMarginFundingBook - return ku.processData(resp.Data, &response) case privateSpotTradeOrders: return ku.processOrderChangeEvent(resp.Data, topicInfo[0]) case accountBalanceChannel: diff --git a/exchanges/kucoin/testdata/wsHandleData.json b/exchanges/kucoin/testdata/wsHandleData.json index be131f0dffe..85d400b171f 100644 --- a/exchanges/kucoin/testdata/wsHandleData.json +++ b/exchanges/kucoin/testdata/wsHandleData.json @@ -7,7 +7,6 @@ {"type":"message","topic":"/market/match:BTC-USDT","subject":"trade.l3match","data":{"sequence":"1545896669145","type":"match","symbol":"BTC-USDT","side":"buy","price":"0.08200000000000000000","size":"0.01022222000000000000","tradeId":"5c24c5da03aa673885cd67aa","takerOrderId":"5c24c5d903aa6772d55b371e","makerOrderId":"5c2187d003aa677bd09d5c93","time":"1545913818099033203"}} {"id":"","type":"message","topic":"/indicator/index:USDT-BTC","subject":"tick","data":{"symbol":"USDT-BTC","granularity":5000,"timestamp":1551770400000,"value":0.0001092}} {"type":"message","topic":"/indicator/markPrice:USDT-BTC","subject":"tick","data":{"symbol":"USDT-BTC","granularity":5000,"timestamp":1551770400000,"value":0.0001093}} -{"type":"message","topic":"/margin/fundingBook:USDT","subject":"funding.update","data":{"annualIntRate":0.0547,"currency":"USDT","dailyIntRate":0.00015,"sequence":87611418,"side":"lend","size":25040,"term":7,"ts":1671005721087508700}} {"type":"message","topic":"/spotMarket/tradeOrders","subject":"orderChange","channelType":"private","data":{"symbol":"KCS-USDT","orderType":"limit","side":"buy","orderId":"5efab07953bdea00089965d2","type":"open","orderTime":1593487481683297800,"size":"0.1","filledSize":"0","price":"0.937","clientOid":"1593487481000906","remainSize":"0.1","status":"open","ts":1593487481683297800}} {"type":"message","topic":"/spotMarket/tradeOrders","subject":"orderChange","channelType":"private","data":{"symbol":"KCS-USDT","orderType":"limit","side":"sell","orderId":"5efab07953bdea00089965fa","liquidity":"taker","type":"match","orderTime":1593487482038606000,"size":"0.1","filledSize":"0.1","price":"0.938","matchPrice":"0.96738","matchSize":"0.1","tradeId":"5efab07a4ee4c7000a82d6d9","clientOid":"1593487481000313","remainSize":"0","status":"match","ts":1593487482038606000}} {"type":"message","topic":"/spotMarket/tradeOrders","subject":"orderChange","channelType":"private","data":{"symbol":"KCS-USDT","orderType":"limit","side":"sell","orderId":"5efab07953bdea00089965fa","type":"filled","orderTime":1593487482038606000,"size":"0.1","filledSize":"0.1","price":"0.938","clientOid":"1593487481000313","remainSize":"0","status":"done","ts":1593487482038606000}}