ccxt 4.2.35__py2.py3-none-any.whl → 4.2.37__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.
@@ -483,6 +483,7 @@ class bitfinex(Exchange, ImplicitAPI):
483
483
  async def fetch_trading_fees(self, params={}):
484
484
  """
485
485
  fetch the trading fees for multiple markets
486
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-summary
486
487
  :param dict [params]: extra parameters specific to the exchange API endpoint
487
488
  :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
488
489
  """
@@ -559,6 +560,8 @@ class bitfinex(Exchange, ImplicitAPI):
559
560
  async def fetch_markets(self, params={}):
560
561
  """
561
562
  retrieves data on all markets for bitfinex
563
+ :see: https://docs.bitfinex.com/v1/reference/rest-public-symbols
564
+ :see: https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
562
565
  :param dict [params]: extra parameters specific to the exchange API endpoint
563
566
  :returns dict[]: an array of objects representing market data
564
567
  """
@@ -676,6 +679,7 @@ class bitfinex(Exchange, ImplicitAPI):
676
679
  async def fetch_balance(self, params={}) -> Balances:
677
680
  """
678
681
  query for balance and get the amount of funds available for trading or funds locked in orders
682
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
679
683
  :param dict [params]: extra parameters specific to the exchange API endpoint
680
684
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
681
685
  """
@@ -727,6 +731,7 @@ class bitfinex(Exchange, ImplicitAPI):
727
731
  async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
728
732
  """
729
733
  transfer currency internally between wallets on the same account
734
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
730
735
  :param str code: unified currency code
731
736
  :param float amount: amount to transfer
732
737
  :param str fromAccount: account to transfer from
@@ -807,6 +812,7 @@ class bitfinex(Exchange, ImplicitAPI):
807
812
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
808
813
  """
809
814
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
815
+ :see: https://docs.bitfinex.com/v1/reference/rest-public-orderbook
810
816
  :param str symbol: unified symbol of the market to fetch the order book for
811
817
  :param int [limit]: the maximum amount of order book entries to return
812
818
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -843,6 +849,7 @@ class bitfinex(Exchange, ImplicitAPI):
843
849
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
844
850
  """
845
851
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
852
+ :see: https://docs.bitfinex.com/v1/reference/rest-public-ticker
846
853
  :param str symbol: unified symbol of the market to fetch the ticker for
847
854
  :param dict [params]: extra parameters specific to the exchange API endpoint
848
855
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -956,6 +963,7 @@ class bitfinex(Exchange, ImplicitAPI):
956
963
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = 50, params={}) -> List[Trade]:
957
964
  """
958
965
  get the list of most recent trades for a particular symbol
966
+ :see: https://docs.bitfinex.com/v1/reference/rest-public-trades
959
967
  :param str symbol: unified symbol of the market to fetch trades for
960
968
  :param int [since]: timestamp in ms of the earliest trade to fetch
961
969
  :param int [limit]: the maximum amount of trades to fetch
@@ -988,6 +996,7 @@ class bitfinex(Exchange, ImplicitAPI):
988
996
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
989
997
  """
990
998
  fetch all trades made by the user
999
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
991
1000
  :param str symbol: unified market symbol
992
1001
  :param int [since]: the earliest time in ms to fetch trades for
993
1002
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -1011,6 +1020,7 @@ class bitfinex(Exchange, ImplicitAPI):
1011
1020
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1012
1021
  """
1013
1022
  create a trade order
1023
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-new-order
1014
1024
  :param str symbol: unified symbol of the market to create an order in
1015
1025
  :param str type: 'market' or 'limit'
1016
1026
  :param str side: 'buy' or 'sell'
@@ -1067,6 +1077,7 @@ class bitfinex(Exchange, ImplicitAPI):
1067
1077
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
1068
1078
  """
1069
1079
  cancels an open order
1080
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
1070
1081
  :param str id: order id
1071
1082
  :param str symbol: not used by bitfinex cancelOrder()
1072
1083
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1081,6 +1092,7 @@ class bitfinex(Exchange, ImplicitAPI):
1081
1092
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1082
1093
  """
1083
1094
  cancel all open orders
1095
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
1084
1096
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
1085
1097
  :param dict [params]: extra parameters specific to the exchange API endpoint
1086
1098
  :returns dict: response from exchange
@@ -1159,6 +1171,7 @@ class bitfinex(Exchange, ImplicitAPI):
1159
1171
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1160
1172
  """
1161
1173
  fetch all unfilled currently open orders
1174
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
1162
1175
  :param str symbol: unified market symbol
1163
1176
  :param int [since]: the earliest time in ms to fetch open orders for
1164
1177
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -1178,6 +1191,7 @@ class bitfinex(Exchange, ImplicitAPI):
1178
1191
  async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1179
1192
  """
