UNPKG

ccxt

Version:

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges

1,041 lines (1,039 loc) • 405 kB
// ---------------------------------------------------------------------------- // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code // EDIT THE CORRESPONDENT .ts FILE INSTEAD // --------------------------------------------------------------------------- import Exchange from './abstract/okx.js'; import { ExchangeError, ExchangeNotAvailable, OnMaintenance, ArgumentsRequired, BadRequest, AccountSuspended, InvalidAddress, DDoSProtection, PermissionDenied, InsufficientFunds, InvalidNonce, InvalidOrder, OrderNotFound, AuthenticationError, RequestTimeout, BadSymbol, RateLimitExceeded, NetworkError, CancelPending, NotSupported, AccountNotEnabled, ContractUnavailable, ManualInteractionNeeded, OperationRejected } from './base/errors.js'; import { Precise } from './base/Precise.js'; import { TICK_SIZE } from './base/functions/number.js'; import { sha256 } from './static_dependencies/noble-hashes/sha256.js'; // --------------------------------------------------------------------------- /** * @class okx * @augments Exchange */ export default class okx extends Exchange { describe() { return this.deepExtend(super.describe(), { 'id': 'okx', 'name': 'OKX', 'countries': ['CN', 'US'], 'version': 'v5', 'rateLimit': 100 * 1.03, 'pro': true, 'certified': true, 'has': { 'CORS': undefined, 'spot': true, 'margin': true, 'swap': true, 'future': true, 'option': true, 'addMargin': true, 'cancelAllOrders': false, 'cancelAllOrdersAfter': true, 'cancelOrder': true, 'cancelOrders': true, 'cancelOrdersForSymbols': true, 'closeAllPositions': false, 'closePosition': true, 'createConvertTrade': true, 'createDepositAddress': false, 'createMarketBuyOrderWithCost': true, 'createMarketSellOrderWithCost': true, 'createOrder': true, 'createOrders': true, 'createOrderWithTakeProfitAndStopLoss': true, 'createPostOnlyOrder': true, 'createReduceOnlyOrder': true, 'createStopLimitOrder': true, 'createStopLossOrder': true, 'createStopMarketOrder': true, 'createStopOrder': true, 'createTakeProfitOrder': true, 'createTrailingPercentOrder': true, 'createTriggerOrder': true, 'editOrder': true, 'fetchAccounts': true, 'fetchAllGreeks': true, 'fetchBalance': true, 'fetchBidsAsks': undefined, 'fetchBorrowInterest': true, 'fetchBorrowRateHistories': true, 'fetchBorrowRateHistory': true, 'fetchCanceledOrders': true, 'fetchClosedOrder': undefined, 'fetchClosedOrders': true, 'fetchConvertCurrencies': true, 'fetchConvertQuote': true, 'fetchConvertTrade': true, 'fetchConvertTradeHistory': true, 'fetchCrossBorrowRate': true, 'fetchCrossBorrowRates': true, 'fetchCurrencies': true, 'fetchDeposit': true, 'fetchDepositAddress': true, 'fetchDepositAddresses': false, 'fetchDepositAddressesByNetwork': true, 'fetchDeposits': true, 'fetchDepositsWithdrawals': false, 'fetchDepositWithdrawFee': 'emulated', 'fetchDepositWithdrawFees': true, 'fetchFundingHistory': true, 'fetchFundingInterval': true, 'fetchFundingIntervals': false, 'fetchFundingRate': true, 'fetchFundingRateHistory': true, 'fetchFundingRates': true, 'fetchGreeks': true, 'fetchIndexOHLCV': true, 'fetchIsolatedBorrowRate': false, 'fetchIsolatedBorrowRates': false, 'fetchL3OrderBook': false, 'fetchLedger': true, 'fetchLedgerEntry': undefined, 'fetchLeverage': true, 'fetchLeverageTiers': false, 'fetchLongShortRatio': false, 'fetchLongShortRatioHistory': true, 'fetchMarginAdjustmentHistory': true, 'fetchMarketLeverageTiers': true, 'fetchMarkets': true, 'fetchMarkOHLCV': true, 'fetchMarkPrice': true, 'fetchMarkPrices': true, 'fetchMySettlementHistory': false, 'fetchMyTrades': true, 'fetchOHLCV': true, 'fetchOpenInterest': true, 'fetchOpenInterestHistory': true, 'fetchOpenInterests': true, 'fetchOpenOrder': undefined, 'fetchOpenOrders': true, 'fetchOption': true, 'fetchOptionChain': true, 'fetchOrder': true, 'fetchOrderBook': true, 'fetchOrderBooks': false, 'fetchOrders': false, 'fetchOrderTrades': true, 'fetchPosition': true, 'fetchPositionHistory': 'emulated', 'fetchPositions': true, 'fetchPositionsForSymbol': true, 'fetchPositionsHistory': true, 'fetchPositionsRisk': false, 'fetchPremiumIndexOHLCV': false, 'fetchSettlementHistory': true, 'fetchStatus': true, 'fetchTicker': true, 'fetchTickers': true, 'fetchTime': true, 'fetchTrades': true, 'fetchTradingFee': true, 'fetchTradingFees': false, 'fetchTradingLimits': false, 'fetchTransactionFee': false, 'fetchTransactionFees': false, 'fetchTransactions': false, 'fetchTransfer': true, 'fetchTransfers': true, 'fetchUnderlyingAssets': true, 'fetchVolatilityHistory': false, 'fetchWithdrawal': true, 'fetchWithdrawals': true, 'fetchWithdrawalWhitelist': false, 'reduceMargin': true, 'repayCrossMargin': true, 'sandbox': true, 'setLeverage': true, 'setMargin': false, 'setMarginMode': true, 'setPositionMode': true, 'signIn': false, 'transfer': true, 'withdraw': true, }, 'timeframes': { '1m': '1m', '3m': '3m', '5m': '5m', '15m': '15m', '30m': '30m', '1h': '1H', '2h': '2H', '4h': '4H', '6h': '6H', '12h': '12H', '1d': '1D', '1w': '1W', '1M': '1M', '3M': '3M', }, 'hostname': 'www.okx.com', 'urls': { 'logo': 'https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg', 'api': { 'rest': 'https://{hostname}', }, 'www': 'https://www.okx.com', 'doc': 'https://www.okx.com/docs-v5/en/', 'fees': 'https://www.okx.com/pages/products/fees.html', 'referral': { // old reflink 0% discount https://www.okx.com/join/1888677 // new reflink 20% discount https://www.okx.com/join/CCXT2023 'url': 'https://www.okx.com/join/CCXT2023', 'discount': 0.2, }, 'test': { 'rest': 'https://{hostname}', }, }, 'api': { 'public': { 'get': { 'market/books-full': 2, 'market/tickers': 1, 'market/ticker': 1, 'market/index-tickers': 1, 'market/books': 1 / 2, 'market/books-lite': 5 / 3, 'market/candles': 1 / 2, 'market/history-candles': 1, 'market/index-candles': 1, 'market/history-index-candles': 2, 'market/mark-price-candles': 1, 'market/history-mark-price-candles': 2, 'market/trades': 1 / 5, 'market/history-trades': 2, 'market/option/instrument-family-trades': 1, 'market/platform-24-volume': 10, 'market/open-oracle': 50, 'market/exchange-rate': 20, 'market/index-components': 1, 'public/economic-calendar': 50, 'market/block-tickers': 1, 'market/block-ticker': 1, 'public/block-trades': 1, 'public/instruments': 1, 'public/delivery-exercise-history': 1 / 2, 'public/open-interest': 1, 'public/funding-rate': 1, 'public/funding-rate-history': 1, 'public/price-limit': 1, 'public/opt-summary': 1, 'public/estimated-price': 2, 'public/discount-rate-interest-free-quota': 10, 'public/time': 2, 'public/mark-price': 2, 'public/position-tiers': 2, 'public/interest-rate-loan-quota': 10, 'public/vip-interest-rate-loan-quota': 10, 'public/underlying': 1, 'public/insurance-fund': 2, 'public/convert-contract-coin': 2, 'public/option-trades': 1, 'public/instrument-tick-bands': 4, 'rubik/stat/trading-data/support-coin': 4, 'rubik/stat/taker-volume': 4, 'rubik/stat/margin/loan-ratio': 4, // long/short 'rubik/stat/contracts/long-short-account-ratio': 4, 'rubik/stat/contracts/long-short-account-ratio-contract': 4, 'rubik/stat/contracts/open-interest-volume': 4, 'rubik/stat/option/open-interest-volume': 4, // put/call 'rubik/stat/option/open-interest-volume-ratio': 4, 'rubik/stat/option/open-interest-volume-expiry': 4, 'rubik/stat/option/open-interest-volume-strike': 4, 'rubik/stat/option/taker-block-volume': 4, 'system/status': 50, // public api 'sprd/spreads': 1, 'sprd/books': 1 / 2, 'sprd/ticker': 1, 'sprd/public-trades': 1 / 5, 'market/sprd-ticker': 2, 'market/sprd-candles': 2, 'market/sprd-history-candles': 2, 'tradingBot/grid/ai-param': 1, 'tradingBot/grid/min-investment': 1, 'tradingBot/public/rsi-back-testing': 1, 'asset/exchange-list': 5 / 3, 'finance/staking-defi/eth/apy-history': 5 / 3, 'finance/staking-defi/sol/apy-history': 5 / 3, 'finance/savings/lending-rate-summary': 5 / 3, 'finance/savings/lending-rate-history': 5 / 3, 'finance/fixed-loan/lending-offers': 10 / 3, 'finance/fixed-loan/lending-apy-history': 10 / 3, 'finance/fixed-loan/pending-lending-volume': 10 / 3, // public broker 'finance/sfp/dcd/products': 2 / 3, // copytrading 'copytrading/public-lead-traders': 4, 'copytrading/public-weekly-pnl': 4, 'copytrading/public-stats': 4, 'copytrading/public-preference-currency': 4, 'copytrading/public-current-subpositions': 4, 'copytrading/public-subpositions-history': 4, 'support/announcements-types': 20, }, }, 'private': { 'get': { // rfq 'rfq/counterparties': 4, 'rfq/maker-instrument-settings': 4, 'rfq/mmp-config': 4, 'rfq/rfqs': 10, 'rfq/quotes': 10, 'rfq/trades': 4, 'rfq/public-trades': 4, // sprd 'sprd/order': 1 / 3, 'sprd/orders-pending': 1 / 3, 'sprd/orders-history': 1 / 2, 'sprd/orders-history-archive': 1 / 2, 'sprd/trades': 1 / 3, // trade 'trade/order': 1 / 3, 'trade/orders-pending': 1 / 3, 'trade/orders-history': 1 / 2, 'trade/orders-history-archive': 1, 'trade/fills': 1 / 3, 'trade/fills-history': 2.2, 'trade/fills-archive': 2, 'trade/order-algo': 1, 'trade/orders-algo-pending': 1, 'trade/orders-algo-history': 1, 'trade/easy-convert-currency-list': 20, 'trade/easy-convert-history': 20, 'trade/one-click-repay-currency-list': 20, 'trade/one-click-repay-currency-list-v2': 20, 'trade/one-click-repay-history': 20, 'trade/one-click-repay-history-v2': 20, 'trade/account-rate-limit': 1, // asset 'asset/currencies': 5 / 3, 'asset/balances': 5 / 3, 'asset/non-tradable-assets': 5 / 3, 'asset/asset-valuation': 10, 'asset/transfer-state': 10, 'asset/bills': 5 / 3, 'asset/deposit-lightning': 5, 'asset/deposit-address': 5 / 3, 'asset/deposit-history': 5 / 3, 'asset/withdrawal-history': 5 / 3, 'asset/deposit-withdraw-status': 20, 'asset/convert/currencies': 5 / 3, 'asset/convert/currency-pair': 5 / 3, 'asset/convert/history': 5 / 3, 'asset/monthly-statement': 2, // account 'account/instruments': 1, 'account/balance': 2, 'account/positions': 2, 'account/positions-history': 100, 'account/account-position-risk': 2, 'account/bills': 5 / 3, 'account/bills-archive': 5 / 3, 'account/bills-history-archive': 2, 'account/config': 4, 'account/max-size': 1, 'account/max-avail-size': 1, 'account/leverage-info': 1, 'account/adjust-leverage-info': 4, 'account/max-loan': 1, 'account/trade-fee': 4, 'account/interest-accrued': 4, 'account/interest-rate': 4, 'account/max-withdrawal': 1, 'account/risk-state': 2, 'account/quick-margin-borrow-repay-history': 4, 'account/borrow-repay-history': 4, 'account/vip-interest-accrued': 4, 'account/vip-interest-deducted': 4, 'account/vip-loan-order-list': 4, 'account/vip-loan-order-detail': 4, 'account/interest-limits': 4, 'account/greeks': 2, 'account/position-tiers': 2, 'account/mmp-config': 4, 'account/fixed-loan/borrowing-limit': 4, 'account/fixed-loan/borrowing-quote': 5, 'account/fixed-loan/borrowing-orders-list': 5, 'account/spot-manual-borrow-repay': 10, 'account/set-auto-repay': 4, 'account/spot-borrow-repay-history': 4, 'account/move-positions-history': 10, // subaccount 'users/subaccount/list': 10, 'account/subaccount/balances': 10 / 3, 'asset/subaccount/balances': 10 / 3, 'account/subaccount/max-withdrawal': 1, 'asset/subaccount/bills': 5 / 3, 'asset/subaccount/managed-subaccount-bills': 5 / 3, 'users/entrust-subaccount-list': 10, 'account/subaccount/interest-limits': 4, 'users/subaccount/apikey': 10, // grid trading 'tradingBot/grid/orders-algo-pending': 1, 'tradingBot/grid/orders-algo-history': 1, 'tradingBot/grid/orders-algo-details': 1, 'tradingBot/grid/sub-orders': 1, 'tradingBot/grid/positions': 1, 'tradingBot/grid/ai-param': 1, 'tradingBot/signal/signals': 1, 'tradingBot/signal/orders-algo-details': 1, 'tradingBot/signal/orders-algo-history': 1, 'tradingBot/signal/positions': 1, 'tradingBot/signal/positions-history': 1, 'tradingBot/signal/sub-orders': 1, 'tradingBot/signal/event-history': 1, 'tradingBot/recurring/orders-algo-pending': 1, 'tradingBot/recurring/orders-algo-history': 1, 'tradingBot/recurring/orders-algo-details': 1, 'tradingBot/recurring/sub-orders': 1, // earn 'finance/savings/balance': 5 / 3, 'finance/savings/lending-history': 5 / 3, 'finance/staking-defi/offers': 10 / 3, 'finance/staking-defi/orders-active': 10 / 3, 'finance/staking-defi/orders-history': 10 / 3, // eth staking 'finance/staking-defi/eth/balance': 5 / 3, 'finance/staking-defi/eth/purchase-redeem-history': 5 / 3, 'finance/staking-defi/eth/product-info': 3, 'finance/staking-defi/sol/balance': 5 / 3, 'finance/staking-defi/sol/purchase-redeem-history': 5 / 3, // copytrading 'copytrading/current-subpositions': 1, 'copytrading/subpositions-history': 1, 'copytrading/instruments': 4, 'copytrading/profit-sharing-details': 4, 'copytrading/total-profit-sharing': 4, 'copytrading/unrealized-profit-sharing-details': 4, 'copytrading/copy-settings': 4, 'copytrading/batch-leverage-info': 4, 'copytrading/current-lead-traders': 4, 'copytrading/lead-traders-history': 4, // broker 'broker/nd/info': 10, 'broker/nd/subaccount-info': 10, 'broker/nd/subaccount/apikey': 10, 'asset/broker/nd/subaccount-deposit-address': 5 / 3, 'asset/broker/nd/subaccount-deposit-history': 4, 'asset/broker/nd/subaccount-withdrawal-history': 4, 'broker/nd/rebate-daily': 100, 'broker/nd/rebate-per-orders': 300, 'finance/sfp/dcd/order': 2, 'finance/sfp/dcd/orders': 2, 'broker/fd/rebate-per-orders': 300, 'broker/fd/if-rebate': 5, // affiliate 'affiliate/invitee/detail': 1, 'users/partner/if-rebate': 1, 'support/announcements': 4, }, 'post': { // rfq 'rfq/create-rfq': 4, 'rfq/cancel-rfq': 4, 'rfq/cancel-batch-rfqs': 10, 'rfq/cancel-all-rfqs': 10, 'rfq/execute-quote': 15, 'rfq/maker-instrument-settings': 4, 'rfq/mmp-reset': 4, 'rfq/mmp-config': 100, 'rfq/create-quote': 0.4, 'rfq/cancel-quote': 0.4, 'rfq/cancel-batch-quotes': 10, 'rfq/cancel-all-quotes': 10, // sprd 'sprd/order': 1, 'sprd/cancel-order': 1, 'sprd/mass-cancel': 1, 'sprd/amend-order': 1, 'sprd/cancel-all-after': 10, // trade 'trade/order': 1 / 3, 'trade/batch-orders': 1 / 15, 'trade/cancel-order': 1 / 3, 'trade/cancel-batch-orders': 1 / 15, 'trade/amend-order': 1 / 3, 'trade/amend-batch-orders': 1 / 150, 'trade/close-position': 1, 'trade/fills-archive': 172800, 'trade/order-algo': 1, 'trade/cancel-algos': 1, 'trade/amend-algos': 1, 'trade/cancel-advance-algos': 1, 'trade/easy-convert': 20, 'trade/one-click-repay': 20, 'trade/one-click-repay-v2': 20, 'trade/mass-cancel': 4, 'trade/cancel-all-after': 10, // asset 'asset/transfer': 10, 'asset/withdrawal': 5 / 3, 'asset/withdrawal-lightning': 5, 'asset/cancel-withdrawal': 5 / 3, 'asset/convert-dust-assets': 10, 'asset/convert/estimate-quote': 1, 'asset/convert/trade': 1, 'asset/monthly-statement': 1, // account 'account/set-position-mode': 4, 'account/set-leverage': 1, 'account/position/margin-balance': 1, 'account/set-greeks': 4, 'account/set-isolated-mode': 4, 'account/quick-margin-borrow-repay': 4, 'account/borrow-repay': 5 / 3, 'account/simulated_margin': 10, 'account/position-builder': 10, 'account/set-riskOffset-type': 2, 'account/activate-option': 4, 'account/set-auto-loan': 4, 'account/set-account-level': 4, 'account/mmp-reset': 4, 'account/mmp-config': 100, 'account/fixed-loan/borrowing-order': 5, 'account/fixed-loan/amend-borrowing-order': 5, 'account/fixed-loan/manual-reborrow': 5, 'account/fixed-loan/repay-borrowing-order': 5, 'account/bills-history-archive': 72000, 'account/move-positions': 10, // subaccount 'users/subaccount/modify-apikey': 10, 'asset/subaccount/transfer': 10, 'users/subaccount/set-transfer-out': 10, 'account/subaccount/set-loan-allocation': 4, 'users/subaccount/create-subaccount': 10, 'users/subaccount/subaccount-apikey': 10, 'users/subaccount/delete-apikey': 10, // grid trading 'tradingBot/grid/order-algo': 1, 'tradingBot/grid/amend-order-algo': 1, 'tradingBot/grid/stop-order-algo': 1, 'tradingBot/grid/close-position': 1, 'tradingBot/grid/cancel-close-order': 1, 'tradingBot/grid/order-instant-trigger': 1, 'tradingBot/grid/withdraw-income': 1, 'tradingBot/grid/compute-margin-balance': 1, 'tradingBot/grid/margin-balance': 1, 'tradingBot/grid/min-investment': 1, 'tradingBot/grid/adjust-investment': 1, 'tradingBot/signal/create-signal': 1, 'tradingBot/signal/order-algo': 1, 'tradingBot/signal/stop-order-algo': 1, 'tradingBot/signal/margin-balance': 1, 'tradingBot/signal/amendTPSL': 1, 'tradingBot/signal/set-instruments': 1, 'tradingBot/signal/close-position': 1, 'tradingBot/signal/sub-order': 1, 'tradingBot/signal/cancel-sub-order': 1, 'tradingBot/recurring/order-algo': 1, 'tradingBot/recurring/amend-order-algo': 1, 'tradingBot/recurring/stop-order-algo': 1, // earn 'finance/savings/purchase-redempt': 5 / 3, 'finance/savings/set-lending-rate': 5 / 3, 'finance/staking-defi/purchase': 3, 'finance/staking-defi/redeem': 3, 'finance/staking-defi/cancel': 3, // eth staking 'finance/staking-defi/eth/purchase': 5, 'finance/staking-defi/eth/redeem': 5, 'finance/staking-defi/sol/purchase': 5, 'finance/staking-defi/sol/redeem': 5, // copytrading 'copytrading/algo-order': 1, 'copytrading/close-subposition': 1, 'copytrading/set-instruments': 4, 'copytrading/first-copy-settings': 4, 'copytrading/amend-copy-settings': 4, 'copytrading/stop-copy-trading': 4, 'copytrading/batch-set-leverage': 4, // broker 'broker/nd/create-subaccount': 0.25, 'broker/nd/delete-subaccount': 1, 'broker/nd/subaccount/apikey': 0.25, 'broker/nd/subaccount/modify-apikey': 1, 'broker/nd/subaccount/delete-apikey': 1, 'broker/nd/set-subaccount-level': 4, 'broker/nd/set-subaccount-fee-rate': 4, 'broker/nd/set-subaccount-assets': 0.25, 'asset/broker/nd/subaccount-deposit-address': 1, 'asset/broker/nd/modify-subaccount-deposit-address': 5 / 3, 'broker/nd/rebate-per-orders': 36000, 'finance/sfp/dcd/quote': 10, 'finance/sfp/dcd/order': 10, 'broker/nd/report-subaccount-ip': 0.25, 'broker/fd/rebate-per-orders': 36000, }, }, }, 'fees': { 'trading': { 'taker': this.parseNumber('0.0015'), 'maker': this.parseNumber('0.0010'), }, 'spot': { 'taker': this.parseNumber('0.0015'), 'maker': this.parseNumber('0.0010'), }, 'future': { 'taker': this.parseNumber('0.0005'), 'maker': this.parseNumber('0.0002'), }, 'swap': { 'taker': this.parseNumber('0.00050'), 'maker': this.parseNumber('0.00020'), }, }, 'requiredCredentials': { 'apiKey': true, 'secret': true, 'password': true, }, 'exceptions': { 'exact': { // Public error codes from 50000-53999 // General Class '1': ExchangeError, '2': ExchangeError, '4088': ManualInteractionNeeded, '50000': BadRequest, '50001': OnMaintenance, '50002': BadRequest, '50004': RequestTimeout, '50005': ExchangeNotAvailable, '50006': BadRequest, '50007': AccountSuspended, '50008': AuthenticationError, '50009': AccountSuspended, '50010': ExchangeError, '50011': RateLimitExceeded, '50012': ExchangeError, '50013': ExchangeNotAvailable, '50014': BadRequest, '50015': ExchangeError, '50016': ExchangeError, '50017': ExchangeError, '50018': ExchangeError, '50019': ExchangeError, '50020': ExchangeError, '50021': ExchangeError, '50022': ExchangeError, '50023': ExchangeError, '50024': BadRequest, '50025': ExchangeError, '50026': ExchangeNotAvailable, '50027': PermissionDenied, '50028': ExchangeError, '50044': BadRequest, '50061': ExchangeError, '50062': ExchangeError, // API Class '50100': ExchangeError, '50101': AuthenticationError, '50102': InvalidNonce, '50103': AuthenticationError, '50104': AuthenticationError, '50105': AuthenticationError, '50106': AuthenticationError, '50107': AuthenticationError, '50108': ExchangeError, '50109': ExchangeError, '50110': PermissionDenied, '50111': AuthenticationError, '50112': AuthenticationError, '50113': AuthenticationError, '50114': AuthenticationError, '50115': BadRequest, // Trade Class '51000': BadRequest, '51001': BadSymbol, '51002': BadSymbol, '51003': BadRequest, '51004': InvalidOrder, '51005': InvalidOrder, '51006': InvalidOrder, '51007': InvalidOrder, '51008': InsufficientFunds, '51009': AccountSuspended, '51010': AccountNotEnabled, '51011': InvalidOrder, '51012': BadSymbol, '51014': BadSymbol, '51015': BadSymbol, '51016': InvalidOrder, '51017': ExchangeError, '51018': ExchangeError, '51019': ExchangeError, '51020': InvalidOrder, '51021': ContractUnavailable, '51022': ContractUnavailable, '51023': ExchangeError, '51024': AccountSuspended, '51025': ExchangeError, '51026': BadSymbol, '51027': ContractUnavailable, '51028': ContractUnavailable, '51029': ContractUnavailable, '51030': ContractUnavailable, '51031': InvalidOrder, '51046': InvalidOrder, '51047': InvalidOrder, '51072': InvalidOrder, '51073': InvalidOrder, '51074': InvalidOrder, '51090': InvalidOrder, '51091': InvalidOrder, '51092': InvalidOrder, '51093': InvalidOrder, '51094': InvalidOrder, '51095': InvalidOrder, '51096': InvalidOrder, '51098': InvalidOrder, '51099': InvalidOrder, '51100': InvalidOrder, '51101': InvalidOrder, '51102': InvalidOrder, '51103': InvalidOrder, '51104': InvalidOrder, '51105': InvalidOrder, '51106': InvalidOrder, '51107': InvalidOrder, '51108': InvalidOrder, '51109': InvalidOrder, '51110': InvalidOrder, '51111': BadRequest, '51112': InvalidOrder, '51113': RateLimitExceeded, '51115': InvalidOrder, '51116': InvalidOrder, '51117': InvalidOrder, '51118': InvalidOrder, '51119': InsufficientFunds, '51120': InvalidOrder, '51121': InvalidOrder, '51122': InvalidOrder, '51124': InvalidOrder, '51125': InvalidOrder, '51126': InvalidOrder, '51127': InsufficientFunds, '51128': InvalidOrder, '51129': InvalidOrder, '51130': BadSymbol, '51131': InsufficientFunds, '51132': InvalidOrder, '51133': InvalidOrder, '51134': InvalidOrder, '51135': InvalidOrder, '51136': InvalidOrder, '51137': InvalidOrder, '51138': InvalidOrder, '51139': InvalidOrder, '51156': BadRequest, '51159': BadRequest, '51162': InvalidOrder, '51163': InvalidOrder, '51166': InvalidOrder, '51174': InvalidOrder, '51185': InvalidOrder, '51201': InvalidOrder, '51202': InvalidOrder, '51203': InvalidOrder, '51204': InvalidOrder, '51205': InvalidOrder, '51250': InvalidOrder, '51251': InvalidOrder, '51252': InvalidOrder, '51253': InvalidOrder, '51254': InvalidOrder, '51255': InvalidOrder, '51256': InvalidOrder, '51257': InvalidOrder, '51258': InvalidOrder, '51259': InvalidOrder, '51260': InvalidOrder, '51261': InvalidOrder, '51262': InvalidOrder, '51263': InvalidOrder, '51264': InvalidOrder, '51265': InvalidOrder, '51267': InvalidOrder, '51268': InvalidOrder, '51269': InvalidOrder, '51270': InvalidOrder, '51271': InvalidOrder, '51272': InvalidOrder, '51273': InvalidOrder, '51274': InvalidOrder, '51275': InvalidOrder, '51276': InvalidOrder, '51277': InvalidOrder, '51278': InvalidOrder, '51279': InvalidOrder, '51280': InvalidOrder, '51321': InvalidOrder, '51322': InvalidOrder, '51323': BadRequest, '51324': BadRequest, '51325': InvalidOrder, '51327': InvalidOrder, '51328': InvalidOrder, '51329': InvalidOrder, '51330': InvalidOrder, '51400': OrderNotFound, '51401': OrderNotFound, '51402': OrderNotFound, '51403': InvalidOrder, '51404': InvalidOrder, '51405': ExchangeError, '51406': ExchangeError, '51407': BadRequest, '51408': ExchangeError, '51409': ExchangeError, '51410': CancelPending, '51500': ExchangeError, '51501': ExchangeError, '51502': InsufficientFunds, '51503': ExchangeError, '51506': ExchangeError, '51508': ExchangeError, '51509': ExchangeError, '51510': ExchangeError, '51511': ExchangeError, '51600': ExchangeError, '51601': ExchangeError, '51602': ExchangeError, '51603': OrderNotFound, '51732': AuthenticationError, '51733': AuthenticationError, '51734': AuthenticationError, '51735': ExchangeError, '51736': InsufficientFunds, // Data class '52000': ExchangeError, // SPOT/MARGIN error codes 54000-54999 '54000': ExchangeError, '54001': ExchangeError, '54008': InvalidOrder, '54009': InvalidOrder, '54011': InvalidOrder, // Trading bot Error Code from 55100 to 55999 '55100': InvalidOrder, '55101': InvalidOrder, '55102': InvalidOrder, '55103': InvalidOrder, '55104': InvalidOrder, '55111': InvalidOrder, '55112': InvalidOrder, '55113': InvalidOrder, // FUNDING error codes 58000-58999 '58000': ExchangeError, '58001': AuthenticationError, '58002': PermissionDenied, '58003': ExchangeError, '58004': AccountSuspended, '58005': ExchangeError, '58006': ExchangeError, '58007': ExchangeError, '58100': ExchangeError, '58101': AccountSuspended, '58102': RateLimitExceeded, '58103': ExchangeError, '58104': ExchangeError, '58105': ExchangeError, '58106': ExchangeError, '58107': ExchangeError, '58108': ExchangeError, '58109': ExchangeError, '58110': ExchangeError, '58111': ExchangeError, '58112': ExchangeError, '58114': ExchangeError, '58115': ExchangeError, '58116': ExchangeError, '58117': ExchangeError, '58125': BadRequest, '58126': BadRequest, '58127': BadRequest, '58128': BadRequest, '58200': ExchangeError, '58201': ExchangeError, '58202': ExchangeError, '58203': InvalidAddress, '58204': AccountSuspended, '58205': ExchangeError, '58206': ExchangeError, '58207': InvalidAddress, '58208': ExchangeError, '58209': ExchangeError, '58210': ExchangeError, '58211': ExchangeError, '58212': ExchangeError, '58213': AuthenticationError, '58221': BadRequest, '58222': BadRequest, '58224': BadRequest, '58227': BadRequest, '58228': BadRequest, '58229': InsufficientFunds, '58300': ExchangeError, '58350': InsufficientFunds, // Account error codes 59000-59999 '59000': ExchangeError, '59001': ExchangeError, '59100': ExchangeError, '59101': ExchangeError, '59102': ExchangeError, '59103': InsufficientFunds, '59104': ExchangeError, '59105': ExchangeError, '59106': ExchangeError, '59107': ExchangeError, '59108': InsufficientFunds, '59109': ExchangeError, '59128': InvalidOrder, '59200': InsufficientFunds, '59201': InsufficientFunds, '59216': BadRequest, '59260': PermissionDenied, '59262': PermissionDenied, '59300': ExchangeError, '59301': ExchangeError, '59313': ExchangeError, '59401': ExchangeError, '59410': OperationRejected, '59411': InsufficientFunds, '59412': OperationRejected, '59413': OperationRejected, '59414': BadRequest, '59500': ExchangeError, '59501': ExchangeError, '59502': ExchangeError, '59503': ExchangeError, '59504': ExchangeError, '59505': ExchangeError, '59506': ExchangeError, '59507': ExchangeError, '59508': AccountSuspended, '59515': ExchangeError, '59516': ExchangeError, '59517': ExchangeError, '59518': ExchangeError, '59519': ExchangeError, '59642': BadRequest, '59643': ExchangeError, // WebSocket error Codes from 60000-63999 '60001': AuthenticationError, '60002': AuthenticationError, '60003': AuthenticationError, '60004': AuthenticationError, '60005': AuthenticationError, '60006': InvalidNonce, '60007': AuthenticationError, '60008': AuthenticationError, '60009': AuthenticationError, '60010': AuthenticationError, '60011': AuthenticationError, '60012': BadRequest, '60013': BadRequest, '60014': RateLimitExceeded, '60015': NetworkError, '60016': ExchangeNotAvailable, '60017': BadRequest, '60018': BadRequest, '60019': BadRequest, '60020': ExchangeError, '60021': AccountNotEnabled, '60022': AuthenticationError, '60023': DDoSProtection, '60024': AuthenticationError, '60025': ExchangeError, '60026': AuthenticationError, '60027': ArgumentsRequired, '60028': NotSupported, '60029': AccountNotEnabled, '60030': AccountNotEnabled, '60031': AuthenticationError, '60032': AuthenticationError, '63999': ExchangeError, '64000': BadRequest, '64001': BadRequest, '64002': BadRequest, '64003': AccountNotEnabled, '70010': BadRequest, '70013': BadRequest, '70016': BadRequest, '70060': BadRequest, '70061': BadRequest, '70062': BadRequest, '70064': BadRequest, '70065': BadRequest, '70066': BadRequest, '70067': BadRequest, '1009': BadRequest, '4001': AuthenticationError, '4002': BadRequest, '4003': RateLimitExceeded, '4004': NetworkError, '4005': ExchangeNotAvailable, '4006': BadRequest, '4007': AuthenticationError, '4008': RateLimitExceeded, // The number of subscribed channels exceeds the maximum limit. }, 'broad': { 'Internal Server Error': ExchangeNotAvailable, 'server error': ExchangeNotAvailable, // {"code":500,"data":{},"detailMsg":"","error_code":"500","error_message":"server error 1236805249","msg":"server error 1236805249"} }, }, 'httpExceptions': { '429': ExchangeNotAvailable, // https://github.com/ccxt/ccxt/issues/9612 }, 'precisionMode': TICK_SIZE, 'options': { 'sandboxMode': false, 'defaultNetwork': 'ERC20', 'defaultNetworks': { 'ETH': 'ERC20', 'BTC': 'BTC', 'USDT': 'TRC20', }, 'networks': { 'BTC': 'Bitcoin', 'BTCLN': 'Lightning', 'BTCLIGHTNING': 'Lightning', 'BEP20': 'BSC', 'BRC20': 'BRC20', 'ERC20': 'ERC20', 'TRC20': 'TRC20', 'CRC20': 'Crypto', 'ACA': 'Acala', 'ALGO': 'Algorand', 'APT': 'Aptos', 'SCROLL': 'Scroll', 'ARBONE': 'Arbitrum One', 'AVAXC': 'Avalanche C-Chain', 'AVAXX': 'Avalanche X-Chain', 'BASE': 'Base', 'SUI': 'SUI', 'ZKSYNCERA': 'zkSync Era', 'LINEA': 'Linea', 'AR': 'Arweave', 'ASTR': 'Astar', 'BCH': 'BitcoinCash', 'BSV': 'Bitcoin SV', 'ADA': 'Cardano', 'CSPR': 'Casper', 'CELO': 'CELO', 'XCH': 'Chia', // 'CHZ': 'Chiliz', TBD: Chiliz 2.0 Chain vs Chiliz Chain 'ATOM': 'Cosmos', 'DGB': 'Digibyte', 'DOGE': 'Dogecoi