exchangerate.host icon indicating copy to clipboard operation
exchangerate.host copied to clipboard

Exchange rates with source crypto is sometimes inverted

Open nonvex opened this issue 3 years ago • 8 comments

Firstly, thank you for your work. Much appreciated.

The issue is the rate of exchange does not respect the order: from -> to for some source=crypto cases.

Example: https://api.exchangerate.host/convert?from=usd&to=eth&source=crypto

{
  "motd": {
    "msg": "If you or your company use this project or like what we doing, please consider backing us so we can continue maintaining and evolving this project.",
    "url": "https://exchangerate.host/#/donate"
  },
  "success": true,
  "query": {
    "from": "USD",
    "to": "ETH",
    "amount": 1
  },
  "info": {
    "rate": 1145.182585
  },
  "historical": false,
  "date": "2021-02-05",
  "result": 1145.182585
}

nonvex avatar Feb 05 '21 09:02 nonvex

To add some more information here. As long as source=crypto even for regular currencies the rate is inverted.

Example: https://api.exchangerate.host/convert?from=usd&to=eur&source=crypto

{
  "motd": {
    "msg": "If you or your company use this project or like what we doing, please consider backing us so we can continue maintaining and evolving this project.",
    "url": "https://exchangerate.host/#/donate"
  },
  "success": true,
  "query": {
    "from": "USD",
    "to": "EUR",
    "amount": 1
  },
  "info": {
    "rate": 1.203956
  },
  "historical": false,
  "date": "2021-02-08",
  "result": 1.203956
}

nonvex avatar Feb 08 '21 20:02 nonvex

To me, it seems the historical information is wrong. See example Bitcoin to USD (not correct prior to 2 May 2020):

image

stevecondylios avatar Mar 21 '21 03:03 stevecondylios

@arzzen do you know if it's possible to correct historical information in the database?

stevecondylios avatar Mar 21 '21 03:03 stevecondylios

I'm seeing this issue as well.

$ curl -s 'https://api.exchangerate.host/latest?base=USD&symbols=USD,BTC&source=crypto&places=12' | jq .rates.BTC
"0.000019086908"

$ curl -s 'https://api.exchangerate.host/latest?base=USD&symbols=USD,DOGE&source=crypto&places=12' | jq .rates.DOGE
"0.037495561690"

$ curl -s 'https://api.exchangerate.host/latest?base=USD&symbols=USD,ETH&source=crypto&places=12' | jq .rates.ETH
"1162.310469314080"

ETH seems inverted, but BTC and DOGE seem ok.

francislavoie avatar Mar 25 '21 22:03 francislavoie

Any updates on this issue?

It seems to me that even querieng for list of all crypto rates returns inverted values sometimes: https://api.exchangerate.host/latest?base=USD&source=crypto

emvaized avatar Sep 23 '21 08:09 emvaized

Pinging here as we are blocked on this. We use exchangerate.host for our fiat currency conversions and would like to use the same provider for crypto conversions.

However unless this is fixed we have to choose another provider.

@arzzen We (Quaestor) are a sponsor of yours and would be great if this could get prioritized as source=crypto is unusable/broken in its current state.

gwevans avatar Oct 28 '21 18:10 gwevans

Also affected by this. It seems to be directly related to sources. BTC works out fine because it is actually available in some of the FOREX sources and seems to get served from there. Others that ace part of the CRYPTO only list (the majority of cryptocurrencies) seems to be consistently inverted. I'm post processing the fixed list on ones I need and inverting them myself, but this is very obnoxious.

alerque avatar Apr 27 '22 13:04 alerque

Same here. Would be great if this can be fixed 😔

cguagenti avatar May 25 '22 16:05 cguagenti