1180
1193
  fetches information on multiple closed orders made by the user
1194
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
1181
1195
  :param str symbol: unified market symbol of the market orders were made in
1182
1196
  :param int [since]: the earliest time in ms to fetch orders for
1183
1197
  :param int [limit]: the maximum number of order structures to retrieve
@@ -1199,6 +1213,7 @@ class bitfinex(Exchange, ImplicitAPI):
1199
1213
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
1200
1214
  """
1201
1215
  fetches information on an order made by the user
1216
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-order-status
1202
1217
  :param str symbol: not used by bitfinex fetchOrder
1203
1218
  :param dict [params]: extra parameters specific to the exchange API endpoint
1204
1219
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -1233,6 +1248,7 @@ class bitfinex(Exchange, ImplicitAPI):
1233
1248
  async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
1234
1249
  """
1235
1250
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1251
+ :see: https://docs.bitfinex.com/reference/rest-public-candles#aggregate-funding-currency-candles
1236
1252
  :param str symbol: unified symbol of the market to fetch OHLCV data for
1237
1253
  :param str timeframe: the length of time each candle represents
1238
1254
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -1272,6 +1288,7 @@ class bitfinex(Exchange, ImplicitAPI):
1272
1288
  async def create_deposit_address(self, code: str, params={}):
1273
1289
  """
1274
1290
  create a currency deposit address
1291
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1275
1292
  :param str code: unified currency code of the currency for the deposit address
1276
1293
  :param dict [params]: extra parameters specific to the exchange API endpoint
1277
1294
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
@@ -1285,6 +1302,7 @@ class bitfinex(Exchange, ImplicitAPI):
1285
1302
  async def fetch_deposit_address(self, code: str, params={}):
1286
1303
  """
1287
1304
  fetch the deposit address for a currency associated with self account
1305
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1288
1306
  :param str code: unified currency code
1289
1307
  :param dict [params]: extra parameters specific to the exchange API endpoint
1290
1308
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
@@ -1315,6 +1333,7 @@ class bitfinex(Exchange, ImplicitAPI):
1315
1333
  async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1316
1334
  """
1317
1335
  fetch history of deposits and withdrawals
1336
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
1318
1337
  :param str code: unified currency code for the currency of the deposit/withdrawals
1319
1338
  :param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
1320
1339
  :param int [limit]: max number of deposit/withdrawals to return, default is None
@@ -1444,6 +1463,7 @@ class bitfinex(Exchange, ImplicitAPI):
1444
1463
  async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1445
1464
  """
1446
1465
  make a withdrawal
1466
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
1447
1467
  :param str code: unified currency code
1448
1468
  :param float amount: the amount to withdraw
1449
1469
  :param str address: the address to withdraw to
@@ -1489,6 +1509,7 @@ class bitfinex(Exchange, ImplicitAPI):
1489
1509
  async def fetch_positions(self, symbols: Strings = None, params={}):
