question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get withdrawal fees of any exchange

See original GitHub issue

I am working on a code that analyzes the markets of 8 different exchanges. Under no circumstances am I able to obtain withdrawal fees for a particular market. While using the proposed function on the documentation for withdrawal fees:

exchange.currencies['ETH']['fee']

I give an error for all 8 exchanges:

currency = exchange.currencies['ETH']['fee']
KeyError: 'fee'

Is there any way to get these fees?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
DoctorSlimmcommented, May 15, 2022

@Epikem @radadan there are no withdrawal fees for markets, rather there are withdrawal fees for currencies, and these fees vary depending on the network, some exchanges have a fetchTransactionFee(code, params = {}) or fetchTransactionFees(codes, params = {}) methods, (eg: kucoin, bitmart, bibox)which return information about withdrawal and deposit fees for specific currencies if available. However the unification of these methods is work in progress and is not present in most exchanges, hope this helps. On some exchanges (for example binance and huobi) you can also find information about withdrawal fees by network in the currency object, however this information is also not always available.

import ccxt
exchange_id = 'kucoin'
exchange = getattr (ccxt, exchange_id) ()
exchange.load_markets ()
transaction_fees = exchange.fetchTransactionFee('USDT')

Returns: { info: { code: '200000', data: { currency: 'USDT', limitBTCAmount: '1.00000000', usedBTCAmount: '0.00000000', remainAmount: '30522.368535', availableAmount: '0.000000', withdrawMinFee: '25', innerWithdrawMinFee: '0', withdrawMinSize: '50', isWithdrawEnabled: true, precision: 6, chain: 'ERC20' } }, withdraw: { USDT: 25 }, deposit: {} }

import ccxt
exchange_id = 'huobi'
exchange = getattr (ccxt, exchange_id) ()
exchange.load_markets ()
# if available contains
currency = exchange.currency ('BTC')
# if available contains withdrawal information by chain
networks = currency['networks'] 

The networks object will contain information about withdrawal fees for specific networks (if available), otherwise the currency object may contain information about fees.

networks: {'BEP20': {'active': True, 'deposit': True, 'fee': 4e-06, 'id': 'bep20btcb', 'info': {'addrDepositTag': False, 'addrWithTag': False, 'chain': 'bep20btcb', 'depositStatus': 'allowed', 'displayName': 'BEP20', 'fullName': 'BTCB', 'isDynamic': False, 'maxWithdrawAmt': '17.000000000000000000', 'minDepositAmt': '0.000001', 'minWithdrawAmt': '0.000001', 'numOfConfirmations': '30', 'numOfFastConfirmations': '15', 'transactFeeWithdraw': '0.000004', 'withdrawFeeType': 'fixed', 'withdrawPrecision': '8', 'withdrawQuotaPerDay': '17.000000000000000000', 'withdrawQuotaPerYear': None, 'withdrawQuotaTotal': None, 'withdrawStatus': 'allowed'}, 'limits': {'withdraw': {'max': 17.0, 'min': 1e-06}}, 'network': 'BEP20', 'precision': 1e-08, 'withdraw': True}, 'BTC': {'active': True, 'deposit': True, 'fee': 0.0004, 'id': 'btc', 'info': {'addrDepositTag': False, 'addrWithTag': False, 'chain': 'btc', 'depositStatus': 'allowed', 'displayName': 'BTC', 'fullName': 'Bitcoin', 'isDynamic': False, 'maxWithdrawAmt': '100.000000000000000000', 'minDepositAmt': '0.0005', 'minWithdrawAmt': '0.001', 'numOfConfirmations': '2', 'numOfFastConfirmations': '1', 'transactFeeWithdraw': '0.0004', 'withdrawFeeType': 'fixed', 'withdrawPrecision': '8', 'withdrawQuotaPerDay': '100.000000000000000000', 'withdrawQuotaPerYear': None, 'withdrawQuotaTotal': None, 'withdrawStatus': 'allowed'}, 'limits': {'withdraw': {'max': 100.0, 'min': 0.001}}, 'network': 'BTC', 'precision': 1e-08, 'withdraw': True}, 'ERC20': {'active': True, 'deposit': True, 'fee': 0.00034716, 'id': 'hbtc', 'info': {'addrDepositTag': False, 'addrWithTag': False, 'baseChain': 'ETH', 'baseChainProtocol': 'ERC20', 'chain': 'hbtc', 'depositStatus': 'allowed', 'displayName': 'ERC20', 'fullName': 'HBTC', 'isDynamic': True, 'maxWithdrawAmt': '50.000000000000000000', 'minDepositAmt': '0.0005', 'minWithdrawAmt': '0.001', 'numOfConfirmations': '12', 'numOfFastConfirmations': '12', 'transactFeeWithdraw': '0.00034716', 'withdrawFeeType': 'fixed', 'withdrawPrecision': '8', 'withdrawQuotaPerDay': '50.000000000000000000', 'withdrawQuotaPerYear': None, 'withdrawQuotaTotal': None, 'withdrawStatus': 'allowed'}, 'limits': {'withdraw': {'max': 50.0, 'min': 0.001}}, 'network': 'ERC20', 'precision': 1e-08, 'withdraw': True}, 'HRC20': {'active': True, 'deposit': True, 'fee': 2.06e-06, 'id': 'hrc20btc', 'info': {'addrDepositTag': False, 'addrWithTag': False, 'baseChain': 'HECO', 'baseChainProtocol': 'HRC20', 'chain': 'hrc20btc', 'depositStatus': 'allowed', 'displayName': 'HRC20', 'fullName': 'HBTC', 'isDynamic': True, 'maxWithdrawAmt': '100.000000000000000000', 'minDepositAmt': '0.0005', 'minWithdrawAmt': '0.001', 'numOfConfirmations': '20', 'numOfFastConfirmations': '10', 'transactFeeWithdraw': '0.00000206', 'withdrawFeeType': 'fixed', 'withdrawPrecision': '8', 'withdrawQuotaPerDay': '100.000000000000000000', 'withdrawQuotaPerYear': None, 'withdrawQuotaTotal': None, 'withdrawStatus': 'allowed'}, 'limits': {'withdraw': {'max': 100.0, 'min': 0.001}}, 'network': 'HRC20', 'precision': 1e-08, 'withdraw': True}}

Hope this helps

0reactions
ttoduacommented, Aug 7, 2022

@DoctorSlimm had answered above, so closing this issue. let us know if you have any problem with CCXT.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Withdrawal Fees on Cryptocurrency Exchanges
Coin Lowest Average Median Exchanges Compared BTC. Bitcoin FREE $7.32 $8.31 33 ETH. Ethereum FREE $6.05 $2.74 30 BNB. BNB $0.12. 0.0005 BNB $3.03 $0.24 5...
Read more >
FTX Exchange Halts All Crypto Withdrawals - CoinDesk
Crypto exchange FTX has halted all non-fiat customer withdrawals, an FTX support employee confirmed in the company's official Telegram group ...
Read more >
Deposits and Withdrawals on the Exchange
Withdrawal fees will be settled in the currency you are receiving and can not be paid with CRO. Withdrawal Fees & Limits. Please...
Read more >
Why are crypto exchanges charging exorbitant withdrawal fees?
As many exchanges like to charge a flat fee for transaction, say 0.005 btc per withdrawal and they might only pay 0.001 btc...
Read more >
How to Avoid International ATM Fees - Experian
If you want to avoid all the fees, you can use a bank that doesn't charge any conversion or foreign exchange fees and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found