[bisq-network/bisq] Update GUI labels to reflect multiple rate providers (#4406)

cd2357 notifications at github.com
Sat Aug 8 20:30:53 UTC 2020


@cd2357 commented on this pull request.



> @@ -400,7 +384,12 @@ public void onSuccess(@Nullable Tuple2<Map<String, Long>, Map<String, MarketPric
                 UserThread.execute(() -> {
                     checkNotNull(result, "Result must not be null at requestAllPrices");
                     timeStampMap = result.first;
-                    epochInSecondAtLastRequest = timeStampMap.get("btcAverageTs");
+
+                    // Each currency rate has a different timestamp, depending on when
+                    // the pricenode aggregate rate was calculated
+                    // However, the request timestamp is when the pricenode was queried
+                    epochInMillisAtLastRequest = System.currentTimeMillis();

Since there is no more BA provider, the `btcAverageTs` field is basically useless.

It is however used here to populate the `epochInMillisAtLastRequest` timestamp -- which is used in the UI to show when the fiat rates were retrieved.

Before, when using BA: this made sense, cause BA was the "single source of truth" for all fiat rates, and Poloniex was the source of alt rates.

Now, when using multiple providers: basically the pricenode itself is the "provider", because it aggregates rates from multiple sources for both fiat and alts.

So, the closest "timestamp" that shows the last time the "provider" (pricenode) was polled, is the one in the code snippet above.

Alternative would be to extract and index every timestamp per exchange rate, then selectively show the right one depending on what currency pair the user selected in the UI. That seems like overkill for what this change tries to achieve. Especially since those "per exchange rate" timestamps are very likely the same, cause they all show the point in time when the avg rate was calculated, and they're all calculated when the pricenode is polled (the avg is freshly calculated based on newest data).

So I would say, this is the simplest and most pragmatic approach (`epochInMillisAtLastRequest` = `timestamp_when_pricenode_last_successfully_queried`).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4406#discussion_r467501524
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200808/1e787c7e/attachment-0001.html>


More information about the bisq-github mailing list