ccxt 4.1.56 → 4.1.57

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 (316) hide show
  1. package/.git-templates/hooks/pre-push +2 -2
  2. package/README.md +3 -3
  3. package/build.sh +30 -18
  4. package/dist/ccxt.browser.js +3872 -3202
  5. package/dist/ccxt.browser.min.js +10 -10
  6. package/dist/cjs/ccxt.js +1 -1
  7. package/dist/cjs/src/ace.js +17 -13
  8. package/dist/cjs/src/alpaca.js +6 -6
  9. package/dist/cjs/src/ascendex.js +35 -29
  10. package/dist/cjs/src/base/Exchange.js +39 -26
  11. package/dist/cjs/src/base/Precise.js +1 -3
  12. package/dist/cjs/src/bigone.js +24 -20
  13. package/dist/cjs/src/binance.js +97 -76
  14. package/dist/cjs/src/bingx.js +63 -44
  15. package/dist/cjs/src/bit2c.js +18 -15
  16. package/dist/cjs/src/bitbank.js +16 -15
  17. package/dist/cjs/src/bitbns.js +28 -18
  18. package/dist/cjs/src/bitfinex.js +23 -21
  19. package/dist/cjs/src/bitfinex2.js +32 -28
  20. package/dist/cjs/src/bitflyer.js +28 -20
  21. package/dist/cjs/src/bitforex.js +25 -18
  22. package/dist/cjs/src/bitget.js +184 -147
  23. package/dist/cjs/src/bithumb.js +23 -16
  24. package/dist/cjs/src/bitmart.js +106 -85
  25. package/dist/cjs/src/bitmex.js +104 -64
  26. package/dist/cjs/src/bitopro.js +38 -26
  27. package/dist/cjs/src/bitpanda.js +24 -23
  28. package/dist/cjs/src/bitrue.js +33 -24
  29. package/dist/cjs/src/bitso.js +24 -23
  30. package/dist/cjs/src/bitstamp.js +24 -23
  31. package/dist/cjs/src/bittrex.js +30 -29
  32. package/dist/cjs/src/bitvavo.js +38 -30
  33. package/dist/cjs/src/bl3p.js +11 -10
  34. package/dist/cjs/src/blockchaincom.js +20 -20
  35. package/dist/cjs/src/btcalpha.js +18 -17
  36. package/dist/cjs/src/btcbox.js +13 -12
  37. package/dist/cjs/src/btcmarkets.js +20 -19
  38. package/dist/cjs/src/btcturk.js +14 -13
  39. package/dist/cjs/src/bybit.js +84 -54
  40. package/dist/cjs/src/cex.js +16 -14
  41. package/dist/cjs/src/coinbase.js +29 -27
  42. package/dist/cjs/src/coinbasepro.js +27 -25
  43. package/dist/cjs/src/coincheck.js +15 -14
  44. package/dist/cjs/src/coinex.js +100 -77
  45. package/dist/cjs/src/coinlist.js +28 -27
  46. package/dist/cjs/src/coinmate.js +20 -17
  47. package/dist/cjs/src/coinone.js +21 -16
  48. package/dist/cjs/src/coinsph.js +37 -28
  49. package/dist/cjs/src/coinspot.js +12 -11
  50. package/dist/cjs/src/cryptocom.js +40 -202
  51. package/dist/cjs/src/currencycom.js +32 -25
  52. package/dist/cjs/src/delta.js +34 -28
  53. package/dist/cjs/src/deribit.js +39 -36
  54. package/dist/cjs/src/digifinex.js +64 -44
  55. package/dist/cjs/src/exmo.js +29 -27
  56. package/dist/cjs/src/gate.js +67 -53
  57. package/dist/cjs/src/gemini.js +23 -20
  58. package/dist/cjs/src/hitbtc.js +65 -56
  59. package/dist/cjs/src/hollaex.js +30 -27
  60. package/dist/cjs/src/htx.js +132 -143
  61. package/dist/cjs/src/huobijp.js +22 -20
  62. package/dist/cjs/src/idex.js +22 -21
  63. package/dist/cjs/src/independentreserve.js +15 -14
  64. package/dist/cjs/src/indodax.js +30 -26
  65. package/dist/cjs/src/kraken.js +29 -27
  66. package/dist/cjs/src/krakenfutures.js +29 -22
  67. package/dist/cjs/src/kucoin.js +48 -43
  68. package/dist/cjs/src/kucoinfutures.js +33 -28
  69. package/dist/cjs/src/kuna.js +25 -24
  70. package/dist/cjs/src/latoken.js +24 -22
  71. package/dist/cjs/src/lbank.js +45 -30
  72. package/dist/cjs/src/luno.js +22 -19
  73. package/dist/cjs/src/lykke.js +19 -17
  74. package/dist/cjs/src/mercado.js +30 -19
  75. package/dist/cjs/src/mexc.js +60 -49
  76. package/dist/cjs/src/ndax.js +23 -22
  77. package/dist/cjs/src/novadax.js +23 -22
  78. package/dist/cjs/src/oceanex.js +22 -19
  79. package/dist/cjs/src/okcoin.js +29 -23
  80. package/dist/cjs/src/okx.js +87 -82
  81. package/dist/cjs/src/p2b.js +79 -82
  82. package/dist/cjs/src/paymium.js +10 -10
  83. package/dist/cjs/src/phemex.js +63 -40
  84. package/dist/cjs/src/poloniex.js +22 -22
  85. package/dist/cjs/src/poloniexfutures.js +23 -19
  86. package/dist/cjs/src/pro/alpaca.js +5 -5
  87. package/dist/cjs/src/pro/ascendex.js +4 -4
  88. package/dist/cjs/src/pro/binance.js +16 -16
  89. package/dist/cjs/src/pro/bingx.js +1 -1
  90. package/dist/cjs/src/pro/bitfinex.js +4 -4
  91. package/dist/cjs/src/pro/bitfinex2.js +6 -6
  92. package/dist/cjs/src/pro/bitget.js +7 -7
  93. package/dist/cjs/src/pro/bitmart.js +7 -5
  94. package/dist/cjs/src/pro/bitmex.js +6 -6
  95. package/dist/cjs/src/pro/bitopro.js +4 -4
  96. package/dist/cjs/src/pro/bitpanda.js +6 -6
  97. package/dist/cjs/src/pro/bitrue.js +2 -2
  98. package/dist/cjs/src/pro/bitstamp.js +6 -4
  99. package/dist/cjs/src/pro/bittrex.js +6 -6
  100. package/dist/cjs/src/pro/bitvavo.js +11 -7
  101. package/dist/cjs/src/pro/blockchaincom.js +8 -8
  102. package/dist/cjs/src/pro/bybit.js +7 -7
  103. package/dist/cjs/src/pro/cex.js +13 -9
  104. package/dist/cjs/src/pro/coinbase.js +5 -5
  105. package/dist/cjs/src/pro/coinbasepro.js +11 -10
  106. package/dist/cjs/src/pro/coinex.js +7 -9
  107. package/dist/cjs/src/pro/cryptocom.js +9 -9
  108. package/dist/cjs/src/pro/currencycom.js +4 -4
  109. package/dist/cjs/src/pro/deribit.js +6 -6
  110. package/dist/cjs/src/pro/exmo.js +12 -14
  111. package/dist/cjs/src/pro/gate.js +7 -7
  112. package/dist/cjs/src/pro/gemini.js +3 -3
  113. package/dist/cjs/src/pro/hitbtc.js +263 -4
  114. package/dist/cjs/src/pro/hollaex.js +5 -5
  115. package/dist/cjs/src/pro/htx.js +6 -6
  116. package/dist/cjs/src/pro/huobijp.js +3 -3
  117. package/dist/cjs/src/pro/idex.js +4 -4
  118. package/dist/cjs/src/pro/independentreserve.js +2 -2
  119. package/dist/cjs/src/pro/kraken.js +10 -10
  120. package/dist/cjs/src/pro/krakenfutures.js +41 -17
  121. package/dist/cjs/src/pro/kucoin.js +7 -7
  122. package/dist/cjs/src/pro/kucoinfutures.js +8 -6
  123. package/dist/cjs/src/pro/luno.js +2 -2
  124. package/dist/cjs/src/pro/mexc.js +6 -6
  125. package/dist/cjs/src/pro/ndax.js +3 -3
  126. package/dist/cjs/src/pro/okcoin.js +5 -5
  127. package/dist/cjs/src/pro/okx.js +12 -12
  128. package/dist/cjs/src/pro/phemex.js +6 -6
  129. package/dist/cjs/src/pro/poloniex.js +7 -7
  130. package/dist/cjs/src/pro/poloniexfutures.js +5 -5
  131. package/dist/cjs/src/pro/probit.js +6 -6
  132. package/dist/cjs/src/pro/upbit.js +3 -3
  133. package/dist/cjs/src/pro/wazirx.js +8 -8
  134. package/dist/cjs/src/pro/whitebit.js +12 -8
  135. package/dist/cjs/src/pro/woo.js +1 -1
  136. package/dist/cjs/src/probit.js +28 -23
  137. package/dist/cjs/src/tidex.js +16 -15
  138. package/dist/cjs/src/timex.js +19 -18
  139. package/dist/cjs/src/tokocrypto.js +27 -22
  140. package/dist/cjs/src/upbit.js +19 -19
  141. package/dist/cjs/src/wavesexchange.js +22 -19
  142. package/dist/cjs/src/wazirx.js +24 -17
  143. package/dist/cjs/src/whitebit.js +33 -27
  144. package/dist/cjs/src/woo.js +44 -34
  145. package/dist/cjs/src/yobit.js +25 -20
  146. package/dist/cjs/src/zaif.js +9 -9
  147. package/dist/cjs/src/zonda.js +18 -17
  148. package/js/ccxt.d.ts +1 -1
  149. package/js/ccxt.js +1 -1
  150. package/js/src/abstract/bybit.d.ts +1 -0
  151. package/js/src/abstract/cryptocom.d.ts +0 -20
  152. package/js/src/ace.js +18 -14
  153. package/js/src/alpaca.js +6 -6
  154. package/js/src/ascendex.js +35 -29
  155. package/js/src/base/Exchange.d.ts +37 -34
  156. package/js/src/base/Exchange.js +39 -26
  157. package/js/src/base/Precise.d.ts +4 -4
  158. package/js/src/base/Precise.js +1 -3
  159. package/js/src/base/functions/type.d.ts +25 -25
  160. package/js/src/base/types.d.ts +21 -14
  161. package/js/src/bigone.js +25 -21
  162. package/js/src/binance.d.ts +2 -2
  163. package/js/src/binance.js +97 -76
  164. package/js/src/bingx.js +63 -44
  165. package/js/src/bit2c.js +19 -16
  166. package/js/src/bitbank.js +16 -15
  167. package/js/src/bitbns.js +28 -18
  168. package/js/src/bitfinex.js +23 -21
  169. package/js/src/bitfinex2.js +32 -28
  170. package/js/src/bitflyer.js +28 -20
  171. package/js/src/bitforex.js +26 -19
  172. package/js/src/bitget.d.ts +25 -3
  173. package/js/src/bitget.js +184 -147
  174. package/js/src/bithumb.js +23 -16
  175. package/js/src/bitmart.d.ts +1 -1
  176. package/js/src/bitmart.js +106 -85
  177. package/js/src/bitmex.d.ts +2 -2
  178. package/js/src/bitmex.js +104 -64
  179. package/js/src/bitopro.js +38 -26
  180. package/js/src/bitpanda.js +24 -23
  181. package/js/src/bitrue.js +33 -24
  182. package/js/src/bitso.js +24 -23
  183. package/js/src/bitstamp.d.ts +2 -2
  184. package/js/src/bitstamp.js +24 -23
  185. package/js/src/bittrex.js +30 -29
  186. package/js/src/bitvavo.js +38 -30
  187. package/js/src/bl3p.js +11 -10
  188. package/js/src/blockchaincom.js +20 -20
  189. package/js/src/btcalpha.js +18 -17
  190. package/js/src/btcbox.js +13 -12
  191. package/js/src/btcmarkets.js +20 -19
  192. package/js/src/btcturk.js +14 -13
  193. package/js/src/bybit.d.ts +1 -1
  194. package/js/src/bybit.js +84 -54
  195. package/js/src/cex.js +16 -14
  196. package/js/src/coinbase.js +29 -27
  197. package/js/src/coinbasepro.js +27 -25
  198. package/js/src/coincheck.js +15 -14
  199. package/js/src/coinex.d.ts +1 -1
  200. package/js/src/coinex.js +100 -77
  201. package/js/src/coinlist.js +28 -27
  202. package/js/src/coinmate.js +21 -18
  203. package/js/src/coinone.js +21 -16
  204. package/js/src/coinsph.js +37 -28
  205. package/js/src/coinspot.js +12 -11
  206. package/js/src/cryptocom.d.ts +0 -23
  207. package/js/src/cryptocom.js +40 -202
  208. package/js/src/currencycom.js +32 -25
  209. package/js/src/delta.js +35 -29
  210. package/js/src/deribit.js +39 -36
  211. package/js/src/digifinex.d.ts +2 -2
  212. package/js/src/digifinex.js +65 -45
  213. package/js/src/exmo.js +29 -27
  214. package/js/src/gate.d.ts +1 -1
  215. package/js/src/gate.js +67 -53
  216. package/js/src/gemini.js +23 -20
  217. package/js/src/hitbtc.d.ts +1 -0
  218. package/js/src/hitbtc.js +65 -56
  219. package/js/src/hollaex.js +30 -27
  220. package/js/src/htx.d.ts +11 -3
  221. package/js/src/htx.js +132 -143
  222. package/js/src/huobijp.js +23 -21
  223. package/js/src/idex.js +22 -21
  224. package/js/src/independentreserve.js +15 -14
  225. package/js/src/indodax.js +30 -26
  226. package/js/src/kraken.js +29 -27
  227. package/js/src/krakenfutures.js +29 -22
  228. package/js/src/kucoin.d.ts +1 -1
  229. package/js/src/kucoin.js +48 -43
  230. package/js/src/kucoinfutures.js +33 -28
  231. package/js/src/kuna.js +25 -24
  232. package/js/src/latoken.js +25 -23
  233. package/js/src/lbank.js +46 -31
  234. package/js/src/luno.js +22 -19
  235. package/js/src/lykke.js +19 -17
  236. package/js/src/mercado.js +30 -19
  237. package/js/src/mexc.d.ts +1 -1
  238. package/js/src/mexc.js +60 -49
  239. package/js/src/ndax.js +23 -22
  240. package/js/src/novadax.js +23 -22
  241. package/js/src/oceanex.js +22 -19
  242. package/js/src/okcoin.js +29 -23
  243. package/js/src/okx.d.ts +2 -2
  244. package/js/src/okx.js +87 -82
  245. package/js/src/p2b.d.ts +8 -7
  246. package/js/src/p2b.js +79 -81
  247. package/js/src/paymium.js +10 -10
  248. package/js/src/phemex.js +63 -40
  249. package/js/src/poloniex.js +22 -22
  250. package/js/src/poloniexfutures.js +23 -19
  251. package/js/src/pro/alpaca.js +5 -5
  252. package/js/src/pro/ascendex.js +4 -4
  253. package/js/src/pro/binance.js +16 -16
  254. package/js/src/pro/bingx.js +1 -1
  255. package/js/src/pro/bitfinex.js +4 -4
  256. package/js/src/pro/bitfinex2.d.ts +1 -1
  257. package/js/src/pro/bitfinex2.js +6 -6
  258. package/js/src/pro/bitget.js +7 -7
  259. package/js/src/pro/bitmart.js +7 -5
  260. package/js/src/pro/bitmex.js +6 -6
  261. package/js/src/pro/bitopro.js +4 -4
  262. package/js/src/pro/bitpanda.js +6 -6
  263. package/js/src/pro/bitrue.js +2 -2
  264. package/js/src/pro/bitstamp.js +7 -5
  265. package/js/src/pro/bittrex.js +6 -6
  266. package/js/src/pro/bitvavo.js +12 -8
  267. package/js/src/pro/blockchaincom.js +8 -8
  268. package/js/src/pro/bybit.js +7 -7
  269. package/js/src/pro/cex.js +14 -10
  270. package/js/src/pro/coinbase.js +5 -5
  271. package/js/src/pro/coinbasepro.js +12 -11
  272. package/js/src/pro/coinex.js +7 -9
  273. package/js/src/pro/cryptocom.js +9 -9
  274. package/js/src/pro/currencycom.js +4 -4
  275. package/js/src/pro/deribit.js +6 -6
  276. package/js/src/pro/exmo.js +12 -14
  277. package/js/src/pro/gate.js +7 -7
  278. package/js/src/pro/gemini.js +3 -3
  279. package/js/src/pro/hitbtc.d.ts +8 -1
  280. package/js/src/pro/hitbtc.js +264 -5
  281. package/js/src/pro/hollaex.js +5 -5
  282. package/js/src/pro/htx.js +6 -6
  283. package/js/src/pro/huobijp.js +3 -3
  284. package/js/src/pro/idex.js +4 -4
  285. package/js/src/pro/independentreserve.js +2 -2
  286. package/js/src/pro/kraken.js +10 -10
  287. package/js/src/pro/krakenfutures.d.ts +1 -0
  288. package/js/src/pro/krakenfutures.js +42 -18
  289. package/js/src/pro/kucoin.js +7 -7
  290. package/js/src/pro/kucoinfutures.js +8 -6
  291. package/js/src/pro/luno.js +2 -2
  292. package/js/src/pro/mexc.js +6 -6
  293. package/js/src/pro/ndax.js +3 -3
  294. package/js/src/pro/okcoin.js +5 -5
  295. package/js/src/pro/okx.js +12 -12
  296. package/js/src/pro/phemex.js +6 -6
  297. package/js/src/pro/poloniex.js +7 -7
  298. package/js/src/pro/poloniexfutures.js +5 -5
  299. package/js/src/pro/probit.js +6 -6
  300. package/js/src/pro/upbit.js +3 -3
  301. package/js/src/pro/wazirx.js +8 -8
  302. package/js/src/pro/whitebit.js +13 -9
  303. package/js/src/pro/woo.js +1 -1
  304. package/js/src/probit.js +29 -24
  305. package/js/src/tidex.js +16 -15
  306. package/js/src/timex.js +19 -18
  307. package/js/src/tokocrypto.js +28 -23
  308. package/js/src/upbit.js +19 -19
  309. package/js/src/wavesexchange.js +23 -20
  310. package/js/src/wazirx.js +25 -18
  311. package/js/src/whitebit.js +33 -27
  312. package/js/src/woo.js +45 -35
  313. package/js/src/yobit.js +25 -20
  314. package/js/src/zaif.js +9 -9
  315. package/js/src/zonda.js +18 -17
  316. package/package.json +1 -1
