From what I have seen CCXT does not provide functionality for creating an order of type:
"I want to spend 10 USDT to buy BTC"
Instead, the only thing you can do is to specify the amount of the base currency(BTC) you want to buy, like in the examples below:
const order = await exchange.createOrder(symbol, 'market', 'buy', amount, price);
OR
const symbol = 'BTC/USD';
const amount = 2;
const price = 9000;
cost = amount * price;
const order = await exchange.createMarketBuyOrder (symbol, cost);
Is there something that I have missed that could provide the functionality I need ?
The only solution I could think of is to get the base currency's price and calculate the percentage of it that equals to 10 USDT so I can then use that as the amount
in the examples above.