ccxt 4.4.82__py2.py3-none-any.whl → 4.4.85__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. ccxt/__init__.py +1 -5
  2. ccxt/abstract/blofin.py +8 -0
  3. ccxt/abstract/btcbox.py +1 -0
  4. ccxt/apex.py +2 -1
  5. ccxt/async_support/__init__.py +1 -5
  6. ccxt/async_support/apex.py +2 -1
  7. ccxt/async_support/base/exchange.py +26 -3
  8. ccxt/async_support/base/ws/cache.py +6 -1
  9. ccxt/async_support/bitget.py +1 -2
  10. ccxt/async_support/bitrue.py +14 -32
  11. ccxt/async_support/bitso.py +33 -0
  12. ccxt/async_support/bitstamp.py +33 -0
  13. ccxt/async_support/blofin.py +145 -14
  14. ccxt/async_support/btcbox.py +25 -5
  15. ccxt/async_support/bybit.py +16 -37
  16. ccxt/async_support/cex.py +2 -4
  17. ccxt/async_support/coinbase.py +56 -42
  18. ccxt/async_support/coinbaseexchange.py +141 -32
  19. ccxt/async_support/coincatch.py +14 -67
  20. ccxt/async_support/coinex.py +28 -29
  21. ccxt/async_support/coinlist.py +17 -16
  22. ccxt/async_support/coinmetro.py +20 -11
  23. ccxt/async_support/coinone.py +8 -10
  24. ccxt/async_support/coinsph.py +124 -2
  25. ccxt/async_support/cryptocom.py +109 -2
  26. ccxt/async_support/cryptomus.py +42 -80
  27. ccxt/async_support/delta.py +75 -36
  28. ccxt/async_support/derive.py +46 -10
  29. ccxt/async_support/ellipx.py +175 -77
  30. ccxt/async_support/gate.py +1 -1
  31. ccxt/async_support/gemini.py +3 -4
  32. ccxt/async_support/hitbtc.py +56 -65
  33. ccxt/async_support/hyperliquid.py +2 -2
  34. ccxt/async_support/kraken.py +27 -23
  35. ccxt/async_support/kucoinfutures.py +5 -0
  36. ccxt/async_support/lbank.py +1 -1
  37. ccxt/async_support/paradex.py +120 -4
  38. ccxt/base/exchange.py +21 -2
  39. ccxt/base/types.py +3 -0
  40. ccxt/bitget.py +1 -2
  41. ccxt/bitrue.py +14 -32
  42. ccxt/bitso.py +33 -0
  43. ccxt/bitstamp.py +33 -0
  44. ccxt/blofin.py +145 -14
  45. ccxt/btcbox.py +24 -5
  46. ccxt/bybit.py +16 -37
  47. ccxt/cex.py +2 -4
  48. ccxt/coinbase.py +56 -42
  49. ccxt/coinbaseexchange.py +141 -32
  50. ccxt/coincatch.py +14 -67
  51. ccxt/coinex.py +28 -29
  52. ccxt/coinlist.py +17 -16
  53. ccxt/coinmetro.py +20 -11
  54. ccxt/coinone.py +8 -10
  55. ccxt/coinsph.py +124 -2
  56. ccxt/cryptocom.py +109 -2
  57. ccxt/cryptomus.py +42 -80
  58. ccxt/delta.py +75 -36
  59. ccxt/derive.py +46 -10
  60. ccxt/ellipx.py +175 -77
  61. ccxt/gate.py +1 -1
  62. ccxt/gemini.py +3 -4
  63. ccxt/hitbtc.py +56 -65
  64. ccxt/hyperliquid.py +2 -2
  65. ccxt/kraken.py +27 -23
  66. ccxt/kucoinfutures.py +5 -0
  67. ccxt/lbank.py +1 -1
  68. ccxt/paradex.py +120 -4
  69. ccxt/pro/__init__.py +69 -3
  70. ccxt/pro/binance.py +31 -33
  71. ccxt/pro/bithumb.py +5 -3
  72. ccxt/pro/kraken.py +249 -79
  73. ccxt/pro/mexc.py +252 -7
  74. ccxt/pro/poloniex.py +6 -2
  75. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/METADATA +7 -9
  76. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/RECORD +79 -87
  77. ccxt/abstract/bl3p.py +0 -19
  78. ccxt/abstract/idex.py +0 -26
  79. ccxt/async_support/base/ws/fast_client.py +0 -97
  80. ccxt/async_support/bl3p.py +0 -543
  81. ccxt/async_support/idex.py +0 -1889
  82. ccxt/bl3p.py +0 -543
  83. ccxt/idex.py +0 -1889
  84. ccxt/pro/idex.py +0 -687
  85. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/LICENSE.txt +0 -0
  86. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/WHEEL +0 -0
  87. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/top_level.txt +0 -0
