|
@@ -168,6 +168,13 @@ class KucoinUsdtSwapWs:
|
|
|
self.ticker_info['bp'] = float(msg['data']['bestBidPrice'])
|
|
self.ticker_info['bp'] = float(msg['data']['bestBidPrice'])
|
|
|
self.ticker_info['ap'] = float(msg['data']['bestAskPrice'])
|
|
self.ticker_info['ap'] = float(msg['data']['bestAskPrice'])
|
|
|
self.callback['onTicker'](self.ticker_info)
|
|
self.callback['onTicker'](self.ticker_info)
|
|
|
|
|
+
|
|
|
|
|
+ bp = float(msg['data']['bestBidPrice'])
|
|
|
|
|
+ bv = float(msg['data']['bestBidSize'])
|
|
|
|
|
+ ap = float(msg['data']['bestAskPrice'])
|
|
|
|
|
+ av = float(msg['data']['bestAskSize'])
|
|
|
|
|
+ self.depth = [bp, bv, ap, av]
|
|
|
|
|
+ self.callback['onDepth']({'name':self.name,'data':self.depth})
|
|
|
|
|
|
|
|
def _update_trade(self, msg):
|
|
def _update_trade(self, msg):
|
|
|
price = float(msg["data"]['price'])
|
|
price = float(msg["data"]['price'])
|
|
@@ -353,7 +360,9 @@ class KucoinUsdtSwapWs:
|
|
|
|
|
|
|
|
for i in channels:
|
|
for i in channels:
|
|
|
sub_str = ujson.dumps({"topic": i, "type": "subscribe"})
|
|
sub_str = ujson.dumps({"topic": i, "type": "subscribe"})
|
|
|
- if "/contractMarket/level2Depth50" not in i and "/contractMarket/execution" not in i:
|
|
|
|
|
|
|
+ if "/contractMarket/level2Depth50" not in i \
|
|
|
|
|
+ and "/contractMarket/execution" not in i \
|
|
|
|
|
+ and "/contractMarket/tickerV2" not in i:
|
|
|
# print(i)
|
|
# print(i)
|
|
|
sub_str = ujson.dumps({"topic": i, "type": "subscribe", "privateChannel": True, "response": True})
|
|
sub_str = ujson.dumps({"topic": i, "type": "subscribe", "privateChannel": True, "response": True})
|
|
|
await _ws.send_str(sub_str)
|
|
await _ws.send_str(sub_str)
|