dash-wallet icon indicating copy to clipboard operation
dash-wallet copied to clipboard

Make FIAT rates source explicit and selectable (enable Cryptocompare) to fix ARS rate

Open eloyesp opened this issue 3 years ago • 11 comments

Currently it seems that the source used for exchange rates was set on #159 to the Spark API, that use BitcoinAverage as source, but that is not explicit on the application and there is no setting to select another source.

The problem is that BitcoinAverage (and most other rates APIs) does not work for currencies that do not have a simple exchange rate with USD, because they only use the DASH/USD exchange rate and cross that data with FIAT/FIAT that do not work for complex cases.

Current Behavior example

Currently, DASH price is 21_356 ARS on Spark (and bitcoinAverage and CoinGecko), while CryptoCompare does get 35_259 ARS. The most correct value is the later. As you can see, the difference is not minor and makes that exchange rate unusable on the current context.

The source of the problem is that the exchange rate calculated by bitcoin average is based on the dash price of 235 USD, using an exchange rate of USD/ARS of 90.87 (what is known as the official rate), but that price is not accessible on the market, so the real value is closer to 140 ARS. You can see those different values (there are 9 different exchange rates to see) on this newspaper.

CryptoCompare does get it right because it fallback to the exchange rate of BTC/ARS so it gets a good value.

Expected Behavior

Make CryptoCompare the default source for ARS (while there might be other cases when that is a better default) and make it possible for the user to:

  1. Know the source of the data used
  2. Select a different source

I've raised the same issue on https://github.com/bitcoin-wallet/bitcoin-wallet/issues/627 and I've already contacted BitcoinAverage and CoinGecko and they do not want to care about this issue.

eloyesp avatar Mar 14 '21 22:03 eloyesp

Thank you for pointing this out, we will be looking into it. The app has 4 sources of exchange rates. In the past, some were depending in different ways on BitcoinAverage.com which is now behind a paywall.

Some of the sources we don't modify, while others we do some manual calculations for certain currencies. For those we don't modify, we will try to get those sources to update the ARS value to use CryptoCompare.

HashEngineering avatar Mar 15 '21 16:03 HashEngineering

Thank you for highlighting this Eloyesp, my team maintains one of the rate sources used in the wallet.

We had a similar issue with Venezuela due to inflation and government rates versus local rates. We can add the cryptocompare BTCARS rate as a source dependent on suitability and route all ARS pricing via DASHBTC>BTCARS but I'd also like a secondary option that is a more direct source (and fallback should we lose cryptocompare or API is prohibitive / not suitable)

From the link you provided, which USDARS source(s) do you consider the most accurate?

AshFrancis avatar Mar 15 '21 20:03 AshFrancis

@AshFrancis I think that there is no more direct exchange rate than DASHBTC>BTCARS. In the link provided there are some exchange rates between USDARS, but they tend usually show a difference of 2-3% (on both directions) when inspecting the BTC->USD->ARS. The only reliable alternative source I can think on is using https://coinmonitor.info (The BTC-ARS rate "Mediana Promedio") is a good value.

eloyesp avatar Mar 16 '21 23:03 eloyesp

I know that it might be another issue, but I also think that the API providers got a lot of usage when used on a wallet and deserve that usage to be explicit (as a kind of thanking for the service). So, if data is provided by dashretail.org, it should be shown on the wallet somewhere (at least on the about page).

eloyesp avatar Mar 16 '21 23:03 eloyesp

Ok

yayo8891 avatar Mar 21 '21 23:03 yayo8891

@eloyesp Both sources have been added now:

Rate https://rates2.dashretail.org/rates?source=dashretail&symbol=dashars

In full detail: https://rates2.dashretail.org/rates?source=dashretail&symbol=dashars&nested=1

The weight=1 on gecko for example is there for fallback reasons.

Thanks for reporting this!

AshFrancis avatar Mar 24 '21 23:03 AshFrancis

The weight=1 on gecko for example is there for fallback reasons.

First thing first: "This is awesome"! Thanks!

Now, my perfectionist self found two subtle issues:

  • On one hand, there is an issue with the value extracted from coinmonitor.info, you seem to be using the value "mediana compra", that is the median of the values to "sell BTC for ARS", it would be better to use the "mediana Promedio" (that is the average between the median to sell and the median to buy)

  • On the other hand, the final value seems to be the weighted average between the average-retail (with weight 100) and the coingecko value (with weight 1), but as the coingecko value is so bad, the average get off by $110 per/DASH. It would be better to use a weight of 1000 for the average retail (I'm not sure if that is possible).

Anyway, the difference for what I hope will be normal transactions (500 ARS~17mDASH) the difference is lower than 1 mDASH, so I think that I can start promoting DASH here with this working as is, if it is too hard to fix.

Thanks @AshFrancis .

eloyesp avatar Mar 25 '21 01:03 eloyesp

@eloyesp @AshFrancis This issue appears to be resolved.

HashEngineering avatar Aug 09 '21 04:08 HashEngineering

This issue appears to be resolved.

@HashEngineering While an interesting point is already there (ARS exchange rate is much better), most of the issues I mentioned are not fixed.

  • [ ] Make rates source explicit, as the user deserves to know who he is trusting and the source deserve the credit.
  • [ ] Make the source configurable, so the user can select a better (more trusted) source.

Maybe I should create a different issue to follow those or I may help somehow?


Also, the price for ARS seems to have changed again on dashretail (as it seems to add more weight to the official exchange between USD-ARS).

So, currently, cryptocompare price is estimation is: 30253.75 ARS while dashretail estimates 20958.52 ARS. @AshFrancis

The cryptocompare price can be obtained with a GET here: https://min-api.cryptocompare.com/data/price?fsym=DASH&tsyms=ARS

eloyesp avatar Aug 09 '21 16:08 eloyesp

What is meant by making rates source explicit and configurable?

HashEngineering avatar Aug 09 '21 17:08 HashEngineering

Making source rates explicit is just adding a message somewhere on the application indicating that, for example:

image

For the config, something bellow the option to chose the Local Currency:

image

That way, the user knows what is the source being used (that he needs to trust), and can select an alternative source (that he and the local comunity trust).

eloyesp avatar Aug 09 '21 17:08 eloyesp