Closed oleksandrkyetov closed 5 years ago
No it should not USD is plain old vanilla fiat USA Dollar which Binance does not support directly on the exchange USDC is a ERC20 token representing a stable coin tied to USD by Circle and Coinbase
Thank you @walec51 , that make sense, how do I get a price for BTC/USDC in this case? Binance REST API allows that https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDC But, there is no USDC in the CurrencyPair class https://github.com/knowm/XChange/blob/develop/xchange-core/src/main/java/org/knowm/xchange/currency/CurrencyPair.java
exchange.getMarketDataService().getTicker(new CurrencyPair("BTC", "USDC"));
When using https://github.com/knowm/XChange/blob/develop/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceMarketDataServiceRaw.java#L61 https://github.com/knowm/XChange/blob/develop/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceMarketDataServiceRaw.java#L46 calls fail with org.knowm.xchange.exceptions.CurrencyPairNotValidException: Invalid symbol.
Reason for that is that currency pairs BTC/USD and ETH/USD are being resolved to BTCUSD and ETHUSD symbols respectively, but should resolve to BTCUSDC and ETHUSDC