Skip to content

Commit

Permalink
Kucoin: Remove deprecated fundingBook endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Jul 13, 2024
1 parent 319ce98 commit 7754e57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
13 changes: 0 additions & 13 deletions exchanges/kucoin/kucoin_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
22 changes: 9 additions & 13 deletions exchanges/kucoin/kucoin_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion exchanges/kucoin/testdata/wsHandleData.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down

0 comments on commit 7754e57

Please sign in to comment.