1490
1510
  """
1491
1511
  fetch all open positions
1512
+ :see: https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
1492
1513
  :param str[]|None symbols: list of unified market symbols
1493
1514
  :param dict [params]: extra parameters specific to the exchange API endpoint
1494
1515
  :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
@@ -153,149 +153,149 @@ class bitfinex2(Exchange, ImplicitAPI):
153
153
  'api': {
154
154
  'public': {
155
155
  'get': {
156
- 'conf/{config}': 2.66, # 90 requests a minute
157
- 'conf/pub:{action}:{object}': 2.66,
158
- 'conf/pub:{action}:{object}:{detail}': 2.66,
159
- 'conf/pub:map:{object}': 2.66,
160
- 'conf/pub:map:{object}:{detail}': 2.66,
161
- 'conf/pub:map:currency:{detail}': 2.66,
162
- 'conf/pub:map:currency:sym': 2.66, # maps symbols to their API symbols, BAB > BCH
163
- 'conf/pub:map:currency:label': 2.66, # verbose friendly names, BNT > Bancor
164
- 'conf/pub:map:currency:unit': 2.66, # maps symbols to unit of measure where applicable
165
- 'conf/pub:map:currency:undl': 2.66, # maps derivatives symbols to their underlying currency
166
- 'conf/pub:map:currency:pool': 2.66, # maps symbols to underlying network/protocol they operate on
167
- 'conf/pub:map:currency:explorer': 2.66, # maps symbols to their recognised block explorer URLs
168
- 'conf/pub:map:currency:tx:fee': 2.66, # maps currencies to their withdrawal fees https://github.com/ccxt/ccxt/issues/7745
169
- 'conf/pub:map:tx:method': 2.66,
170
- 'conf/pub:list:{object}': 2.66,
171
- 'conf/pub:list:{object}:{detail}': 2.66,
172
- 'conf/pub:list:currency': 2.66,
173
- 'conf/pub:list:pair:exchange': 2.66,
174
- 'conf/pub:list:pair:margin': 2.66,
175
- 'conf/pub:list:pair:futures': 2.66,
176
- 'conf/pub:list:competitions': 2.66,
177
- 'conf/pub:info:{object}': 2.66,
178
- 'conf/pub:info:{object}:{detail}': 2.66,
179
- 'conf/pub:info:pair': 2.66,
180
- 'conf/pub:info:pair:futures': 2.66,
181
- 'conf/pub:info:tx:status': 2.66, # [deposit, withdrawal] statuses 1 = active, 0 = maintenance
182
- 'conf/pub:fees': 2.66,
156
+ 'conf/{config}': 2.7, # 90 requests a minute, 90/60 = 1.5, 1000 / (250 * 2.66) = 1.503, use 2.7 instead of 2.66 to ensure rateLimitExceeded is not triggered
157
+ 'conf/pub:{action}:{object}': 2.7,
158
+ 'conf/pub:{action}:{object}:{detail}': 2.7,
159
+ 'conf/pub:map:{object}': 2.7,
160
+ 'conf/pub:map:{object}:{detail}': 2.7,
161
+ 'conf/pub:map:currency:{detail}': 2.7,
162
+ 'conf/pub:map:currency:sym': 2.7, # maps symbols to their API symbols, BAB > BCH
163
+ 'conf/pub:map:currency:label': 2.7, # verbose friendly names, BNT > Bancor
164
+ 'conf/pub:map:currency:unit': 2.7, # maps symbols to unit of measure where applicable
165
+ 'conf/pub:map:currency:undl': 2.7, # maps derivatives symbols to their underlying currency
166
+ 'conf/pub:map:currency:pool': 2.7, # maps symbols to underlying network/protocol they operate on
167
+ 'conf/pub:map:currency:explorer': 2.7, # maps symbols to their recognised block explorer URLs
168
+ 'conf/pub:map:currency:tx:fee': 2.7, # maps currencies to their withdrawal fees https://github.com/ccxt/ccxt/issues/7745
169
+ 'conf/pub:map:tx:method': 2.7,
170
+ 'conf/pub:list:{object}': 2.7,
171
+ 'conf/pub:list:{object}:{detail}': 2.7,
172
+ 'conf/pub:list:currency': 2.7,
173
+ 'conf/pub:list:pair:exchange': 2.7,
174
+ 'conf/pub:list:pair:margin': 2.7,
175
+ 'conf/pub:list:pair:futures': 2.7,
176
+ 'conf/pub:list:competitions': 2.7,
177
+ 'conf/pub:info:{object}': 2.7,
178
+ 'conf/pub:info:{object}:{detail}': 2.7,
179
+ 'conf/pub:info:pair': 2.7,
180
+ 'conf/pub:info:pair:futures': 2.7,
181
+ 'conf/pub:info:tx:status': 2.7, # [deposit, withdrawal] statuses 1 = active, 0 = maintenance
182
+ 'conf/pub:fees': 2.7,
183
183
  'platform/status': 8, # 30 requests per minute = 0.5 requests per second =>( 1000ms / rateLimit ) / 0.5 = 8
184
- 'tickers': 2.66, # 90 requests a minute = 1.5 requests per second =>( 1000 / rateLimit ) / 1.5 = 2.666666666
185
- 'ticker/{symbol}': 2.66,
186
- 'tickers/hist': 2.66,
187
- 'trades/{symbol}/hist': 2.66,
184
+ 'tickers': 2.7, # 90 requests a minute = 1.5 requests per second =>( 1000 / rateLimit ) / 1.5 = 2.666666666
185
+ 'ticker/{symbol}': 2.7,
186
+ 'tickers/hist': 2.7,
187
+ 'trades/{symbol}/hist': 2.7,
188
188
  'book/{symbol}/{precision}': 1, # 240 requests a minute
189
189
  'book/{symbol}/P0': 1,
190
190
  'book/{symbol}/P1': 1,
191
191
  'book/{symbol}/P2': 1,
192
192
  'book/{symbol}/P3': 1,
193
193
  'book/{symbol}/R0': 1,
194
- 'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.66,
195
- 'stats1/{key}:{size}:{symbol}:{side}/last': 2.66,
196
- 'stats1/{key}:{size}:{symbol}:{side}/hist': 2.66,
197
- 'stats1/{key}:{size}:{symbol}/{section}': 2.66,
198
- 'stats1/{key}:{size}:{symbol}/last': 2.66,
199
- 'stats1/{key}:{size}:{symbol}/hist': 2.66,
200
- 'stats1/{key}:{size}:{symbol}:long/last': 2.66,
201
- 'stats1/{key}:{size}:{symbol}:long/hist': 2.66,
202
- 'stats1/{key}:{size}:{symbol}:short/last': 2.66,
203
- 'stats1/{key}:{size}:{symbol}:short/hist': 2.66,
204
- 'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.66,
205
- 'candles/trade:{timeframe}:{symbol}/{section}': 2.66,
206
- 'candles/trade:{timeframe}:{symbol}/last': 2.66,
207
- 'candles/trade:{timeframe}:{symbol}/hist': 2.66,
208
- 'status/{type}': 2.66,
209
- 'status/deriv': 2.66,
210
- 'status/deriv/{symbol}/hist': 2.66,
194
+ 'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.7,
195
+ 'stats1/{key}:{size}:{symbol}:{side}/last': 2.7,
196
+ 'stats1/{key}:{size}:{symbol}:{side}/hist': 2.7,
197
+ 'stats1/{key}:{size}:{symbol}/{section}': 2.7,
198
+ 'stats1/{key}:{size}:{symbol}/last': 2.7,
199
+ 'stats1/{key}:{size}:{symbol}/hist': 2.7,
200
+ 'stats1/{key}:{size}:{symbol}:long/last': 2.7,
201
+ 'stats1/{key}:{size}:{symbol}:long/hist': 2.7,
202
+ 'stats1/{key}:{size}:{symbol}:short/last': 2.7,
203
+ 'stats1/{key}:{size}:{symbol}:short/hist': 2.7,
204
+ 'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.7,
205
+ 'candles/trade:{timeframe}:{symbol}/{section}': 2.7,
206
+ 'candles/trade:{timeframe}:{symbol}/last': 2.7,
207
+ 'candles/trade:{timeframe}:{symbol}/hist': 2.7,
208
+ 'status/{type}': 2.7,
209
+ 'status/deriv': 2.7,
210
+ 'status/deriv/{symbol}/hist': 2.7,
211
211
  'liquidations/hist': 80, # 3 requests a minute = 0.05 requests a second =>( 1000ms / rateLimit ) / 0.05 = 80
212
- 'rankings/{key}:{timeframe}:{symbol}/{section}': 2.66,
213
- 'rankings/{key}:{timeframe}:{symbol}/hist': 2.66,
214
- 'pulse/hist': 2.66,
215
- 'pulse/profile/{nickname}': 2.66,
212
+ 'rankings/{key}:{timeframe}:{symbol}/{section}': 2.7,
213
+ 'rankings/{key}:{timeframe}:{symbol}/hist': 2.7,
214
+ 'pulse/hist': 2.7,
215
+ 'pulse/profile/{nickname}': 2.7,
216
216
  'funding/stats/{symbol}/hist': 10, # ratelimit not in docs
217
217
  },
218
218
  'post': {
219
- 'calc/trade/avg': 2.66,
220
- 'calc/fx': 2.66,
219
+ 'calc/trade/avg': 2.7,
220
+ 'calc/fx': 2.7,
221
221
  },
222
222
  },
223
223
  'private': {
224
224
  'post': {
225
225
  # 'auth/r/orders/{symbol}/new', # outdated
226
226
  # 'auth/r/stats/perf:{timeframe}/hist', # outdated
227
- 'auth/r/wallets': 2.66,
228
- 'auth/r/wallets/hist': 2.66,
229
- 'auth/r/orders': 2.66,
230
- 'auth/r/orders/{symbol}': 2.66,
231
- 'auth/w/order/submit': 2.66,
232
- 'auth/w/order/update': 2.66,
233
- 'auth/w/order/cancel': 2.66,
234
- 'auth/w/order/multi': 2.66,
235
- 'auth/w/order/cancel/multi': 2.66,
236
- 'auth/r/orders/{symbol}/hist': 2.66,
237
- 'auth/r/orders/hist': 2.66,
238
- 'auth/r/order/{symbol}:{id}/trades': 2.66,
239
- 'auth/r/trades/{symbol}/hist': 2.66,
240
- 'auth/r/trades/hist': 2.66,
241
- 'auth/r/ledgers/{currency}/hist': 2.66,
242
- 'auth/r/ledgers/hist': 2.66,
243
- 'auth/r/info/margin/{key}': 2.66,
244
- 'auth/r/info/margin/base': 2.66,
245
- 'auth/r/info/margin/sym_all': 2.66,
246
- 'auth/r/positions': 2.66,
247
- 'auth/w/position/claim': 2.66,
248
- 'auth/w/position/increase:': 2.66,
249
- 'auth/r/position/increase/info': 2.66,
250
- 'auth/r/positions/hist': 2.66,
251
- 'auth/r/positions/audit': 2.66,
252
- 'auth/r/positions/snap': 2.66,
253
- 'auth/w/deriv/collateral/set': 2.66,
254
- 'auth/w/deriv/collateral/limits': 2.66,
255
- 'auth/r/funding/offers': 2.66,
256
- 'auth/r/funding/offers/{symbol}': 2.66,
257
- 'auth/w/funding/offer/submit': 2.66,
258
- 'auth/w/funding/offer/cancel': 2.66,
259
- 'auth/w/funding/offer/cancel/all': 2.66,
260
- 'auth/w/funding/close': 2.66,
261
- 'auth/w/funding/auto': 2.66,
262
- 'auth/w/funding/keep': 2.66,
263
- 'auth/r/funding/offers/{symbol}/hist': 2.66,
264
- 'auth/r/funding/offers/hist': 2.66,
265
- 'auth/r/funding/loans': 2.66,
266
- 'auth/r/funding/loans/hist': 2.66,
267
- 'auth/r/funding/loans/{symbol}': 2.66,
268
- 'auth/r/funding/loans/{symbol}/hist': 2.66,
269
- 'auth/r/funding/credits': 2.66,
270
- 'auth/r/funding/credits/hist': 2.66,
271
- 'auth/r/funding/credits/{symbol}': 2.66,
272
- 'auth/r/funding/credits/{symbol}/hist': 2.66,
273
- 'auth/r/funding/trades/{symbol}/hist': 2.66,
274
- 'auth/r/funding/trades/hist': 2.66,
275
- 'auth/r/info/funding/{key}': 2.66,
276
- 'auth/r/info/user': 2.66,
277
- 'auth/r/summary': 2.66,
278
- 'auth/r/logins/hist': 2.66,
279
- 'auth/r/permissions': 2.66,
280
- 'auth/w/token': 2.66,
281
- 'auth/r/audit/hist': 2.66,
282
- 'auth/w/transfer': 2.66, # ratelimit not in docs...
227
+ 'auth/r/wallets': 2.7,
228
+ 'auth/r/wallets/hist': 2.7,
229
+ 'auth/r/orders': 2.7,
230
+ 'auth/r/orders/{symbol}': 2.7,
231
+ 'auth/w/order/submit': 2.7,
232
+ 'auth/w/order/update': 2.7,
233
+ 'auth/w/order/cancel': 2.7,
234
+ 'auth/w/order/multi': 2.7,
235
+ 'auth/w/order/cancel/multi': 2.7,
236
+ 'auth/r/orders/{symbol}/hist': 2.7,
237
+ 'auth/r/orders/hist': 2.7,
238
+ 'auth/r/order/{symbol}:{id}/trades': 2.7,
239
+ 'auth/r/trades/{symbol}/hist': 2.7,
240
+ 'auth/r/trades/hist': 2.7,
241
+ 'auth/r/ledgers/{currency}/hist': 2.7,
242
+ 'auth/r/ledgers/hist': 2.7,
243
+ 'auth/r/info/margin/{key}': 2.7,
244
+ 'auth/r/info/margin/base': 2.7,
245
+ 'auth/r/info/margin/sym_all': 2.7,
246
+ 'auth/r/positions': 2.7,
247
+ 'auth/w/position/claim': 2.7,
248
+ 'auth/w/position/increase:': 2.7,
249
+ 'auth/r/position/increase/info': 2.7,
250
+ 'auth/r/positions/hist': 2.7,
251
+ 'auth/r/positions/audit': 2.7,
252
+ 'auth/r/positions/snap': 2.7,
253
+ 'auth/w/deriv/collateral/set': 2.7,
254
+ 'auth/w/deriv/collateral/limits': 2.7,
255
+ 'auth/r/funding/offers': 2.7,
256
+ 'auth/r/funding/offers/{symbol}': 2.7,
257
+ 'auth/w/funding/offer/submit': 2.7,
258
+ 'auth/w/funding/offer/cancel': 2.7,
259
+ 'auth/w/funding/offer/cancel/all': 2.7,
260
+ 'auth/w/funding/close': 2.7,
261
+ 'auth/w/funding/auto': 2.7,
262
+ 'auth/w/funding/keep': 2.7,
263
+ 'auth/r/funding/offers/{symbol}/hist': 2.7,
264
+ 'auth/r/funding/offers/hist': 2.7,
265
+ 'auth/r/funding/loans': 2.7,
266
+ 'auth/r/funding/loans/hist': 2.7,
267
+ 'auth/r/funding/loans/{symbol}': 2.7,
268
+ 'auth/r/funding/loans/{symbol}/hist': 2.7,
269
+ 'auth/r/funding/credits': 2.7,
270
+ 'auth/r/funding/credits/hist': 2.7,
271
+ 'auth/r/funding/credits/{symbol}': 2.7,
272
+ 'auth/r/funding/credits/{symbol}/hist': 2.7,
273
+ 'auth/r/funding/trades/{symbol}/hist': 2.7,
274
+ 'auth/r/funding/trades/hist': 2.7,
275
+ 'auth/r/info/funding/{key}': 2.7,
276
+ 'auth/r/info/user': 2.7,
277
+ 'auth/r/summary': 2.7,
278
+ 'auth/r/logins/hist': 2.7,
279
+ 'auth/r/permissions': 2.7,
280
+ 'auth/w/token': 2.7,
281
+ 'auth/r/audit/hist': 2.7,
282
+ 'auth/w/transfer': 2.7, # ratelimit not in docs...
283
283
  'auth/w/deposit/address': 24, # 10 requests a minute = 0.166 requests per second =>( 1000ms / rateLimit ) / 0.166 = 24
284
284
  'auth/w/deposit/invoice': 24, # ratelimit not in docs
285
285
  'auth/w/withdraw': 24, # ratelimit not in docs
286
- 'auth/r/movements/{currency}/hist': 2.66,
287
- 'auth/r/movements/hist': 2.66,
288
- 'auth/r/alerts': 5.33, # 45 requests a minute = 0.75 requests per second =>( 1000ms / rateLimit ) / 0.75 => 5.33
289
- 'auth/w/alert/set': 2.66,
290
- 'auth/w/alert/price:{symbol}:{price}/del': 2.66,
291
- 'auth/w/alert/{type}:{symbol}:{price}/del': 2.66,
292
- 'auth/calc/order/avail': 2.66,
293
- 'auth/w/settings/set': 2.66,
294
- 'auth/r/settings': 2.66,
295
- 'auth/w/settings/del': 2.66,
296
- 'auth/r/pulse/hist': 2.66,
286
+ 'auth/r/movements/{currency}/hist': 2.7,
287
+ 'auth/r/movements/hist': 2.7,
288
+ 'auth/r/alerts': 5.34, # 45 requests a minute = 0.75 requests per second =>( 1000ms / rateLimit ) / 0.749 => 5.34
289
+ 'auth/w/alert/set': 2.7,
290
+ 'auth/w/alert/price:{symbol}:{price}/del': 2.7,
291
+ 'auth/w/alert/{type}:{symbol}:{price}/del': 2.7,
292
+ 'auth/calc/order/avail': 2.7,
293
+ 'auth/w/settings/set': 2.7,
294
+ 'auth/r/settings': 2.7,
295
+ 'auth/w/settings/del': 2.7,
296
+ 'auth/r/pulse/hist': 2.7,
297
297
  'auth/w/pulse/add': 16, # 15 requests a minute = 0.25 requests per second =>( 1000ms / rateLimit ) / 0.25 => 16
298
- 'auth/w/pulse/del': 2.66,
298
+ 'auth/w/pulse/del': 2.7,
299
299
  },
300
300
  },
301
301
  },
@@ -3161,6 +3161,7 @@ class bitget(Exchange, ImplicitAPI):
3161
3161
  :param dict [params]: extra parameters specific to the exchange API endpoint
3162
3162
  :param int [params.until]: timestamp in ms of the latest candle to fetch
3163
3163
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
3164
+ :param str [params.price]: *swap only* "mark"(to fetch mark price candles) or "index"(to fetch index price candles)
3164
3165
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
3165
3166
  """
