Poloniex API needs to use USDT, not USD · Issue #1372 · timmolter

Comments

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 :))