package/js/src/btcturk.js CHANGED
@@ -35,16 +35,17 @@ export default class btcturk extends Exchange {
35
35
  'createOrder': true,
36
36
  'createReduceOnlyOrder': false,
37
37
  'fetchBalance': true,
38
- 'fetchBorrowRate': false,
39
38
  'fetchBorrowRateHistories': false,
40
39
  'fetchBorrowRateHistory': false,
41
- 'fetchBorrowRates': false,
42
- 'fetchBorrowRatesPerSymbol': false,
40
+ 'fetchCrossBorrowRate': false,
41
+ 'fetchCrossBorrowRates': false,
43
42
  'fetchFundingHistory': false,
44
43
  'fetchFundingRate': false,
45
44
  'fetchFundingRateHistory': false,
46
45
  'fetchFundingRates': false,
47
46
  'fetchIndexOHLCV': false,
47
+ 'fetchIsolatedBorrowRate': false,
48
+ 'fetchIsolatedBorrowRates': false,
48
49
  'fetchLeverage': false,
49
50
  'fetchMarginMode': false,
50
51
  'fetchMarkets': true,
@@ -294,7 +295,7 @@ export default class btcturk extends Exchange {
294
295
  * @name btcturk#fetchBalance
295
296
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
296
297
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
297
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
298
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
298
299
  */
299
300
  await this.loadMarkets();
300
301
  const response = await this.privateGetUsersBalances(params);
@@ -324,7 +325,7 @@ export default class btcturk extends Exchange {
324
325
  * @param {string} symbol unified symbol of the market to fetch the order book for
325
326
  * @param {int} [limit] the maximum amount of order book entries to return
326
327
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
327
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
328
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
328
329
  */
329
330
  await this.loadMarkets();
330
331
  const market = this.market(symbol);
@@ -403,7 +404,7 @@ export default class btcturk extends Exchange {
403
404
  * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
404
405
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
405
406
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
406
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
407
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
407
408
  */
408
409
  await this.loadMarkets();
409
410
  const response = await this.publicGetTicker(params);
@@ -417,7 +418,7 @@ export default class btcturk extends Exchange {
417
418
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
418
419
  * @param {string} symbol unified symbol of the market to fetch the ticker for
419
420
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
420
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
421
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
421
422
  */
422
423
  await this.loadMarkets();
423
424
  const tickers = await this.fetchTickers([symbol], params);
@@ -494,7 +495,7 @@ export default class btcturk extends Exchange {
494
495
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
495
496
  * @param {int} [limit] the maximum amount of trades to fetch
496
497
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
497
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
498
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
498
499
  */
499
500
  await this.loadMarkets();
500
501
  const market = this.market(symbol);
@@ -659,7 +660,7 @@ export default class btcturk extends Exchange {
659
660
  * @param {float} amount how much of currency you want to trade in units of base currency
660
661
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
661
662
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
662
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
663
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
663
664
  */
664
665
  await this.loadMarkets();
665
666
  const market = this.market(symbol);
@@ -690,7 +691,7 @@ export default class btcturk extends Exchange {
690
691
  * @param {string} id order id
691
692
  * @param {string} symbol not used by btcturk cancelOrder ()
692
693
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
693
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
694
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
694
695
  */
695
696
  const request = {
696
697
  'id': id,
@@ -706,7 +707,7 @@ export default class btcturk extends Exchange {
706
707
  * @param {int} [since] the earliest time in ms to fetch open orders for
707
708
  * @param {int} [limit] the maximum number of open orders structures to retrieve
708
709
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
709
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
710
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
710
711
  */
711
712
  await this.loadMarkets();
712
713
  const request = {};
@@ -730,7 +731,7 @@ export default class btcturk extends Exchange {
730
731
  * @param {int} [since] the earliest time in ms to fetch orders for
731
732
  * @param {int} [limit] the maximum number of orde structures to retrieve
732
733
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
733
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
734
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
734
735
  */
735
736
  await this.loadMarkets();
736
737
  const market = this.market(symbol);
@@ -852,7 +853,7 @@ export default class btcturk extends Exchange {
852
853
  * @param {int} [since] the earliest time in ms to fetch trades for
853
854
  * @param {int} [limit] the maximum number of trades structures to retrieve
854
855
  * @param {object} [params] extra parameters specific to the btcturk api endpoint
855
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
856
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
856
857
  */
857
858
  await this.loadMarkets();
858
859
  let market = undefined;
package/js/src/bybit.d.ts CHANGED
@@ -127,7 +127,7 @@ export default class bybit extends Exchange {
127
127
  fetchOpenInterest(symbol: string, params?: {}): Promise<OpenInterest>;
128
128
  fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OpenInterest[]>;
129
129
  parseOpenInterest(interest: any, market?: Market): OpenInterest;
130
- fetchBorrowRate(code: string, params?: {}): Promise<{
130
+ fetchCrossBorrowRate(code: string, params?: {}): Promise<{
131
131
  currency: string;
132
132
  rate: number;
133
133
  period: number;
package/js/src/bybit.js CHANGED
@@ -47,12 +47,12 @@ export default class bybit extends Exchange {
47
47
  'editOrder': true,
48
48
  'fetchBalance': true,
49
49
  'fetchBorrowInterest': false,
50
- 'fetchBorrowRate': true,
51
50
  'fetchBorrowRateHistories': false,
52
51
  'fetchBorrowRateHistory': false,
53
- 'fetchBorrowRates': false,
54
52
  'fetchCanceledOrders': true,
55
53
  'fetchClosedOrders': true,
54
+ 'fetchCrossBorrowRate': true,
55
+ 'fetchCrossBorrowRates': false,
56
56
  'fetchCurrencies': true,
57
57
  'fetchDeposit': false,
58
58
  'fetchDepositAddress': true,
@@ -66,6 +66,8 @@ export default class bybit extends Exchange {
66
66
  'fetchFundingRates': true,
67
67
  'fetchGreeks': true,
68
68
  'fetchIndexOHLCV': true,
69
+ 'fetchIsolatedBorrowRate': false,
70
+ 'fetchIsolatedBorrowRates': false,
69
71
  'fetchLedger': true,
70
72
  'fetchMarketLeverageTiers': true,
71
73
  'fetchMarkets': true,
@@ -440,6 +442,7 @@ export default class bybit extends Exchange {
440
442
  // account
441
443
  'v5/account/upgrade-to-uta': 5,
442
444
  'v5/account/set-margin-mode': 5,
445
+ 'v5/account/set-hedging-mode': 5,
443
446
  'v5/account/mmp-modify': 5,
444
447
  'v5/account/mmp-reset': 5,
445
448
  // asset
@@ -2003,9 +2006,11 @@ export default class bybit extends Exchange {
2003
2006
  * @see https://bybit-exchange.github.io/docs/v5/market/tickers
2004
2007
  * @param {string} symbol unified symbol of the market to fetch the ticker for
2005
2008
  * @param {object} [params] extra parameters specific to the bybit api endpoint
2006
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
2009
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2007
2010
  */
2008
- this.checkRequiredSymbol('fetchTicker', symbol);
2011
+ if (symbol === undefined) {
2012
+ throw new ArgumentsRequired(this.id + ' fetchTicker() requires a symbol argument');
2013
+ }
2009
2014
  await this.loadMarkets();
2010
2015
  const market = this.market(symbol);
2011
2016
  const request = {
@@ -2079,7 +2084,7 @@ export default class bybit extends Exchange {
2079
2084
  * @see https://bybit-exchange.github.io/docs/v5/market/tickers
2080
2085
  * @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2081
2086
  * @param {object} [params] extra parameters specific to the bybit api endpoint
2082
- * @returns {object} an array of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
2087
+ * @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2083
2088
  */
2084
2089
  await this.loadMarkets();
2085
2090
  let market = undefined;
@@ -2205,7 +2210,9 @@ export default class bybit extends Exchange {
2205
2210
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2206
2211
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
2207
2212
  */
2208
- this.checkRequiredSymbol('fetchOHLCV', symbol);
2213
+ if (symbol === undefined) {
2214
+ throw new ArgumentsRequired(this.id + ' fetchOHLCV() requires a symbol argument');
2215
+ }
2209
2216
  await this.loadMarkets();
2210
2217
  let paginate = false;
2211
2218
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
@@ -2362,7 +2369,7 @@ export default class bybit extends Exchange {
2362
2369
  * @see https://bybit-exchange.github.io/docs/v5/market/tickers
2363
2370
  * @param {string[]} symbols unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
2364
2371
  * @param {object} [params] extra parameters specific to the bybit api endpoint
2365
- * @returns {object} an array of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
2372
+ * @returns {object} an array of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
2366
2373
  */
2367
2374
  await this.loadMarkets();
2368
2375
  let market = undefined;
@@ -2443,13 +2450,15 @@ export default class bybit extends Exchange {
2443
2450
  * @see https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
2444
2451
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
2445
2452
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
2446
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
2453
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
2447
2454
  * @param {object} [params] extra parameters specific to the bybit api endpoint
2448
2455
  * @param {int} [params.until] timestamp in ms of the latest funding rate
2449
2456
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2450
- * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
2457
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
2451
2458
  */
2452
- this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
2459
+ if (symbol === undefined) {
2460
+ throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
2461
+ }
2453
2462
  await this.loadMarkets();
2454
2463
  if (limit === undefined) {
2455
2464
  limit = 200;
@@ -2729,9 +2738,11 @@ export default class bybit extends Exchange {
2729
2738
  * @param {object} [params] extra parameters specific to the bybit api endpoint
2730
2739
  * @param {string} [params.type] market type, ['swap', 'option', 'spot']
2731
2740
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
2732
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
2741
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
2733
2742
  */
2734
- this.checkRequiredSymbol('fetchTrades', symbol);
2743
+ if (symbol === undefined) {
2744
+ throw new ArgumentsRequired(this.id + ' fetchTrades() requires a symbol argument');
2745
+ }
2735
2746
  await this.loadMarkets();
2736
2747
  const market = this.market(symbol);
2737
2748
  const request = {
@@ -2783,9 +2794,11 @@ export default class bybit extends Exchange {
2783
2794
  * @param {string} symbol unified symbol of the market to fetch the order book for
2784
2795
  * @param {int} [limit] the maximum amount of order book entries to return
2785
2796
  * @param {object} [params] extra parameters specific to the bybit api endpoint
2786
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
2797
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2787
2798
  */
2788
- this.checkRequiredSymbol('fetchOrderBook', symbol);
2799
+ if (symbol === undefined) {
2800
+ throw new ArgumentsRequired(this.id + ' fetchOrderBook() requires a symbol argument');
2801
+ }
2789
2802
  await this.loadMarkets();
2790
2803
  const market = this.market(symbol);
2791
2804
  const request = {
@@ -3409,10 +3422,12 @@ export default class bybit extends Exchange {
3409
3422
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
3410
3423
  * @param {string} symbol unified symbol of the market the order was made in
3411
3424
  * @param {object} [params] extra parameters specific to the bybit api endpoint
3412
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3425
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3413
3426
  */
3427
+ if (symbol === undefined) {
3428
+ throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
3429
+ }
3414
3430
  await this.loadMarkets();
3415
- this.checkRequiredSymbol('fetchOrder', symbol);
3416
3431
  const request = {
3417
3432
  'orderId': id,
3418
3433
  };
@@ -3453,7 +3468,7 @@ export default class bybit extends Exchange {
3453
3468
  * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
3454
3469
  * @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
3455
3470
  * @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
3456
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3471
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3457
3472
  */
3458
3473
  await this.loadMarkets();
3459
3474
  const market = this.market(symbol);
@@ -3633,7 +3648,7 @@ export default class bybit extends Exchange {
3633
3648
  * @description create a list of trade orders
3634
3649
  * @see https://bybit-exchange.github.io/docs/v5/order/batch-place
3635
3650
  * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3636
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3651
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3637
3652
  */
3638
3653
  await this.loadMarkets();
3639
3654
  const ordersRequests = [];
@@ -3924,7 +3939,9 @@ export default class bybit extends Exchange {
3924
3939
  * @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
3925
3940
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3926
3941
  */
3927
- this.checkRequiredSymbol('editOrder', symbol);
3942
+ if (symbol === undefined) {
3943
+ throw new ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
3944
+ }
3928
3945
  await this.loadMarkets();
3929
3946
  const market = this.market(symbol);
3930
3947
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
@@ -4026,7 +4043,9 @@ export default class bybit extends Exchange {
4026
4043
  });
4027
4044
  }
4028
4045
  async cancelUsdcOrder(id, symbol = undefined, params = {}) {
4029
- this.checkRequiredSymbol('cancelUsdcOrder', symbol);
4046
+ if (symbol === undefined) {
4047
+ throw new ArgumentsRequired(this.id + ' cancelUsdcOrder() requires a symbol argument');
4048
+ }
4030
4049
  await this.loadMarkets();
4031
4050
  const market = this.market(symbol);
4032
4051
  const request = {
@@ -4074,9 +4093,11 @@ export default class bybit extends Exchange {
4074
4093
  * @param {object} [params] extra parameters specific to the bybit api endpoint
4075
4094
  * @param {boolean} [params.stop] *spot only* whether the order is a stop order
4076
4095
  * @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
4077
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4096
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4078
4097
  */
4079
- this.checkRequiredSymbol('cancelOrder', symbol);
4098
+ if (symbol === undefined) {
4099
+ throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
4100
+ }
4080
4101
  await this.loadMarkets();
4081
4102
  const market = this.market(symbol);
4082
4103
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
@@ -4130,7 +4151,9 @@ export default class bybit extends Exchange {
4130
4151
  return this.parseOrder(result, market);
4131
4152
  }
4132
4153
  async cancelAllUsdcOrders(symbol = undefined, params = {}) {
4133
- this.checkRequiredSymbol('cancelAllUsdcOrders', symbol);
4154
+ if (symbol === undefined) {
4155
+ throw new ArgumentsRequired(this.id + ' cancelAllUsdcOrders() requires a symbol argument');
4156
+ }
4134
4157
  await this.loadMarkets();
4135
4158
  const market = this.market(symbol);
4136
4159
  const request = {
@@ -4187,7 +4210,7 @@ export default class bybit extends Exchange {
4187
4210
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
4188
4211
  * @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
4189
4212
  * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
4190
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4213
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4191
4214
  */
4192
4215
  await this.loadMarkets();
4193
4216
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
@@ -4359,7 +4382,7 @@ export default class bybit extends Exchange {
4359
4382
  * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
4360
4383
  * @param {int} [params.until] the latest time in ms to fetch entries for
4361
4384
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4362
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4385
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4363
4386
  */
4364
4387
  await this.loadMarkets();
4365
4388
  let paginate = false;
@@ -4556,7 +4579,7 @@ export default class bybit extends Exchange {
4556
4579
  * @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
4557
4580
  * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
4558
4581
  * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
4559
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4582
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4560
4583
  */
4561
4584
  await this.loadMarkets();
4562
4585
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
@@ -4661,7 +4684,7 @@ export default class bybit extends Exchange {
4661
4684
  * @param {int} [since] the earliest time in ms to fetch trades for
4662
4685
  * @param {int} [limit] the maximum number of trades to retrieve
4663
4686
  * @param {object} [params] extra parameters specific to the bybit api endpoint
4664
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
4687
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
4665
4688
  *
4666
4689
  */
4667
4690
  const request = {};
@@ -4734,7 +4757,7 @@ export default class bybit extends Exchange {
4734
4757
  * @param {string} [params.type] market type, ['swap', 'option', 'spot']
4735
4758
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
4736
4759
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4737
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
4760
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
4738
4761
  */
4739
4762
  await this.loadMarkets();
4740
4763
  let paginate = false;
@@ -4854,7 +4877,7 @@ export default class bybit extends Exchange {
4854
4877
  * @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
4855
4878
  * @param {string} code unified currency code of the currency for the deposit address
4856
4879
  * @param {object} [params] extra parameters specific to the bybit api endpoint
4857
- * @returns {object} a dictionary of [address structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure} indexed by the network
4880
+ * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
4858
4881
  */
4859
4882
  await this.loadMarkets();
4860
4883
  let currency = this.currency(code);
@@ -4898,7 +4921,7 @@ export default class bybit extends Exchange {
4898
4921
  * @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
4899
4922
  * @param {string} code unified currency code
4900
4923
  * @param {object} [params] extra parameters specific to the bybit api endpoint
4901
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
4924
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
4902
4925
  */
4903
4926
  await this.loadMarkets();
4904
4927
  const [networkCode, query] = this.handleNetworkCodeAndParams(params);
@@ -4952,7 +4975,7 @@ export default class bybit extends Exchange {
4952
4975
  * EXCHANGE SPECIFIC PARAMETERS
4953
4976
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4954
4977
  * @param {string} [params.cursor] used for pagination
4955
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4978
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4956
4979
  */
4957
4980
  await this.loadMarkets();
4958
4981
  let paginate = false;
@@ -5020,7 +5043,7 @@ export default class bybit extends Exchange {
5020
5043
  * @param {object} [params] extra parameters specific to the bybit api endpoint
5021
5044
  * @param {int} [params.until] the latest time in ms to fetch entries for
5022
5045
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
5023
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
5046
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
5024
5047
  */
5025
5048
  await this.loadMarkets();
5026
5049
  let paginate = false;
@@ -5198,7 +5221,7 @@ export default class bybit extends Exchange {
5198
5221
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
5199
5222
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
5200
5223
  * @param {object} [params] extra parameters specific to the bybit api endpoint
5201
- * @returns {object} a [ledger structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ledger-structure}
5224
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
5202
5225
  */
5203
5226
  await this.loadMarkets();
5204
5227
  const request = {
@@ -5462,7 +5485,7 @@ export default class bybit extends Exchange {
5462
5485
  * @param {string} address the address to withdraw to
5463
5486
  * @param {string} tag
5464
5487
  * @param {object} [params] extra parameters specific to the bybit api endpoint
5465
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
5488
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
5466
5489
  */
5467
5490
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
5468
5491
  await this.loadMarkets();
@@ -5505,9 +5528,11 @@ export default class bybit extends Exchange {
5505
5528
  * @see https://bybit-exchange.github.io/docs/v5/position
5506
5529
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
5507
5530
  * @param {object} [params] extra parameters specific to the bybit api endpoint
5508
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
5531
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5509
5532
  */
5510
- this.checkRequiredSymbol('fetchPosition', symbol);
5533
+ if (symbol === undefined) {
5534
+ throw new ArgumentsRequired(this.id + ' fetchPosition() requires a symbol argument');
5535
+ }
5511
5536
  await this.loadMarkets();
5512
5537
  const market = this.market(symbol);
5513
5538
  const request = {
@@ -6091,7 +6116,9 @@ export default class bybit extends Exchange {
6091
6116
  * @param {string} [params.sellLeverage] leverage for sell side
6092
6117
  * @returns {object} response from the exchange
6093
6118
  */
6094
- this.checkRequiredSymbol('setLeverage', symbol);
6119
+ if (symbol === undefined) {
6120
+ throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
6121
+ }
6095
6122
  await this.loadMarkets();
6096
6123
  const market = this.market(symbol);
6097
6124
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
@@ -6247,7 +6274,7 @@ export default class bybit extends Exchange {
6247
6274
  * @param {object} [params] exchange specific parameters
6248
6275
  * @param {string} [params.interval] 5m, 15m, 30m, 1h, 4h, 1d
6249
6276
  * @param {string} [params.category] "linear" or "inverse"
6250
- * @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
6277
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
6251
6278
  */
6252
6279
  await this.loadMarkets();
6253
6280
  let market = this.market(symbol);
@@ -6349,15 +6376,15 @@ export default class bybit extends Exchange {
6349
6376
  'info': interest,
6350
6377
  }, market);
6351
6378
  }
6352
- async fetchBorrowRate(code, params = {}) {
6379
+ async fetchCrossBorrowRate(code, params = {}) {
6353
6380
  /**
6354
6381
  * @method
6355
- * @name bybit#fetchBorrowRate
6382
+ * @name bybit#fetchCrossBorrowRate
6356
6383
  * @description fetch the rate of interest to borrow a currency for margin trading
6357
6384
  * @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
6358
6385
  * @param {string} code unified currency code
6359
6386
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6360
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
6387
+ * @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
6361
6388
  */
6362
6389
  await this.loadMarkets();
6363
6390
  const currency = this.currency(code);
@@ -6379,7 +6406,9 @@ export default class bybit extends Exchange {
6379
6406
  // "time": "1666734490778"
6380
6407
  // }
6381
6408
  //
6409
+ const timestamp = this.safeInteger(response, 'time');
6382
6410
  const data = this.safeValue(response, 'result', {});
6411
+ data['timestamp'] = timestamp;
6383
6412
  return this.parseBorrowRate(data, currency);
6384
6413
  }
6385
6414
  parseBorrowRate(info, currency = undefined) {
@@ -6388,10 +6417,11 @@ export default class bybit extends Exchange {
6388
6417
  // "coin": "USDT",
6389
6418
  // "interestRate": "0.000107000000",
6390
6419
  // "loanAbleAmount": "",
6391
- // "maxLoanAmount": "79999.999"
6420
+ // "maxLoanAmount": "79999.999",
6421
+ // "timestamp": 1666734490778
6392
6422
  // }
6393
6423
  //
6394
- const timestamp = this.milliseconds();
6424
+ const timestamp = this.safeInteger(info, 'timestamp');
6395
6425
  const currencyId = this.safeString(info, 'coin');
6396
6426
  return {
6397
6427
  'currency': this.safeCurrencyCode(currencyId, currency),
@@ -6413,7 +6443,7 @@ export default class bybit extends Exchange {
6413
6443
  * @param {number} [since] the earliest time in ms to fetch borrrow interest for
6414
6444
  * @param {number} [limit] the maximum number of structures to retrieve
6415
6445
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6416
- * @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
6446
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
6417
6447
  */
6418
6448
  await this.loadMarkets();
6419
6449
  const request = {};
@@ -6483,7 +6513,7 @@ export default class bybit extends Exchange {
6483
6513
  * @param {string} toAccount account to transfer to
6484
6514
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6485
6515
  * @param {string} [params.transferId] UUID, which is unique across the platform
6486
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
6516
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6487
6517
  */
6488
6518
  await this.loadMarkets();
6489
6519
  const transferId = this.safeString(params, 'transferId', this.uuid());
@@ -6536,7 +6566,7 @@ export default class bybit extends Exchange {
6536
6566
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6537
6567
  * @param {int} [params.until] the latest time in ms to fetch entries for
6538
6568
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
6539
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
6569
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6540
6570
  */
6541
6571
  await this.loadMarkets();
6542
6572
  let paginate = false;
@@ -6593,7 +6623,7 @@ export default class bybit extends Exchange {
6593
6623
  * @param {float} amount the amount to borrow
6594
6624
  * @param {string} symbol not used by bybit.borrowMargin ()
6595
6625
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6596
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
6626
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6597
6627
  */
6598
6628
  await this.loadMarkets();
6599
6629
  const currency = this.currency(code);
@@ -6634,7 +6664,7 @@ export default class bybit extends Exchange {
6634
6664
  * @param {float} amount the amount to repay
6635
6665
  * @param {string} symbol not used by bybit.repayMargin ()
6636
6666
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6637
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
6667
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6638
6668
  */
6639
6669
  await this.loadMarkets();
6640
6670
  const currency = this.currency(code);
@@ -6784,7 +6814,7 @@ export default class bybit extends Exchange {
6784
6814
  * @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
6785
6815
  * @param {string} symbol unified market symbol
6786
6816
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6787
- * @returns {object} a [leverage tiers structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}
6817
+ * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
6788
6818
  */
6789
6819
  await this.loadMarkets();
6790
6820
  const request = {};
@@ -6851,7 +6881,7 @@ export default class bybit extends Exchange {
6851
6881
  * @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
6852
6882
  * @param {string} symbol unified market symbol
6853
6883
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6854
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
6884
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
6855
6885
  */
6856
6886
  await this.loadMarkets();
6857
6887
  const market = this.market(symbol);
@@ -6892,7 +6922,7 @@ export default class bybit extends Exchange {
6892
6922
  * @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
6893
6923
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6894
6924
  * @param {string} [params.type] market type, ['swap', 'option', 'spot']
6895
- * @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
6925
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
6896
6926
  */
6897
6927
  await this.loadMarkets();
6898
6928
  let type = undefined;
@@ -6989,7 +7019,7 @@ export default class bybit extends Exchange {
6989
7019
  * @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
6990
7020
  * @param {string[]} codes list of unified currency codes
6991
7021
  * @param {object} [params] extra parameters specific to the bybit api endpoint
6992
- * @returns {object} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
7022
+ * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
6993
7023
  */
6994
7024
  this.checkRequiredCredentials();
6995
7025
  await this.loadMarkets();
@@ -7220,7 +7250,7 @@ export default class bybit extends Exchange {
7220
7250
  * @param {string} code unified currency code
7221
7251
  * @param {object} [params] extra parameters specific to the bybit api endpoint
7222
7252
  * @param {int} [params.period] the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
7223
- * @returns {object[]} a list of [volatility history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#volatility-structure}
7253
+ * @returns {object[]} a list of [volatility history objects]{@link https://docs.ccxt.com/#/?id=volatility-structure}
7224
7254
  */
7225
7255
  await this.loadMarkets();
7226
7256
  const currency = this.currency(code);
@@ -7275,7 +7305,7 @@ export default class bybit extends Exchange {
7275
7305
  * @see https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
7276
7306
  * @param {string} symbol unified symbol of the market to fetch greeks for
7277
7307
  * @param {object} [params] extra parameters specific to the bybit api endpoint
7278
- * @returns {object} a [greeks structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#greeks-structure}
7308
+ * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
7279
7309
  */
7280
7310
  await this.loadMarkets();
7281
7311
  const market = this.market(symbol);