3166
3167
  await self.load_markets()
@@ -3186,52 +3187,42 @@ class bitget(Exchange, ImplicitAPI):
3186
3187
  params = self.omit(params, ['until', 'till'])
3187
3188
  if limit is not None:
3188
3189
  request['limit'] = limit
3189
- options = self.safe_value(self.options, 'fetchOHLCV', {})
3190
- spotOptions = self.safe_value(options, 'spot', {})
3191
- defaultSpotMethod = self.safe_string(spotOptions, 'method', 'publicSpotGetV2SpotMarketCandles')
3192
- method = self.safe_string(params, 'method', defaultSpotMethod)
3193
- params = self.omit(params, 'method')
3194
- if method != 'publicSpotGetV2SpotMarketHistoryCandles':
3195
- if since is not None:
3196
- request['startTime'] = since
3197
- if until is not None:
3198
- request['endTime'] = until
3190
+ if since is not None:
3191
+ request['startTime'] = since
3192
+ if since is not None:
3193
+ if limit is None:
3194
+ limit = 100 # exchange default
3195
+ duration = self.parse_timeframe(timeframe) * 1000
3196
+ request['endTime'] = self.sum(since, duration * (limit + 1)) - 1 # limit + 1)) - 1 is needed for when since is not the exact timestamp of a candle
3197
+ elif until is not None:
3198
+ request['endTime'] = until
3199
+ else:
3200
+ request['endTime'] = self.milliseconds()
3199
3201
  response = None
