[bisq-network/bisq] Add Tether token support via ERC20 and Omni (#4434)

chimp1984 notifications at github.com
Thu Aug 27 13:24:37 UTC 2020


@chimp1984 requested changes on this pull request.



> @@ -70,7 +70,12 @@ public PriceProvider(HttpClient httpClient, String baseUrl) {
                 final double price = (Double) treeMap.get("price");
                 // json uses double for our timestampSec long value...
                 final long timestampSec = MathUtils.doubleToLong((Double) treeMap.get("timestampSec"));
-                marketPriceMap.put(currencyCode, new MarketPrice(currencyCode, price, timestampSec, true));
+                if (currencyCode.equals("USDT")) {
+                    addPrice(marketPriceMap, "USDT-O", price, timestampSec);
+                    addPrice(marketPriceMap, "USDT-E", price, timestampSec);
+                    addPrice(marketPriceMap, "L-USDT", price, timestampSec);
+                }
+                addPrice(marketPriceMap, currencyCode, price, timestampSec);

We are adding USDT additionally as well. So we will end up with 4 price entries for USDT. I am not sure if L-USDT is treated as a seperate altcoin and if preice might differ slightly. I assume so. We should consider to either filter out the USDT-O and USDT-E in the price display code or to not add USDT (so users need to look up USDT-O or USDT-E). As both are the same price I guess its better to filter then out and use USDT.

> @@ -70,7 +70,12 @@ public PriceProvider(HttpClient httpClient, String baseUrl) {
                 final double price = (Double) treeMap.get("price");
                 // json uses double for our timestampSec long value...
                 final long timestampSec = MathUtils.doubleToLong((Double) treeMap.get("timestampSec"));
-                marketPriceMap.put(currencyCode, new MarketPrice(currencyCode, price, timestampSec, true));
+                if (currencyCode.equals("USDT")) {
+                    addPrice(marketPriceMap, "USDT-O", price, timestampSec);
+                    addPrice(marketPriceMap, "USDT-E", price, timestampSec);
+                    addPrice(marketPriceMap, "L-USDT", price, timestampSec);
+                }
+                addPrice(marketPriceMap, currencyCode, price, timestampSec);

As this is getting more messy with sepcial cases I would suggest to add generic support.  Add a new field in the asset to indicate the ticker currency for price feed (USDT). That will be used then for picking up price and price display in case the tickersymbol is not available in the price feed.

-- 
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/4434#pullrequestreview-476699675
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200827/ba5424a5/attachment.html>


More information about the bisq-github mailing list