Cannot create sell order: Python ccxt binance does not have market symbol USDT/BTC

2.5k Views Asked by At

I am using python ccxt module to create a sell order in some binance account. First I create the exchange client

import ccxt
exchange = ccxt.binance( { 'apiKey' : "<someKey>" , 'secret' : "<thaSecretKey>" } )

Then when I try to use its create_market_sell_order method to create a market sell order I get the following error:

>>> exchange.create_market_sell_order(symbol="USDT/BTC", amount="0.1")
Traceback (most recent call last):
    [...]
    raise BadSymbol(self.id + ' does not have market symbol ' + symbol)
ccxt.base.errors.BadSymbol: binance does not have market symbol USDT/BTC

So seems like there is no ticker for selling USDT for BTC, while it works for the BTC/USDT ticker.

How could I create a sell order to buy BTC with USD using this create_market_sell_order method? The same happens with MANA: there are no '<someCrypto>/MANA' tickers!

ccxt.base.errors.BadSymbol: binance does not have market symbol BTC/MANA

So I can neither sell MANA.

I don't want to create a buy order instead because calculating the amount I could buy with my available USDT is not straightforward.

1

There are 1 best solutions below

1
On

Just replace "USDT/BTC" to "BTC/USDT".

"BTC/USDT" means the amount USDT per 1 BTC and "USDT/BTC" means the amount of BTC per 1 USDT