3202
+ thirtyOneDaysAgo = self.milliseconds() - 2678400000
3200
3203
  if market['spot']:
3201
- if method == 'publicSpotGetV2SpotMarketCandles':
3202
- response = await self.publicSpotGetV2SpotMarketCandles(self.extend(request, params))
3203
- elif method == 'publicSpotGetV2SpotMarketHistoryCandles':
3204
- if since is not None:
3205
- if limit is None:
3206
- limit = 100 # exchange default
3207
- duration = self.parse_timeframe(timeframe) * 1000
3208
- request['endTime'] = self.sum(since, duration * limit)
3209
- elif until is not None:
3210
- request['endTime'] = until
3211
- else:
3212
- request['endTime'] = self.milliseconds()
3204
+ if (since is not None) and (since < thirtyOneDaysAgo):
3213
3205
  response = await self.publicSpotGetV2SpotMarketHistoryCandles(self.extend(request, params))
3206
+ else:
3207
+ response = await self.publicSpotGetV2SpotMarketCandles(self.extend(request, params))
3214
3208
  else:
3215
- swapOptions = self.safe_value(options, 'swap', {})
3216
- defaultSwapMethod = self.safe_string(swapOptions, 'method', 'publicMixGetV2MixMarketCandles')
3217
- swapMethod = self.safe_string(params, 'method', defaultSwapMethod)
3218
3209
  priceType = self.safe_string(params, 'price')