ccxt/lbank.py CHANGED
@@ -875,7 +875,7 @@ class lbank(Exchange, ImplicitAPI):
875
875
  timestamp = self.milliseconds()
876
876
  if market['swap']:
877
877
  return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'price', 'volume')
878
- return self.parse_order_book(orderbook, market['symbol'], timestamp)
878
+ return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 1, 0)
879
879
 
880
880
  def parse_trade(self, trade: dict, market: Market = None) -> Trade:
881
881
  #
ccxt/paradex.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.paradex import ImplicitAPI
8
- from ccxt.base.types import Any, Balances, Currency, Int, Leverage, MarginMode, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
8
+ from ccxt.base.types import Any, Balances, Currency, Greeks, Int, Leverage, MarginMode, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -75,6 +75,7 @@ class paradex(Exchange, ImplicitAPI):
75
75
  'fetchFundingRate': False,
76
76
  'fetchFundingRateHistory': False,
77
77
  'fetchFundingRates': False,
78
+ 'fetchGreeks': True,
78
79
  'fetchIndexOHLCV': False,
79
80
  'fetchIsolatedBorrowRate': False,
80
81
  'fetchIsolatedBorrowRates': False,
@@ -558,13 +559,14 @@ class paradex(Exchange, ImplicitAPI):
558
559
  expiry = self.safe_integer(market, 'expiry_at')
559
560
  optionType = self.safe_string(market, 'option_type')
560
561
  strikePrice = self.safe_string(market, 'strike_price')
562
+ takerFee = self.parse_number('0.0003')
563
+ makerFee = self.parse_number('-0.00005')
561
564
  if isOption:
562
565
  optionTypeSuffix = 'C' if (optionType == 'CALL') else 'P'
563
566
  symbol = symbol + '-' + strikePrice + '-' + optionTypeSuffix
567
+ makerFee = self.parse_number('0.0003')
564
568
  else:
565
569
  expiry = None
