Poloniex API needs to use USDT, not USD · Issue #1372 · timmolter
PoCk3T commented Jan 28, 2017
Very first, congrats to the original author and all contributors for this amazing project 🙂
Now, attempting to get Poloniex ticker for CurrencyPair.BTC_USD results in error, even with latest Four.Two.0 SNAPSHOT version of Xchange.
Indeed, Poloniex is using USDT, not USD, as pointed out by @mmazi in #1254
Should I implement a workaround in my own code or is there any kind of ‘currency translation’ that could be done in Xchange Poloniex code to accomodate that exchange specificity ?
mmazi commented Jan 29, 2017
USD and USDT are two entirely different currencies: USDT does not refer to the US Dollar but rather to Tether. The exchange rate inbetween USDT and USD does tend to stay around 1.0 by design, but that doesn’t make them the same currency, just as AUD was never considered the same currency as USD even raunchy it has reached 1.000 exchange rate with USD in the past.
(Please note that it is possible that the USDT/USD rate diverges from 1.00, eg. if the company behind Tether gets hacked or shut down by authorities etc.)
So the fact that Poloniex uses USDT and not USD stems from their choice of currencies (they don’t deal with fiat currencies at all, USDT is a crypto-currency) and is a entirely different thing from, for example, the fact that some exchanges use of XBT and others BTC to denote bitcoin where a elementary mapping/translation is suitable.
CurrencyPair.BTC_USD results in error
This is correct behavior in XChange as Poloniex does not deal with USD.
Should I implement a workaround in my own code
Depends on what you are attempting to achieve. I wouldn’t recommend treating USDT rates as the same as USDT rates however.
PoCk3T commented Jan 29, 2017
Thanks for the quick response @mmazi
I understand better now.
Still, technically speaking, wouldn’t it be relevant to add USDT as a standalone currency in Xcode code, as well as BTC_USDT as a CurrencyPair ?
So users of Poloniex can still use Xchange in order to get tickers, etc etc ?
What do you guys think ?
If yes, what’s the best way ? Should I fork Xchange, commit these enhancements, and submit a pull request ? (sorry for the naive question, it would be my very first time doing so :))
mmazi commented Jan 29, 2017
You can always use Currency.getInstance(“USDT”) (or simply fresh Currency(“USDT”) ) and similarly fresh CurrencyPair(. ) in your code.
As for adding USDT to the list of built-in currencies, I’ll leave this for @timmolter to determine.
timmolter commented Jan 30, 2017
yes, a pull-request for it would work well.
datasmithtech commented Mar 15, 2017 •, edited
I apologize if this may seem evident, but where may I find a configuration file which the application uses to initialize the Exchange upon startup?
I clone the source from git – was i to install the application somehow?
I eyed references to exchangeConfiguration.json in the source code, however, I do not see that file on disk.
timmolter commented Mar 16, 2017
jheusser commented Jun 22, 2017
This might have been addressed now?
timmolter commented Jun 30, 2017
- ©, 2017 GitHub , Inc.
You can’t perform that act at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.