3219
- params = self.omit(params, ['method', 'price'])
3210
+ params = self.omit(params, ['price'])
3220
3211
  productType = None
3221
3212
  productType, params = self.handle_product_type_and_params(market, params)
3222
3213
  request['productType'] = productType
3223
- if (priceType == 'mark') or (swapMethod == 'publicMixGetV2MixMarketHistoryMarkCandles'):
3214
+ if priceType == 'mark':
3224
3215
  response = await self.publicMixGetV2MixMarketHistoryMarkCandles(self.extend(request, params))
3225
- elif (priceType == 'index') or (swapMethod == 'publicMixGetV2MixMarketHistoryIndexCandles'):
3216
+ elif priceType == 'index':
3226
3217
  response = await self.publicMixGetV2MixMarketHistoryIndexCandles(self.extend(request, params))
3227
- elif swapMethod == 'publicMixGetV2MixMarketCandles':
3228
- response = await self.publicMixGetV2MixMarketCandles(self.extend(request, params))
3229
- elif swapMethod == 'publicMixGetV2MixMarketHistoryCandles':
3218
+ elif (since is not None) and (since < thirtyOneDaysAgo):
3230
3219
  response = await self.publicMixGetV2MixMarketHistoryCandles(self.extend(request, params))
3220
+ else:
3221
+ response = await self.publicMixGetV2MixMarketCandles(self.extend(request, params))
3231
3222
  if response == '':
