ast-transpiler
Version:
README.md
737 lines (733 loc) • 404 kB
JavaScript
// ---------------------------------------------------------------------------
const Exchange = require ('./base/Exchange');
const { TICK_SIZE } = require ('./base/functions/number');
const { AuthenticationError, ExchangeError, ArgumentsRequired, PermissionDenied, InvalidOrder, OrderNotFound, InsufficientFunds, BadRequest, RateLimitExceeded, InvalidNonce, NotSupported, RequestTimeout } = require ('./base/errors');
const Precise = require ('./base/Precise');
// ---------------------------------------------------------------------------
module.exports = class bybit extends Exchange {
describe () {
return this.deepExtend (super.describe (), {
'id': 'bybit',
'name': 'Bybit',
'countries': [ 'VG' ], // British Virgin Islands
'version': 'v5',
'userAgent': undefined,
'rateLimit': 20,
'hostname': 'bybit.com', // bybit.com, bytick.com
'pro': true,
'certified': true,
'has': {
'CORS': true,
'spot': true,
'margin': true,
'swap': true,
'future': true,
'option': undefined,
'cancelAllOrders': true,
'cancelOrder': true,
'createOrder': true,
'createPostOnlyOrder': true,
'createReduceOnlyOrder': true,
'createStopLimitOrder': true,
'createStopMarketOrder': true,
'createStopOrder': true,
'editOrder': true,
'fetchBalance': true,
'fetchBorrowInterest': false, // temporarily disabled, as it does not work
'fetchBorrowRate': true,
'fetchBorrowRateHistories': false,
'fetchBorrowRateHistory': false,
'fetchBorrowRates': false,
'fetchCanceledOrders': true,
'fetchClosedOrders': true,
'fetchCurrencies': true,
'fetchDeposit': false,
'fetchDepositAddress': true,
'fetchDepositAddresses': false,
'fetchDepositAddressesByNetwork': true,
'fetchDeposits': true,
'fetchFundingRate': true, // emulated in exchange
'fetchFundingRateHistory': true,
'fetchFundingRates': true,
'fetchIndexOHLCV': true,
'fetchLedger': true,
'fetchMarketLeverageTiers': true,
'fetchMarkets': true,
'fetchMarkOHLCV': true,
'fetchMyTrades': true,
'fetchOHLCV': true,
'fetchOpenInterest': true,
'fetchOpenInterestHistory': true,
'fetchOpenOrders': true,
'fetchOrder': true,
'fetchOrderBook': true,
'fetchOrders': true,
'fetchOrderTrades': true,
'fetchPosition': true,
'fetchPositions': true,
'fetchPremiumIndexOHLCV': true,
'fetchTicker': true,
'fetchTickers': true,
'fetchTime': true,
'fetchTrades': true,
'fetchTradingFee': true,
'fetchTradingFees': true,
'fetchTransactions': false,
'fetchTransfers': true,
'fetchWithdrawals': true,
'setLeverage': true,
'setMarginMode': true,
'setPositionMode': true,
'transfer': true,
'withdraw': true,
},
'timeframes': {
'1m': '1',
'3m': '3',
'5m': '5',
'15m': '15',
'30m': '30',
'1h': '60',
'2h': '120',
'4h': '240',
'6h': '360',
'12h': '720',
'1d': 'D',
'1w': 'W',
'1M': 'M',
},
'urls': {
'test': {
'spot': 'https://api-testnet.{hostname}',
'futures': 'https://api-testnet.{hostname}',
'v2': 'https://api-testnet.{hostname}',
'public': 'https://api-testnet.{hostname}',
'private': 'https://api-testnet.{hostname}',
},
'logo': 'https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg',
'api': {
'spot': 'https://api.{hostname}',
'futures': 'https://api.{hostname}',
'v2': 'https://api.{hostname}',
'public': 'https://api.{hostname}',
'private': 'https://api.{hostname}',
},
'www': 'https://www.bybit.com',
'doc': [
'https://bybit-exchange.github.io/docs/inverse/',
'https://bybit-exchange.github.io/docs/linear/',
'https://github.com/bybit-exchange',
],
'fees': 'https://help.bybit.com/hc/en-us/articles/360039261154',
'referral': 'https://www.bybit.com/register?affiliate_id=35953',
},
'api': {
'public': {
'get': {
// inverse swap
'v2/public/orderBook/L2': 1,
'v2/public/kline/list': 3,
'v2/public/tickers': 1,
'v2/public/trading-records': 1,
'v2/public/symbols': 1,
'v2/public/mark-price-kline': 3,
'v2/public/index-price-kline': 3,
'v2/public/premium-index-kline': 2,
'v2/public/open-interest': 1,
'v2/public/big-deal': 1,
'v2/public/account-ratio': 1,
'v2/public/funding-rate': 1,
'v2/public/elite-ratio': 1,
'v2/public/funding/prev-funding-rate': 1,
'v2/public/risk-limit/list': 1,
// linear swap USDT
'public/linear/kline': 3,
'public/linear/recent-trading-records': 1,
'public/linear/risk-limit': 1,
'public/linear/funding/prev-funding-rate': 1,
'public/linear/mark-price-kline': 1,
'public/linear/index-price-kline': 1,
'public/linear/premium-index-kline': 1,
// spot
'spot/v1/time': 1,
'spot/v1/symbols': 1,
'spot/quote/v1/depth': 1,
'spot/quote/v1/depth/merged': 1,
'spot/quote/v1/trades': 1,
'spot/quote/v1/kline': 1,
'spot/quote/v1/ticker/24hr': 1,
'spot/quote/v1/ticker/price': 1,
'spot/quote/v1/ticker/book_ticker': 1,
'spot/v3/public/symbols': 1,
'spot/v3/public/quote/depth': 1,
'spot/v3/public/quote/depth/merged': 1,
'spot/v3/public/quote/trades': 1,
'spot/v3/public/quote/kline': 1,
'spot/v3/public/quote/ticker/24hr': 1,
'spot/v3/public/quote/ticker/price': 1,
'spot/v3/public/quote/ticker/bookTicker': 1,
'spot/v3/public/server-time': 1,
'spot/v3/public/infos': 1,
// data
'v2/public/time': 1,
'v3/public/time': 1,
'v2/public/announcement': 1,
// USDC endpoints
// option USDC
'option/usdc/openapi/public/v1/order-book': 1,
'option/usdc/openapi/public/v1/symbols': 1,
'option/usdc/openapi/public/v1/tick': 1,
'option/usdc/openapi/public/v1/delivery-price': 1,
'option/usdc/openapi/public/v1/query-trade-latest': 1,
'option/usdc/openapi/public/v1/query-historical-volatility': 1,
'option/usdc/openapi/public/v1/all-tickers': 1,
// perpetual swap USDC
'perpetual/usdc/openapi/public/v1/order-book': 1,
'perpetual/usdc/openapi/public/v1/symbols': 1,
'perpetual/usdc/openapi/public/v1/tick': 1,
'perpetual/usdc/openapi/public/v1/kline/list': 1,
'perpetual/usdc/openapi/public/v1/mark-price-kline': 1,
'perpetual/usdc/openapi/public/v1/index-price-kline': 1,
'perpetual/usdc/openapi/public/v1/premium-index-kline': 1,
'perpetual/usdc/openapi/public/v1/open-interest': 1,
'perpetual/usdc/openapi/public/v1/big-deal': 1,
'perpetual/usdc/openapi/public/v1/account-ratio': 1,
'perpetual/usdc/openapi/public/v1/prev-funding-rate': 1,
'perpetual/usdc/openapi/public/v1/risk-limit/list': 1,
// account
'asset/v1/public/deposit/allowed-deposit-list': 1,
'contract/v3/public/copytrading/symbol/list': 1,
// derivative
'derivatives/v3/public/order-book/L2': 1,
'derivatives/v3/public/kline': 1,
'derivatives/v3/public/tickers': 1,
'derivatives/v3/public/instruments-info': 1,
'derivatives/v3/public/mark-price-kline': 1,
'derivatives/v3/public/index-price-kline': 1,
'derivatives/v3/public/funding/history-funding-rate': 1,
'derivatives/v3/public/risk-limit/list': 1,
'derivatives/v3/public/delivery-price': 1,
'derivatives/v3/public/recent-trade': 1,
'derivatives/v3/public/open-interest': 1,
'derivatives/v3/public/insurance': 1,
// v5
'v5/market/kline': 1,
'v5/market/mark-price-kline': 1,
'v5/market/index-price-kline': 1,
'v5/market/premium-index-price-kline': 1,
'v5/market/instruments-info': 1,
'v5/market/orderbook': 1,
'v5/market/tickers': 1,
'v5/market/funding/history': 1,
'v5/market/recent-trade': 1,
'v5/market/open-interest': 1,
'v5/market/historical-volatility': 1,
'v5/market/insurance': 1,
'v5/market/risk-limit': 1,
'v5/market/delivery-price': 1,
'v5/spot-lever-token/info': 1,
'v5/spot-lever-token/reference': 1,
},
},
'private': {
'get': {
// inverse swap
'v2/private/order/list': 5,
'v2/private/order': 5,
'v2/private/stop-order/list': 5,
'v2/private/stop-order': 1,
'v2/private/position/list': 25,
'v2/private/position/fee-rate': 40,
'v2/private/execution/list': 25,
'v2/private/trade/closed-pnl/list': 1,
'v2/public/risk-limit/list': 1, // TODO check
'v2/public/funding/prev-funding-rate': 25, // TODO check
'v2/private/funding/prev-funding': 25,
'v2/private/funding/predicted-funding': 25,
'v2/private/account/api-key': 5,
'v2/private/account/lcp': 1,
'v2/private/wallet/balance': 25, // 120 per minute = 2 per second => cost = 50 / 2 = 25
'v2/private/wallet/fund/records': 25,
'v2/private/wallet/withdraw/list': 25,
'v2/private/exchange-order/list': 1,
// linear swap USDT
'private/linear/order/list': 5, // 600 per minute = 10 per second => cost = 50 / 10 = 5
'private/linear/order/search': 5,
'private/linear/stop-order/list': 5,
'private/linear/stop-order/search': 5,
'private/linear/position/list': 25,
'private/linear/trade/execution/list': 25,
'private/linear/trade/closed-pnl/list': 25,
'public/linear/risk-limit': 1,
'private/linear/funding/predicted-funding': 25,
'private/linear/funding/prev-funding': 25,
// inverse futures
'futures/private/order/list': 5,
'futures/private/order': 5,
'futures/private/stop-order/list': 5,
'futures/private/stop-order': 5,
'futures/private/position/list': 25,
'futures/private/execution/list': 25,
'futures/private/trade/closed-pnl/list': 1,
// spot
'spot/v1/account': 2.5,
'spot/v1/order': 2.5,
'spot/v1/open-orders': 2.5,
'spot/v1/history-orders': 2.5,
'spot/v1/myTrades': 2.5,
'spot/v1/cross-margin/order': 10,
'spot/v1/cross-margin/accounts/balance': 10,
'spot/v1/cross-margin/loan-info': 10,
'spot/v1/cross-margin/repay/history': 10,
'spot/v3/private/order': 2.5,
'spot/v3/private/open-orders': 2.5,
'spot/v3/private/history-orders': 2.5,
'spot/v3/private/my-trades': 2.5,
'spot/v3/private/account': 2.5,
'spot/v3/private/reference': 2.5,
'spot/v3/private/record': 2.5,
'spot/v3/private/cross-margin-orders': 10,
'spot/v3/private/cross-margin-account': 10,
'spot/v3/private/cross-margin-loan-info': 10,
'spot/v3/private/cross-margin-repay-history': 10,
// account
'asset/v1/private/transfer/list': 50, // 60 per minute = 1 per second => cost = 50 / 1 = 50
'asset/v3/private/transfer/inter-transfer/list/query': 0.84, // 60/s
'asset/v1/private/sub-member/transfer/list': 50,
'asset/v3/private/transfer/sub-member/list/query': 0.84, // 60/s
'asset/v3/private/transfer/sub-member-transfer/list/query': 0.84, // 60/s
'asset/v3/private/transfer/universal-transfer/list/query': 0.84, // 60/s
'asset/v1/private/sub-member/member-ids': 50,
'asset/v1/private/deposit/record/query': 50,
'asset/v1/private/withdraw/record/query': 25,
'asset/v1/private/coin-info/query': 25,
'asset/v3/private/coin-info/query': 25, // 2/s
'asset/v1/private/asset-info/query': 50,
'asset/v1/private/deposit/address': 100,
'asset/v3/private/deposit/address/query': 0.17, // 300/s
'asset/v1/private/universal/transfer/list': 50,
'contract/v3/private/copytrading/order/list': 1,
'contract/v3/private/copytrading/position/list': 1,
'contract/v3/private/copytrading/wallet/balance': 1,
'contract/v3/private/position/limit-info': 25, // 120 per minute = 2 per second => cost = 50 / 2 = 25
'contract/v3/private/order/unfilled-orders': 1,
'contract/v3/private/order/list': 1,
'contract/v3/private/position/list': 1,
'contract/v3/private/execution/list': 1,
'contract/v3/private/position/closed-pnl': 1,
'contract/v3/private/account/wallet/balance': 1,
'contract/v3/private/account/fee-rate': 1,
'contract/v3/private/account/wallet/fund-records': 1,
// derivative
'unified/v3/private/order/unfilled-orders': 1,
'unified/v3/private/order/list': 1,
'unified/v3/private/position/list': 1,
'unified/v3/private/execution/list': 1,
'unified/v3/private/delivery-record': 1,
'unified/v3/private/settlement-record': 1,
'unified/v3/private/account/wallet/balance': 1,
'unified/v3/private/account/transaction-log': 1,
'asset/v2/private/exchange/exchange-order-all': 1,
'unified/v3/private/account/borrow-history': 1,
'unified/v3/private/account/borrow-rate': 1,
'unified/v3/private/account/info': 1,
'user/v3/private/frozen-sub-member': 10, // 5/s
'user/v3/private/query-sub-members': 5, // 10/s
'user/v3/private/query-api': 5, // 10/s
'asset/v3/private/transfer/transfer-coin/list/query': 0.84, // 60/s
'asset/v3/private/transfer/account-coin/balance/query': 0.84, // 60/s
'asset/v3/private/transfer/account-coins/balance/query': 50,
'asset/v3/private/transfer/asset-info/query': 0.84, // 60/s
'asset/v3/public/deposit/allowed-deposit-list/query': 0.17, // 300/s
'asset/v3/private/deposit/record/query': 0.17, // 300/s
'asset/v3/private/withdraw/record/query': 0.17, // 300/s
// v5
'v5/order/history': 2.5,
'v5/order/spot-borrow-check': 2.5,
'v5/order/realtime': 2.5,
'v5/position/list': 2.5,
'v5/execution/list': 2.5,
'v5/position/closed-pnl': 2.5,
'v5/account/wallet-balance': 2.5,
'v5/account/borrow-history': 2.5,
'v5/account/collateral-info': 2.5,
'v5/account/mmp-state': 2.5,
'v5/asset/coin-greeks': 2.5,
'v5/account/info': 2.5,
'v5/account/transaction-log': 2.5,
'v5/account/fee-rate': 1,
'v5/asset/exchange/order-record': 2.5,
'v5/asset/delivery-record': 2.5,
'v5/asset/settlement-record': 2.5,
'v5/asset/transfer/query-asset-info': 2.5,
'v5/asset/transfer/query-account-coin-balance': 2.5,
'v5/asset/transfer/query-transfer-coin-list': 2.5,
'v5/asset/transfer/query-inter-transfer-list': 2.5,
'v5/asset/transfer/query-sub-member-list': 2.5,
'v5/asset/transfer/query-universal-transfer-list': 1,
'v5/asset/deposit/query-allowed-list': 2.5,
'v5/asset/deposit/query-record': 2.5,
'v5/asset/deposit/query-sub-member-record': 2.5,
'v5/asset/deposit/query-address': 2.5,
'v5/asset/deposit/query-sub-member-address': 2.5,
'v5/asset/deposit/query-internal-record': 2.5,
'v5/asset/coin/query-info': 2.5,
'v5/asset/withdraw/query-record': 2.5,
'v5/asset/withdraw/withdrawable-amount': 2.5,
'v5/asset/transfer/query-account-coins-balance': 2.5,
// user
'v5/user/query-sub-members': 10,
'v5/user/query-api': 10,
},
'post': {
// inverse swap
'v2/private/order/create': 30,
'v2/private/order/cancel': 30,
'v2/private/order/cancelAll': 300, // 100 per minute + 'consumes 10 requests'
'v2/private/order/replace': 30,
'v2/private/stop-order/create': 30,
'v2/private/stop-order/cancel': 30,
'v2/private/stop-order/cancelAll': 300,
'v2/private/stop-order/replace': 30,
'v2/private/position/change-position-margin': 40,
'v2/private/position/trading-stop': 40,
'v2/private/position/leverage/save': 40,
'v2/private/tpsl/switch-mode': 40,
'v2/private/position/switch-isolated': 2.5,
'v2/private/position/risk-limit': 2.5,
'v2/private/position/switch-mode': 2.5,
// linear swap USDT
'private/linear/order/create': 30, // 100 per minute = 1.666 per second => cost = 50 / 1.6666 = 30
'private/linear/order/cancel': 30,
'private/linear/order/cancel-all': 300, // 100 per minute + 'consumes 10 requests'
'private/linear/order/replace': 30,
'private/linear/stop-order/create': 30,
'private/linear/stop-order/cancel': 30,
'private/linear/stop-order/cancel-all': 300,
'private/linear/stop-order/replace': 30,
'private/linear/position/set-auto-add-margin': 40,
'private/linear/position/switch-isolated': 40,
'private/linear/position/switch-mode': 40,
'private/linear/tpsl/switch-mode': 2.5,
'private/linear/position/add-margin': 40,
'private/linear/position/set-leverage': 40, // 75 per minute = 1.25 per second => cost = 50 / 1.25 = 40
'private/linear/position/trading-stop': 40,
'private/linear/position/set-risk': 2.5,
// inverse futures
'futures/private/order/create': 30,
'futures/private/order/cancel': 30,
'futures/private/order/cancelAll': 30,
'futures/private/order/replace': 30,
'futures/private/stop-order/create': 30,
'futures/private/stop-order/cancel': 30,
'futures/private/stop-order/cancelAll': 30,
'futures/private/stop-order/replace': 30,
'futures/private/position/change-position-margin': 40,
'futures/private/position/trading-stop': 40,
'futures/private/position/leverage/save': 40,
'futures/private/position/switch-mode': 40,
'futures/private/tpsl/switch-mode': 40,
'futures/private/position/switch-isolated': 40,
'futures/private/position/risk-limit': 2.5,
// spot
'spot/v1/order': 2.5,
'spot/v1/cross-margin/loan': 10,
'spot/v1/cross-margin/repay': 10,
'spot/v3/private/order': 2.5,
'spot/v3/private/cancel-order': 2.5,
'spot/v3/private/cancel-orders': 2.5,
'spot/v3/private/cancel-orders-by-ids': 2.5,
'spot/v3/private/purchase': 2.5,
'spot/v3/private/redeem': 2.5,
'spot/v3/private/cross-margin-loan': 10,
'spot/v3/private/cross-margin-repay': 10,
// account
'asset/v1/private/transfer': 150, // 20 per minute = 0.333 per second => cost = 50 / 0.3333 = 150
'asset/v3/private/transfer/inter-transfer': 2.5, // 20/s
'asset/v1/private/sub-member/transfer': 150,
'asset/v1/private/withdraw': 50,
'asset/v3/private/withdraw/create': 1, // 10/s
'asset/v1/private/withdraw/cancel': 50,
'asset/v3/private/withdraw/cancel': 0.84, // 60/s
'asset/v1/private/transferable-subs/save': 3000,
'asset/v1/private/universal/transfer': 1500,
'asset/v3/private/transfer/sub-member-transfer': 2.5, // 20/s
'asset/v3/private/transfer/transfer-sub-member-save': 2.5, // 20/s
'asset/v3/private/transfer/universal-transfer': 2.5, // 20/s
'user/v3/private/create-sub-member': 10, // 5/s
'user/v3/private/create-sub-api': 10, // 5/s
'user/v3/private/update-api': 10, // 5/s
'user/v3/private/delete-api': 10, // 5/s
'user/v3/private/update-sub-api': 10, // 5/s
'user/v3/private/delete-sub-api': 10, // 5/s
// USDC endpoints
// option USDC
'option/usdc/openapi/private/v1/place-order': 2.5,
'option/usdc/openapi/private/v1/batch-place-order': 2.5,
'option/usdc/openapi/private/v1/replace-order': 2.5,
'option/usdc/openapi/private/v1/batch-replace-orders': 2.5,
'option/usdc/openapi/private/v1/cancel-order': 2.5,
'option/usdc/openapi/private/v1/batch-cancel-orders': 2.5,
'option/usdc/openapi/private/v1/cancel-all': 2.5,
'option/usdc/openapi/private/v1/query-active-orders': 2.5,
'option/usdc/openapi/private/v1/query-order-history': 2.5,
'option/usdc/openapi/private/v1/execution-list': 2.5,
'option/usdc/openapi/private/v1/query-transaction-log': 2.5,
'option/usdc/openapi/private/v1/query-wallet-balance': 2.5,
'option/usdc/openapi/private/v1/query-asset-info': 2.5,
'option/usdc/openapi/private/v1/query-margin-info': 2.5,
'option/usdc/openapi/private/v1/query-position': 2.5,
'option/usdc/openapi/private/v1/query-delivery-list': 2.5,
'option/usdc/openapi/private/v1/query-position-exp-date': 2.5,
'option/usdc/openapi/private/v1/mmp-modify': 2.5,
'option/usdc/openapi/private/v1/mmp-reset': 2.5,
// perpetual swap USDC
'perpetual/usdc/openapi/private/v1/place-order': 2.5,
'perpetual/usdc/openapi/private/v1/replace-order': 2.5,
'perpetual/usdc/openapi/private/v1/cancel-order': 2.5,
'perpetual/usdc/openapi/private/v1/cancel-all': 2.5,
'perpetual/usdc/openapi/private/v1/position/leverage/save': 2.5,
'option/usdc/openapi/private/v1/session-settlement': 2.5,
'option/usdc/private/asset/account/setMarginMode': 2.5,
'perpetual/usdc/openapi/public/v1/risk-limit/list': 2.5,
'perpetual/usdc/openapi/private/v1/position/set-risk-limit': 2.5,
'perpetual/usdc/openapi/private/v1/predicted-funding': 2.5,
'contract/v3/private/copytrading/order/create': 2.5,
'contract/v3/private/copytrading/order/cancel': 2.5,
'contract/v3/private/copytrading/order/close': 2.5,
'contract/v3/private/copytrading/position/close': 2.5,
'contract/v3/private/copytrading/position/set-leverage': 2.5,
'contract/v3/private/copytrading/wallet/transfer': 2.5,
'contract/v3/private/copytrading/order/trading-stop': 2.5,
'contract/v3/private/order/create': 1,
'contract/v3/private/order/cancel': 1,
'contract/v3/private/order/cancel-all': 1,
'contract/v3/private/order/replace': 1,
'contract/v3/private/position/set-auto-add-margin': 1,
'contract/v3/private/position/switch-isolated': 1,
'contract/v3/private/position/switch-mode': 1,
'contract/v3/private/position/switch-tpsl-mode': 1,
'contract/v3/private/position/set-leverage': 1,
'contract/v3/private/position/trading-stop': 1,
'contract/v3/private/position/set-risk-limit': 1,
'contract/v3/private/account/setMarginMode': 1,
// derivative
'unified/v3/private/order/create': 2.5,
'unified/v3/private/order/replace': 2.5,
'unified/v3/private/order/cancel': 2.5,
'unified/v3/private/order/create-batch': 2.5,
'unified/v3/private/order/replace-batch': 2.5,
'unified/v3/private/order/cancel-batch': 2.5,
'unified/v3/private/order/cancel-all': 2.5,
'unified/v3/private/position/set-leverage': 2.5,
'unified/v3/private/position/tpsl/switch-mode': 2.5,
'unified/v3/private/position/set-risk-limit': 2.5,
'unified/v3/private/position/trading-stop': 2.5,
'unified/v3/private/account/upgrade-unified-account': 2.5,
'unified/v3/private/account/setMarginMode': 2.5,
// tax
'fht/compliance/tax/v3/private/registertime': 50,
'fht/compliance/tax/v3/private/create': 50,
'fht/compliance/tax/v3/private/status': 50,
'fht/compliance/tax/v3/private/url': 50,
// v5
'v5/order/create': 2.5,
'v5/order/amend': 2.5,
'v5/order/cancel': 2.5,
'v5/order/cancel-all': 2.5,
'v5/order/create-batch': 2.5,
'v5/order/amend-batch': 2.5,
'v5/order/cancel-batch': 2.5,
'v5/order/disconnected-cancel-all': 2.5,
'v5/position/set-leverage': 2.5,
'v5/position/set-tpsl-mode': 2.5,
'v5/position/set-risk-limit': 2.5,
'v5/position/trading-stop': 2.5,
'v5/account/upgrade-to-uta': 2.5,
'v5/account/set-margin-mode': 2.5,
'v5/asset/transfer/inter-transfer': 2.5,
'v5/asset/transfer/save-transfer-sub-member': 2.5,
'v5/asset/transfer/universal-transfer': 2.5,
'v5/asset/deposit/deposit-to-account': 2.5,
'v5/asset/withdraw/create': 2.5,
'v5/asset/withdraw/cancel': 2.5,
'v5/spot-lever-token/purchase': 2.5,
'v5/spot-lever-token/redeem': 2.5,
'v5/spot-lever-token/order-record': 2.5,
'v5/spot-margin-trade/switch-mode': 2.5,
'v5/spot-margin-trade/set-leverage': 2.5,
// user
'v5/user/create-sub-member': 10,
'v5/user/create-sub-api': 10,
'v5/user/frozen-sub-member': 10,
'v5/user/update-api': 10,
'v5/user/update-sub-api': 10,
'v5/user/delete-api': 10,
'v5/user/delete-sub-api': 10,
},
'delete': {
// spot
'spot/v1/order': 2.5,
'spot/v1/order/fast': 2.5,
'spot/order/batch-cancel': 2.5,
'spot/order/batch-fast-cancel': 2.5,
'spot/order/batch-cancel-by-ids': 2.5,
},
},
},
'httpExceptions': {
'403': RateLimitExceeded, // Forbidden -- You request too many times
},
'exceptions': {
// Uncodumented explanation of error strings:
// - oc_diff: order cost needed to place this order
// - new_oc: total order cost of open orders including the order you are trying to open
// - ob: order balance - the total cost of current open orders
// - ab: available balance
'exact': {
'-10009': BadRequest, // {"ret_code":-10009,"ret_msg":"Invalid period!","result":null,"token":null}
'-1004': BadRequest, // {"ret_code":-1004,"ret_msg":"Missing required parameter \u0027symbol\u0027","ext_code":null,"ext_info":null,"result":null}
'-1021': BadRequest, // {"ret_code":-1021,"ret_msg":"Timestamp for this request is outside of the recvWindow.","ext_code":null,"ext_info":null,"result":null}
'-1103': BadRequest, // An unknown parameter was sent.
'-1140': InvalidOrder, // {"ret_code":-1140,"ret_msg":"Transaction amount lower than the minimum.","result":{},"ext_code":"","ext_info":null,"time_now":"1659204910.248576"}
'-1197': InvalidOrder, // {"ret_code":-1197,"ret_msg":"Your order quantity to buy is too large. The filled price may deviate significantly from the market price. Please try again","result":{},"ext_code":"","ext_info":null,"time_now":"1659204531.979680"}
'-2013': InvalidOrder, // {"ret_code":-2013,"ret_msg":"Order does not exist.","ext_code":null,"ext_info":null,"result":null}
'-2015': AuthenticationError, // Invalid API-key, IP, or permissions for action.
'-6017': BadRequest, // Repayment amount has exceeded the total liability
'-6025': BadRequest, // Amount to borrow cannot be lower than the min. amount to borrow (per transaction)
'-6029': BadRequest, // Amount to borrow has exceeded the user's estimated max amount to borrow
'5004': ExchangeError, // {"retCode":5004,"retMsg":"Server Timeout","result":null,"retExtInfo":{},"time":1667577060106}
'7001': BadRequest, // {"retCode":7001,"retMsg":"request params type error"}
'10001': BadRequest, // parameter error
'10002': InvalidNonce, // request expired, check your timestamp and recv_window
'10003': AuthenticationError, // Invalid apikey
'10004': AuthenticationError, // invalid sign
'10005': PermissionDenied, // permission denied for current apikey
'10006': RateLimitExceeded, // too many requests
'10007': AuthenticationError, // api_key not found in your request parameters
'10008': AuthenticationError, // User had been banned
'10009': AuthenticationError, // IP had been banned
'10010': PermissionDenied, // request ip mismatch
'10014': BadRequest, // Request is duplicate
'10016': ExchangeError, // {"retCode":10016,"retMsg":"System error. Please try again later."}
'10017': BadRequest, // request path not found or request method is invalid
'10018': RateLimitExceeded, // exceed ip rate limit
'10020': PermissionDenied, // {"retCode":10020,"retMsg":"your account is not a unified margin account, please update your account","result":null,"retExtInfo":null,"time":1664783731123}
'10024': PermissionDenied, // Compliance rules triggered
'10027': PermissionDenied, // Trading Banned
'10028': PermissionDenied, // The API can only be accessed by unified account users.
'10029': PermissionDenied, // The requested symbol is invalid, please check symbol whitelist
'12201': BadRequest, // {"retCode":12201,"retMsg":"Invalid orderCategory parameter.","result":{},"retExtInfo":null,"time":1666699391220}
'100028': PermissionDenied, // The API cannot be accessed by unified account users.
'110001': InvalidOrder, // Order does not exist
'110003': InvalidOrder, // Order price is out of permissible range
'110004': InsufficientFunds, // Insufficient wallet balance
'110005': InvalidOrder, // position status
'110006': InsufficientFunds, // cannot afford estimated position_margin
'110007': InsufficientFunds, // {"retCode":110007,"retMsg":"ab not enough for new order","result":{},"retExtInfo":{},"time":1668838414793}
'110008': InvalidOrder, // Order has been finished or canceled
'110009': InvalidOrder, // The number of stop orders exceeds maximum limit allowed
'110010': InvalidOrder, // Order already cancelled
'110011': InvalidOrder, // Any adjustments made will trigger immediate liquidation
'110012': InsufficientFunds, // Available balance not enough
'110013': BadRequest, // Due to risk limit, cannot set leverage
'110014': InsufficientFunds, // Available balance not enough to add margin
'110015': BadRequest, // the position is in cross_margin
'110016': InvalidOrder, // Requested quantity of contracts exceeds risk limit, please adjust your risk limit level before trying again
'110017': InvalidOrder, // Reduce-only rule not satisfied
'110018': BadRequest, // userId illegal
'110019': InvalidOrder, // orderId illegal
'110020': InvalidOrder, // number of active orders greater than 500
'110021': InvalidOrder, // Open Interest exceeded
'110022': InvalidOrder, // qty has been limited, cannot modify the order to add qty
'110023': InvalidOrder, // This contract only supports position reduction operation, please contact customer service for details
'110024': InvalidOrder, // You have an existing position, so position mode cannot be switched
'110025': InvalidOrder, // Position mode is not modified
'110026': InvalidOrder, // Cross/isolated margin mode is not modified
'110027': InvalidOrder, // Margin is not modified
'110028': InvalidOrder, // Open orders exist, so you cannot change position mode
'110029': InvalidOrder, // Hedge mode is not available for this symbol
'110030': InvalidOrder, // Duplicate orderId
'110031': InvalidOrder, // risk limit info does not exists
'110032': InvalidOrder, // Illegal order
'110033': InvalidOrder, // Margin cannot be set without open position
'110034': InvalidOrder, // There is no net position
'110035': InvalidOrder, // Cancel order is not completed before liquidation
'110036': InvalidOrder, // Cross margin mode is not allowed to change leverage
'110037': InvalidOrder, // User setting list does not have this symbol
'110038': InvalidOrder, // Portfolio margin mode is not allowed to change leverage
'110039': InvalidOrder, // Maintain margin rate is too high, which may trigger liquidation
'110040': InvalidOrder, // Order will trigger forced liquidation, please resubmit the order
'110041': InvalidOrder, // Skip liquidation is not allowed when a position or maker order exists
'110042': InvalidOrder, // Pre-delivery status can only reduce positions
'110043': BadRequest, // Set leverage not modified
'110044': InsufficientFunds, // Insufficient available margin
'110045': InsufficientFunds, // Insufficient wallet balance
'110046': BadRequest, // Any adjustments made will trigger immediate liquidation
'110047': BadRequest, // Risk limit cannot be adjusted due to insufficient available margin
'110048': BadRequest, // Risk limit cannot be adjusted as the current/expected position value held exceeds the revised risk limit
'110049': BadRequest, // Tick notes can only be numbers
'110050': BadRequest, // Coin is not in the range of selected
'110051': InsufficientFunds, // The user's available balance cannot cover the lowest price of the current market
'110052': InsufficientFunds, // User's available balance is insufficient to set a price
'110053': InsufficientFunds, // The user's available balance cannot cover the current market price and upper limit price
'110054': InvalidOrder, // This position has at least one take profit link order, so the take profit and stop loss mode cannot be switched
'110055': InvalidOrder, // This position has at least one stop loss link order, so the take profit and stop loss mode cannot be switched
'110056': InvalidOrder, // This position has at least one trailing stop link order, so the take profit and stop loss mode cannot be switched
'110057': InvalidOrder, // Conditional order or limit order contains TP/SL related params
'110058': InvalidOrder, // Insufficient number of remaining position size to set take profit and stop loss
'110059': InvalidOrder, // In the case of partial filled of the open order, it is not allowed to modify the take profit and stop loss settings of the open order
'110060': BadRequest, // Under full TP/SL mode, it is not allowed to modify TP/SL
'110061': BadRequest, // Under partial TP/SL mode, TP/SL set more than 20
'110062': BadRequest, // Institution MMP profile not found.
'110063': ExchangeError, // Settlement in progress! xxx not available for trades.
'110064': InvalidOrder, // The number of contracts modified cannot be less than or equal to the filled quantity
'110065': PermissionDenied, // MMP hasn't yet been enabled for your account. Please contact your BD manager.
'110066': ExchangeError, // No trading is allowed at the current time
'110067': PermissionDenied, // unified account is not support
'110068': PermissionDenied, // Leveraged user trading is not allowed
'110069': PermissionDenied, // Do not allow OTC lending users to trade
'110070': InvalidOrder, // ETP symbols are not allowed to be traded
'110071': ExchangeError, // Sorry, we're revamping the Unified Margin Account! Currently, new upgrades are not supported. If you have any questions, please contact our 24/7 customer support.
'110072': InvalidOrder, // OrderLinkedID is duplicate
'110073': ExchangeError, // Set margin mode failed
'130006': InvalidOrder, // {"ret_code":130006,"ret_msg":"The number of contracts exceeds maximum limit allowed: too large","ext_code":"","ext_info":"","result":null,"time_now":"1658397095.099030","rate_limit_status":99,"rate_limit_reset_ms":1658397095097,"rate_limit":100}
'130021': InsufficientFunds, // {"ret_code":130021,"ret_msg":"orderfix price failed for CannotAffordOrderCost.","ext_code":"","ext_info":"","result":null,"time_now":"1644588250.204878","rate_limit_status":98,"rate_limit_reset_ms":1644588250200,"rate_limit":100} | {"ret_code":130021,"ret_msg":"oc_diff[1707966351], new_oc[1707966351] with ob[....]+AB[....]","ext_code":"","ext_info":"","result":null,"time_now":"1658395300.872766","rate_limit_status":99,"rate_limit_reset_ms":1658395300855,"rate_limit":100} caused issues/9149#issuecomment-1146559498
'130074': InvalidOrder, // {"ret_code":130074,"ret_msg":"expect Rising, but trigger_price[190000000] \u003c= current[211280000]??LastPrice","ext_code":"","ext_info":"","result":null,"time_now":"1655386638.067076","rate_limit_status":97,"rate_limit_reset_ms":1655386638065,"rate_limit":100}
'131001': InsufficientFunds, // {"retCode":131001,"retMsg":"the available balance is not sufficient to cover the handling fee","result":{},"retExtInfo":{},"time":1666892821245}
'131084': ExchangeError, // Withdraw failed because of Uta Upgrading
'131200': ExchangeError, // Service error
'131201': ExchangeError, // Internal error
'131202': BadRequest, // Invalid memberId
'131203': BadRequest, // Request parameter error
'131204': BadRequest, // Account info error
'131205': BadRequest, // Query transfer error
'131206': ExchangeError, // Fail to transfer
'131207': BadRequest, // Account not exist
'131208': ExchangeError, // Forbid transfer
'131209': BadRequest, // Get subMember relation error
'131210': BadRequest, // Amount accuracy error
'131211': BadRequest, // fromAccountType can't be the same as toAccountType
'131212': InsufficientFunds, // Insufficient balance
'131213': BadRequest, // TransferLTV check error
'131214': BadRequest, // TransferId exist
'131215': BadRequest, // Amount error
'131216': ExchangeError, // Query balance error
'131217': ExchangeError, // Risk check error
'131002': BadRequest, // Parameter error
'131003': ExchangeError, // Interal error
'131004': AuthenticationError, // KYC needed
'131085': InsufficientFunds, // Withdrawal amount is greater than your availale balance (the deplayed withdrawal is triggered)
'131086': BadRequest, // Withdrawal amount exceeds risk limit (the risk limit of margin trade is triggered)
'131088': BadRequest, // The withdrawal amount exceeds the remaining withdrawal limit of your identity verification level. The current available amount for withdrawal : %s
'131089': BadRequest, // User sensitive operation, withdrawal is prohibited within 24 hours
'131090': ExchangeError, // User withdraw has been banned
'131091': ExchangeError, // Blocked login status does not allow withdrawals
'131092': ExchangeError, // User status is abnormal
'131093': ExchangeError, // The withdrawal address is not in the whitelist
'131094': BadRequest, // UserId is not in the whitelist
'131095': BadRequest, // Withdrawl amount exceeds the 24 hour platform limit
'131096': BadRequest, // Withdraw amount does not satify the lower limit or upper limit
'131097': ExchangeError, // Withdrawal of this currency has been closed
'131098': ExchangeError, // Withdrawal currently is not availble from new address
'131099': ExchangeError, // Hot wallet status can cancel t