566
- takerFee = self.parse_number('0.0003')
567
- makerFee = self.parse_number('-0.00005')
568
570
  return self.safe_market_structure({
569
571
  'id': marketId,
570
572
  'symbol': symbol,
@@ -1262,7 +1264,7 @@ class paradex(Exchange, ImplicitAPI):
1262
1264
  'status': self.parse_order_status(status),
1263
1265
  'symbol': symbol,
1264
1266
  'type': self.parse_order_type(orderType),
1265
- 'timeInForce': self.parse_time_in_force(self.safe_string(order, 'instrunction')),
1267
+ 'timeInForce': self.parse_time_in_force(self.safe_string(order, 'instruction')),
1266
1268
  'postOnly': None,
1267
1269
  'reduceOnly': reduceOnly,
1268
1270
  'side': side,
@@ -2284,6 +2286,120 @@ class paradex(Exchange, ImplicitAPI):
2284
2286
  }
2285
2287
  return self.privatePostAccountMarginMarket(self.extend(request, params))
2286
2288
 
2289
+ def fetch_greeks(self, symbol: str, params={}) -> Greeks:
2290
+ """
2291
+ fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
2292
+
2293
+ https://docs.api.testnet.paradex.trade/#list-available-markets-summary
2294
+
2295
+ :param str symbol: unified symbol of the market to fetch greeks for
2296
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2297
+ :returns dict: a `greeks structure <https://docs.ccxt.com/#/?id=greeks-structure>`
2298
+ """
2299
+ self.load_markets()
2300
+ market = self.market(symbol)
2301
+ request: dict = {
2302
+ 'market': market['id'],
2303
+ }
2304
+ response = self.publicGetMarketsSummary(self.extend(request, params))
2305
+ #
2306
+ # {
2307
+ # "results": [
2308
+ # {
2309
+ # "symbol": "BTC-USD-114000-P",
2310
+ # "mark_price": "10835.66892602",
2311
+ # "mark_iv": "0.71781855",
2312
+ # "delta": "-0.98726024",
2313
+ # "greeks": {
2314
+ # "delta": "-0.9872602390817709",
2315
+ # "gamma": "0.000004560958862297231",
2316
+ # "vega": "227.11344863639806",
2317
+ # "rho": "-302.0617972461581",
2318
+ # "vanna": "0.06609830491614832",
2319
+ # "volga": "925.9501532805552"
2320
+ # },
2321
+ # "last_traded_price": "10551.5",
2322
+ # "bid": "10794.9",
2323
+ # "bid_iv": "0.05",
2324
+ # "ask": "10887.3",
2325
+ # "ask_iv": "0.8783283",
2326
+ # "last_iv": "0.05",
2327
+ # "volume_24h": "0",
2328
+ # "total_volume": "195240.72672261014",
2329
+ # "created_at": 1747644009995,
2330
+ # "underlying_price": "103164.79162649",
2331
+ # "open_interest": "0",
2332
+ # "funding_rate": "0.000004464241170536191",
2333
+ # "price_change_rate_24h": "0.074915",
2334
+ # "future_funding_rate": "0.0001"
2335
+ # }
2336
+ # ]
2337
+ # }
2338
+ #
2339
+ data = self.safe_list(response, 'results', [])
2340
+ greeks = self.safe_dict(data, 0, {})
2341
+ return self.parse_greeks(greeks, market)
2342
+
2343
+ def parse_greeks(self, greeks: dict, market: Market = None) -> Greeks:
2344
+ #
2345
+ # {
2346
+ # "symbol": "BTC-USD-114000-P",
2347
+ # "mark_price": "10835.66892602",
2348
+ # "mark_iv": "0.71781855",
2349
+ # "delta": "-0.98726024",
2350
+ # "greeks": {
2351
+ # "delta": "-0.9872602390817709",
2352
+ # "gamma": "0.000004560958862297231",
2353
+ # "vega": "227.11344863639806",
2354
+ # "rho": "-302.0617972461581",
2355
+ # "vanna": "0.06609830491614832",
2356
+ # "volga": "925.9501532805552"
2357
+ # },
2358
+ # "last_traded_price": "10551.5",
2359
+ # "bid": "10794.9",
2360
+ # "bid_iv": "0.05",
2361
+ # "ask": "10887.3",
2362
+ # "ask_iv": "0.8783283",
2363
+ # "last_iv": "0.05",
2364
+ # "volume_24h": "0",
2365
+ # "total_volume": "195240.72672261014",
2366
+ # "created_at": 1747644009995,
2367
+ # "underlying_price": "103164.79162649",
2368
+ # "open_interest": "0",
2369
+ # "funding_rate": "0.000004464241170536191",
2370
+ # "price_change_rate_24h": "0.074915",
2371
+ # "future_funding_rate": "0.0001"
2372
+ # }
2373
+ #
2374
+ marketId = self.safe_string(greeks, 'symbol')
2375
+ market = self.safe_market(marketId, market, None, 'option')
2376
+ symbol = market['symbol']
2377
+ timestamp = self.safe_integer(greeks, 'created_at')
2378
+ greeksData = self.safe_dict(greeks, 'greeks', {})
2379
+ return {
2380
+ 'symbol': symbol,
2381
+ 'timestamp': timestamp,
2382
+ 'datetime': self.iso8601(timestamp),
2383
+ 'delta': self.safe_number(greeksData, 'delta'),
2384
+ 'gamma': self.safe_number(greeksData, 'gamma'),
2385
+ 'theta': None,
2386
+ 'vega': self.safe_number(greeksData, 'vega'),
2387
+ 'rho': self.safe_number(greeksData, 'rho'),
2388
+ 'vanna': self.safe_number(greeksData, 'vanna'),
2389
+ 'volga': self.safe_number(greeksData, 'volga'),
2390
+ 'bidSize': None,
2391
+ 'askSize': None,
2392
+ 'bidImpliedVolatility': self.safe_number(greeks, 'bid_iv'),
2393
+ 'askImpliedVolatility': self.safe_number(greeks, 'ask_iv'),
2394
+ 'markImpliedVolatility': self.safe_number(greeks, 'mark_iv'),
2395
+ 'bidPrice': self.safe_number(greeks, 'bid'),
2396
+ 'askPrice': self.safe_number(greeks, 'ask'),
2397
+ 'markPrice': self.safe_number(greeks, 'mark_price'),
2398
+ 'lastPrice': self.safe_number(greeks, 'last_traded_price'),
2399
+ 'underlyingPrice': self.safe_number(greeks, 'underlying_price'),
2400
+ 'info': greeks,
2401
+ }
2402
+
2287
2403
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
2288
2404
  url = self.implode_hostname(self.urls['api'][self.version]) + '/' + self.implode_params(path, params)
2289
2405
  query = self.omit(params, self.extract_params(path))
ccxt/pro/__init__.py CHANGED
@@ -4,13 +4,81 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.82'
7
+ __version__ = '4.4.85'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
11
  from ccxt.async_support.base.exchange import Exchange # noqa: F401
12
12
 
13
13
  # CCXT Pro exchanges (now this is mainly used for importing exchanges in WS tests)
14
+
15
+ # DO_NOT_REMOVE__ERROR_IMPORTS_START
16
+ from ccxt.base.errors import BaseError # noqa: F401
17
+ from ccxt.base.errors import ExchangeError # noqa: F401
18
+ from ccxt.base.errors import AuthenticationError # noqa: F401
19
+ from ccxt.base.errors import PermissionDenied # noqa: F401
20
+ from ccxt.base.errors import AccountNotEnabled # noqa: F401
21
+ from ccxt.base.errors import AccountSuspended # noqa: F401
22
+ from ccxt.base.errors import ArgumentsRequired # noqa: F401
23
+ from ccxt.base.errors import BadRequest # noqa: F401
24
+ from ccxt.base.errors import BadSymbol # noqa: F401
25
+ from ccxt.base.errors import OperationRejected # noqa: F401
26
+ from ccxt.base.errors import NoChange # noqa: F401
27
+ from ccxt.base.errors import MarginModeAlreadySet # noqa: F401
28
+ from ccxt.base.errors import MarketClosed # noqa: F401
29
+ from ccxt.base.errors import ManualInteractionNeeded # noqa: F401
30
+ from ccxt.base.errors import InsufficientFunds # noqa: F401
31
+ from ccxt.base.errors import InvalidAddress # noqa: F401
32
+ from ccxt.base.errors import AddressPending # noqa: F401
33
+ from ccxt.base.errors import InvalidOrder # noqa: F401
34
+ from ccxt.base.errors import OrderNotFound # noqa: F401
35
+ from ccxt.base.errors import OrderNotCached # noqa: F401
36
+ from ccxt.base.errors import OrderImmediatelyFillable # noqa: F401
37
+ from ccxt.base.errors import OrderNotFillable # noqa: F401
38
+ from ccxt.base.errors import DuplicateOrderId # noqa: F401
39
+ from ccxt.base.errors import ContractUnavailable # noqa: F401
40
+ from ccxt.base.errors import NotSupported # noqa: F401
41
+ from ccxt.base.errors import InvalidProxySettings # noqa: F401
42
+ from ccxt.base.errors import ExchangeClosedByUser # noqa: F401
43
+ from ccxt.base.errors import OperationFailed # noqa: F401
44
+ from ccxt.base.errors import NetworkError # noqa: F401
45
+ from ccxt.base.errors import DDoSProtection # noqa: F401
46
+ from ccxt.base.errors import RateLimitExceeded # noqa: F401
47
+ from ccxt.base.errors import ExchangeNotAvailable # noqa: F401
48
+ from ccxt.base.errors import OnMaintenance # noqa: F401
49
+ from ccxt.base.errors import InvalidNonce # noqa: F401
50
+ from ccxt.base.errors import ChecksumError # noqa: F401
51
+ from ccxt.base.errors import RequestTimeout # noqa: F401
52
+ from ccxt.base.errors import BadResponse # noqa: F401
53
+ from ccxt.base.errors import NullResponse # noqa: F401
54
+ from ccxt.base.errors import CancelPending # noqa: F401
55
+ from ccxt.base.errors import UnsubscribeError # noqa: F401
56
+ from ccxt.base.errors import error_hierarchy # noqa: F401
57
+ # DO_NOT_REMOVE__ERROR_IMPORTS_END
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
14
82
 
15
83
  from ccxt.pro.alpaca import alpaca # noqa: F401
16
84
  from ccxt.pro.apex import apex # noqa: F401
@@ -57,7 +125,6 @@ from ccxt.pro.htx import htx # noqa
57
125
  from ccxt.pro.huobi import huobi # noqa: F401
58
126
  from ccxt.pro.huobijp import huobijp # noqa: F401
59
127
  from ccxt.pro.hyperliquid import hyperliquid # noqa: F401
60
- from ccxt.pro.idex import idex # noqa: F401
61
128
  from ccxt.pro.independentreserve import independentreserve # noqa: F401
62
129
  from ccxt.pro.kraken import kraken # noqa: F401
63
130
  from ccxt.pro.krakenfutures import krakenfutures # noqa: F401
@@ -131,7 +198,6 @@ exchanges = [
131
198
  'huobi',
132
199
  'huobijp',
133
200
  'hyperliquid',
134
- 'idex',
135
201
  'independentreserve',
136
202
  'kraken',
137
203
  'krakenfutures',
ccxt/pro/binance.py CHANGED
@@ -718,7 +718,7 @@ class binance(ccxt.async_support.binance):
718
718
  """
719
719
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
720
720
 
721
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#order-book
721
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#order-book
722
722
  https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book
723
723
 
724
724
  :param str symbol: unified symbol of the market to fetch the order book for
@@ -868,10 +868,8 @@ class binance(ccxt.async_support.binance):
868
868
  # ]
869
869
  # }
870
870
  #
871
- isTestnetSpot = client.url.find('testnet') > 0
872
- isSpotMainNet = client.url.find('/stream.binance.') > 0
873
- isSpot = isTestnetSpot or isSpotMainNet
874
- marketType = 'spot' if isSpot else 'contract'
871
+ isSpot = (client.url.find('/stream') > -1)
872
+ marketType = 'spot' if (isSpot) else 'contract'
875
873
  marketId = self.safe_string(message, 's')
876
874
  market = self.safe_market(marketId, None, None, marketType)
877
875
  symbol = market['symbol']
@@ -984,8 +982,8 @@ class binance(ccxt.async_support.binance):
984
982
  """
985
983
  get the list of most recent trades for a list of symbols
986
984
 
987
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
988
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
985
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
986
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
989
987
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
990
988
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
991
989
 
@@ -1042,8 +1040,8 @@ class binance(ccxt.async_support.binance):
1042
1040
  """
1043
1041
  unsubscribes from the trades channel
1044
1042
 
1045
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
1046
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
1043
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
1044
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
1047
1045
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1048
1046
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1049
1047
 
@@ -1100,8 +1098,8 @@ class binance(ccxt.async_support.binance):
1100
1098
  """
1101
1099
  unsubscribes from the trades channel
1102
1100
 
1103
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
1104
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
1101
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
1102
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
1105
1103
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1106
1104
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1107
1105
 
@@ -1117,8 +1115,8 @@ class binance(ccxt.async_support.binance):
1117
1115
  """
1118
1116
  get the list of most recent trades for a particular symbol
1119
1117
 
1120
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
1121
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
1118
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
1119
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
1122
1120
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1123
1121
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1124
1122
 
@@ -1290,7 +1288,7 @@ class binance(ccxt.async_support.binance):
1290
1288
  def handle_trade(self, client: Client, message):
1291
1289
  # the trade streams push raw trade information in real-time
1292
1290
  # each trade has a unique buyer and seller
1293
- isSpot = ((client.url.find('wss://stream.binance.com') > -1) or (client.url.find('/testnet.binance') > -1))
1291
+ isSpot = (client.url.find('/stream') > -1)
1294
1292
  marketType = 'spot' if (isSpot) else 'contract'
1295
1293
  marketId = self.safe_string(message, 's')
1296
1294
  market = self.safe_market(marketId, None, None, marketType)
@@ -1309,7 +1307,7 @@ class binance(ccxt.async_support.binance):
1309
1307
  """
1310
1308
  watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1311
1309
 
1312
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1310
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
1313
1311
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1314
1312
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1315
1313
 
@@ -1332,7 +1330,7 @@ class binance(ccxt.async_support.binance):
1332
1330
  """
1333
1331
  watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1334
1332
 
1335
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1333
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
1336
1334
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1337
1335
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1338
1336
 
@@ -1394,7 +1392,7 @@ class binance(ccxt.async_support.binance):
1394
1392
  """
1395
1393
  unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1396
1394
 
1397
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1395
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
1398
1396
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1399
1397
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1400
1398
 
@@ -1458,7 +1456,7 @@ class binance(ccxt.async_support.binance):
1458
1456
  """
1459
1457
  unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1460
1458
 
1461
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1459
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
1462
1460
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1463
1461
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1464
1462
 
@@ -1523,7 +1521,7 @@ class binance(ccxt.async_support.binance):
1523
1521
  self.safe_float(kline, 'c'),
1524
1522
  self.safe_float(kline, 'v'),
1525
1523
  ]
1526
- isSpot = ((client.url.find('/stream') > -1) or (client.url.find('/testnet.binance') > -1))
1524
+ isSpot = (client.url.find('/stream') > -1)
1527
1525
  marketType = 'spot' if (isSpot) else 'contract'
1528
1526
  symbol = self.safe_symbol(marketId, None, None, marketType)
1529
1527
  messageHash = 'ohlcv::' + symbol + '::' + unifiedTimeframe
@@ -1578,7 +1576,7 @@ class binance(ccxt.async_support.binance):
1578
1576
  """
1579
1577
  query historical candlestick data containing the open, high, low, and close price, and the volume of a market
1580
1578
 
1581
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1579
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
1582
1580
 
1583
1581
  :param str symbol: unified symbol of the market to query OHLCV data for
1584
1582
  :param str timeframe: the length of time each candle represents
@@ -1844,7 +1842,7 @@ class binance(ccxt.async_support.binance):
1844
1842
  """
1845
1843
  watches best bid & ask for symbols
1846
1844
 
1847
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#symbol-order-book-ticker
1845
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-order-book-ticker
1848
1846
  https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
1849
1847
  https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
1850
1848
 
@@ -2123,7 +2121,7 @@ class binance(ccxt.async_support.binance):
2123
2121
  self.handle_tickers_and_bids_asks(client, message, 'tickers')
2124
2122
 
2125
2123
  def handle_tickers_and_bids_asks(self, client: Client, message, methodType):
2126
- isSpot = ((client.url.find('/stream') > -1) or (client.url.find('/testnet.binance') > -1))
2124
+ isSpot = (client.url.find('/stream') > -1)
2127
2125
  marketType = 'spot' if (isSpot) else 'contract'
2128
2126
  isBidAsk = (methodType == 'bidasks')
2129
2127
  channelName = None
@@ -2335,7 +2333,7 @@ class binance(ccxt.async_support.binance):
2335
2333
  fetch balance and get the amount of funds available for trading or funds locked in orders
2336
2334
 
2337
2335
  https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
2338
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/account-requests#account-information-user_data
2336
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-information-user_data
2339
2337
  https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api
2340
2338
 
2341
2339
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -2682,7 +2680,7 @@ class binance(ccxt.async_support.binance):
2682
2680
  """
2683
2681
  create a trade order
2684
2682
 
2685
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#place-new-order-trade
2683
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade
2686
2684
  https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
2687
2685
  https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api
2688
2686
 
@@ -2827,7 +2825,7 @@ class binance(ccxt.async_support.binance):
2827
2825
  """
2828
2826
  edit a trade order
2829
2827
 
2830
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-and-replace-order-trade
2828
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-and-replace-order-trade
2831
2829
  https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
2832
2830
  https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order
2833
2831
 
@@ -2980,7 +2978,7 @@ class binance(ccxt.async_support.binance):
2980
2978
  """
2981
2979
  cancel multiple orders
2982
2980
 
2983
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-order-trade
2981
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade
2984
2982
  https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
2985
2983
  https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order
2986
2984
 
@@ -3024,7 +3022,7 @@ class binance(ccxt.async_support.binance):
3024
3022
  """
3025
3023
  cancel all open orders in a market
3026
3024
 
3027
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-open-orders-trade
3025
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade
3028
3026
 
3029
3027
  :param str [symbol]: unified market symbol of the market to cancel orders in
3030
3028
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -3058,7 +3056,7 @@ class binance(ccxt.async_support.binance):
3058
3056
  """
3059
3057
  fetches information on an order made by the user
3060
3058
 
3061
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#query-order-user_data
3059
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#query-order-user_data
3062
3060
  https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
3063
3061
  https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order
3064
3062
 
@@ -3102,7 +3100,7 @@ class binance(ccxt.async_support.binance):
3102
3100
  """
3103
3101
  fetches information on multiple orders made by the user
3104
3102
 
3105
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#order-lists
3103
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
3106
3104
 
3107
3105
  :param str symbol: unified market symbol of the market orders were made in
3108
3106
  :param int|None [since]: the earliest time in ms to fetch orders for
@@ -3145,7 +3143,7 @@ class binance(ccxt.async_support.binance):
3145
3143
  """
3146
3144
  fetch closed orders
3147
3145
 
3148
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#order-lists
3146
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
3149
3147
 
3150
3148
  :param str symbol: unified market symbol
3151
3149
  :param int [since]: the earliest time in ms to fetch open orders for
@@ -3165,7 +3163,7 @@ class binance(ccxt.async_support.binance):
3165
3163
  """
3166
3164
  fetch all unfilled currently open orders
3167
3165
 
3168
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#current-open-orders-user_data
3166
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#current-open-orders-user_data
3169
3167
 
3170
3168
  :param str symbol: unified market symbol
3171
3169
  :param int|None [since]: the earliest time in ms to fetch open orders for
@@ -3686,7 +3684,7 @@ class binance(ccxt.async_support.binance):
3686
3684
  """
3687
3685
  fetch all trades made by the user
3688
3686
 
3689
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/account-requests#account-trade-history-user_data
3687
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data
3690
3688
 
3691
3689
  :param str symbol: unified market symbol
3692
3690
  :param int|None [since]: the earliest time in ms to fetch trades for
@@ -3734,7 +3732,7 @@ class binance(ccxt.async_support.binance):
3734
3732
  """
3735
3733
  fetch all trades made by the user
3736
3734
 
3737
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
3735
+ https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
3738
3736
 
3739
3737
  :param str symbol: unified market symbol
3740
3738
  :param int [since]: the earliest time in ms to fetch trades for
ccxt/pro/bithumb.py CHANGED
@@ -323,18 +323,20 @@ class bithumb(ccxt.async_support.bithumb):
323
323
  # "contPrice" : "10579000",
324
324
  # "contQty" : "0.01",
325
325
  # "contAmt" : "105790.00",
326
- # "contDtm" : "2020-01-29 12:24:18.830039",
326
+ # "contDtm" : "2020-01-29 12:24:18.830038",
327
327
  # "updn" : "dn"
328
328
  # }
329
329
  #
330
330
  marketId = self.safe_string(trade, 'symbol')
331
331
  datetime = self.safe_string(trade, 'contDtm')
332
+ # that date is not UTC iso8601, but exchange's local time, -9hr difference
333
+ timestamp = self.parse8601(datetime) - 32400000
332
334
  sideId = self.safe_string(trade, 'buySellGb')
333
335
  return self.safe_trade({
334
336
  'id': None,
335
337
  'info': trade,
336
- 'timestamp': self.parse8601(datetime),
337
- 'datetime': datetime,
338
+ 'timestamp': timestamp,
339
+ 'datetime': self.iso8601(timestamp),
338
340
  'symbol': self.safe_symbol(marketId, market, '_'),
339
341
  'order': None,
340
342
  'type': None,