3232
3223
  return [] # happens when a new token is listed
3233
3224
  # [["1645911960000","39406","39407","39374.5","39379","35.526","1399132.341"]]
3234
- data = self.safe_value(response, 'data', response)
3225
+ data = self.safe_list(response, 'data', response)
3235
3226
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
3236
3227
 
3237
3228
  async def fetch_balance(self, params={}) -> Balances:
@@ -197,6 +197,7 @@ class bithumb(Exchange, ImplicitAPI):
197
197
  async def fetch_markets(self, params={}):
198
198
  """
199
199
  retrieves data on all markets for bithumb
200
+ :see: https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C-all
200
201
  :param dict [params]: extra parameters specific to the exchange API endpoint
201
202
  :returns dict[]: an array of objects representing market data
202
203
  """
@@ -291,6 +292,7 @@ class bithumb(Exchange, ImplicitAPI):
291
292
  async def fetch_balance(self, params={}) -> Balances:
292
293
  """
293
294
  query for balance and get the amount of funds available for trading or funds locked in orders
295
+ :see: https://apidocs.bithumb.com/reference/%EB%B3%B4%EC%9C%A0%EC%9E%90%EC%82%B0-%EC%A1%B0%ED%9A%8C
294
296
  :param dict [params]: extra parameters specific to the exchange API endpoint
295
297
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
296
298
  """
@@ -304,6 +306,7 @@ class bithumb(Exchange, ImplicitAPI):
304
306
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
305
307
  """
306
308
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
309
+ :see: https://apidocs.bithumb.com/reference/%ED%98%B8%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C
307
310
  :param str symbol: unified symbol of the market to fetch the order book for
308
311
  :param int [limit]: the maximum amount of order book entries to return
309
312
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -393,6 +396,7 @@ class bithumb(Exchange, ImplicitAPI):
393
396
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
394
397
  """
