First of all, I'm using Binance.Net as a Binance API wrapper. At first point, I was struggling to get my balance for the base and quote assets for a crypto pair.
Let's say we're talking about BTCUSDT. I had a problem in obtaining BTC and USDT, separately because I need them to obtain the information about my balance.
var symbols = _client.GetExchangeInfo().Data.Symbols;
var symbol = symbols.Single(item => item.Name == "BTCUSDT");
var baseAsset = symbol.BaseAsset; // BTC
var quoteAsset = symbol.QuoteAsset; // USDT
var firstPairBalance = client.GetAccountInfo().Data.Balances.FirstOrDefault(e => e.Asset == baseAsset).Free; // Balance for BTC
var secondPairBalance = client.GetAccountInfo().Data.Balances.FirstOrDefault(e => e.Asset == quoteAsset).Free; // Balance for USDT
client.PlaceOrder("TRXUSDT", OrderSide.Sell, OrderType.Market, quantity: ..., timeInForce: TimeInForce.GoodTillCancel);
How do I get price estimation to dollars for each of the crypto pairs, so I can compare them and see how much I need to convert. In other words, dollar price for TRX and dollar price USDT, preferably from Binance.