395
398
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
399
+ :see: https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C-all
396
400
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
397
401
  :param dict [params]: extra parameters specific to the exchange API endpoint
398
402
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -446,6 +450,7 @@ class bithumb(Exchange, ImplicitAPI):
446
450
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
447
451
  """
448
452
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
453
+ :see: https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C
449
454
  :param str symbol: unified symbol of the market to fetch the ticker for
450
455
  :param dict [params]: extra parameters specific to the exchange API endpoint
451
456
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -502,6 +507,7 @@ class bithumb(Exchange, ImplicitAPI):
502
507
  async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
503
508
  """
504
509
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
510
+ :see: https://apidocs.bithumb.com/reference/candlestick-rest-api
505
511
  :param str symbol: unified symbol of the market to fetch OHLCV data for
506
512
  :param str timeframe: the length of time each candle represents
507
513
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -618,6 +624,7 @@ class bithumb(Exchange, ImplicitAPI):
618
624
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
619
625
  """
620
626
  get the list of most recent trades for a particular symbol
627
+ :see: https://apidocs.bithumb.com/reference/%EC%B5%9C%EA%B7%BC-%EC%B2%B4%EA%B2%B0-%EB%82%B4%EC%97%AD
621
628
  :param str symbol: unified symbol of the market to fetch trades for
622
629
  :param int [since]: timestamp in ms of the earliest trade to fetch
623
630
  :param int [limit]: the maximum amount of trades to fetch
@@ -653,6 +660,9 @@ class bithumb(Exchange, ImplicitAPI):
653
660
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
654
661
  """
655
662
  create a trade order
663
+ :see: https://apidocs.bithumb.com/reference/%EC%A7%80%EC%A0%95%EA%B0%80-%EC%A3%BC%EB%AC%B8%ED%95%98%EA%B8%B0
664
+ :see: https://apidocs.bithumb.com/reference/%EC%8B%9C%EC%9E%A5%EA%B0%80-%EB%A7%A4%EC%88%98%ED%95%98%EA%B8%B0
665
+ :see: https://apidocs.bithumb.com/reference/%EC%8B%9C%EC%9E%A5%EA%B0%80-%EB%A7%A4%EB%8F%84%ED%95%98%EA%B8%B0
656
666
  :param str symbol: unified symbol of the market to create an order in
657
667
  :param str type: 'market' or 'limit'
658
668
  :param str side: 'buy' or 'sell'
@@ -689,6 +699,7 @@ class bithumb(Exchange, ImplicitAPI):
689
699
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
690
700
  """
691
701
  fetches information on an order made by the user
702
+ :see: https://apidocs.bithumb.com/reference/%EA%B1%B0%EB%9E%98-%EC%A3%BC%EB%AC%B8%EB%82%B4%EC%97%AD-%EC%83%81%EC%84%B8-%EC%A1%B0%ED%9A%8C
692
703
  :param str symbol: unified symbol of the market the order was made in
693
704
  :param dict [params]: extra parameters specific to the exchange API endpoint
694
705
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -838,6 +849,7 @@ class bithumb(Exchange, ImplicitAPI):
838
849
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
839
850
  """
840
851
  fetch all unfilled currently open orders
852
+ :see: https://apidocs.bithumb.com/reference/%EA%B1%B0%EB%9E%98-%EC%A3%BC%EB%AC%B8%EB%82%B4%EC%97%AD-%EC%A1%B0%ED%9A%8C
841
853
  :param str symbol: unified market symbol
842
854
  :param int [since]: the earliest time in ms to fetch open orders for
843
855
  :param int [limit]: the maximum number of open order structures to retrieve
@@ -881,6 +893,7 @@ class bithumb(Exchange, ImplicitAPI):
881
893
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
882
894
  """
883
895
  cancels an open order
896
+ :see: https://apidocs.bithumb.com/reference/%EC%A3%BC%EB%AC%B8-%EC%B7%A8%EC%86%8C%ED%95%98%EA%B8%B0
884
897
  :param str id: order id
885
898
  :param str symbol: unified symbol of the market the order was made in
886
899
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -912,6 +925,7 @@ class bithumb(Exchange, ImplicitAPI):
912
925
  async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
913
926
  """
914
927
  make a withdrawal
928
+ :see: https://apidocs.bithumb.com/reference/%EC%BD%94%EC%9D%B8-%EC%B6%9C%EA%B8%88%ED%95%98%EA%B8%B0-%EA%B0%9C%EC%9D%B8
915
929
  :param str code: unified currency code
916
930
  :param float amount: the amount to withdraw
917
931
  :param str address: the address to withdraw to