From de48b3b040069c942401e024fdf84a3d79cbf6a2 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 11 Sep 2020 00:45:17 +0900 Subject: [PATCH] Revert Tether USD for now due to various issues --- .../bisq/asset/coins/TetherUSDLiquid.java | 12 --------- .../java/bisq/asset/coins/TetherUSDOmni.java | 12 --------- .../bisq/asset/tokens/TetherUSDERC20.java | 11 -------- .../META-INF/services/bisq.asset.Asset | 3 --- .../core/provider/price/PriceProvider.java | 26 +------------------ 5 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 assets/src/main/java/bisq/asset/coins/TetherUSDLiquid.java delete mode 100644 assets/src/main/java/bisq/asset/coins/TetherUSDOmni.java delete mode 100644 assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java diff --git a/assets/src/main/java/bisq/asset/coins/TetherUSDLiquid.java b/assets/src/main/java/bisq/asset/coins/TetherUSDLiquid.java deleted file mode 100644 index 931c98f892..0000000000 --- a/assets/src/main/java/bisq/asset/coins/TetherUSDLiquid.java +++ /dev/null @@ -1,12 +0,0 @@ -package bisq.asset.coins; - -import bisq.asset.Coin; -import bisq.asset.LiquidBitcoinAddressValidator; - -public class TetherUSDLiquid extends Coin { - public TetherUSDLiquid() { - // If you add a new USDT variant or want to change this ticker symbol you should also look here: - // core/src/main/java/bisq/core/provider/price/PriceProvider.java:getAll() - super("Tether USD (Liquid)", "L-USDT", new LiquidBitcoinAddressValidator()); - } -} diff --git a/assets/src/main/java/bisq/asset/coins/TetherUSDOmni.java b/assets/src/main/java/bisq/asset/coins/TetherUSDOmni.java deleted file mode 100644 index b0ab624d71..0000000000 --- a/assets/src/main/java/bisq/asset/coins/TetherUSDOmni.java +++ /dev/null @@ -1,12 +0,0 @@ -package bisq.asset.coins; - -import bisq.asset.Base58BitcoinAddressValidator; -import bisq.asset.Coin; - -public class TetherUSDOmni extends Coin { - public TetherUSDOmni() { - // If you add a new USDT variant or want to change this ticker symbol you should also look here: - // core/src/main/java/bisq/core/provider/price/PriceProvider.java:getAll() - super("Tether USD (Omni)", "USDT-O", new Base58BitcoinAddressValidator()); - } -} diff --git a/assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java b/assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java deleted file mode 100644 index cb57361a1f..0000000000 --- a/assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java +++ /dev/null @@ -1,11 +0,0 @@ -package bisq.asset.tokens; - -import bisq.asset.Erc20Token; - -public class TetherUSDERC20 extends Erc20Token { - public TetherUSDERC20() { - // If you add a new USDT variant or want to change this ticker symbol you should also look here: - // core/src/main/java/bisq/core/provider/price/PriceProvider.java:getAll() - super("Tether USD (ERC20)", "USDT-E"); - } -} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index a2f77816d6..80a6168463 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -104,8 +104,6 @@ bisq.asset.coins.Spectrecoin bisq.asset.coins.Starwels bisq.asset.coins.SUB1X bisq.asset.coins.TEO -bisq.asset.coins.TetherUSDLiquid -bisq.asset.coins.TetherUSDOmni bisq.asset.coins.TurtleCoin bisq.asset.coins.UnitedCommunityCoin bisq.asset.coins.Unobtanium @@ -125,7 +123,6 @@ bisq.asset.coins.ZeroClassic bisq.asset.tokens.AugmintEuro bisq.asset.tokens.DaiStablecoin bisq.asset.tokens.EtherStone -bisq.asset.tokens.TetherUSDERC20 bisq.asset.tokens.TrueUSD bisq.asset.tokens.USDCoin bisq.asset.tokens.VectorspaceAI diff --git a/core/src/main/java/bisq/core/provider/price/PriceProvider.java b/core/src/main/java/bisq/core/provider/price/PriceProvider.java index bc29ecc382..d0ac27c2d7 100644 --- a/core/src/main/java/bisq/core/provider/price/PriceProvider.java +++ b/core/src/main/java/bisq/core/provider/price/PriceProvider.java @@ -70,24 +70,7 @@ public class PriceProvider extends HttpClientProvider { final double price = (Double) treeMap.get("price"); // json uses double for our timestampSec long value... final long timestampSec = MathUtils.doubleToLong((Double) treeMap.get("timestampSec")); - - // We do not have support for the case of multiChain assets where a common price ticker used for - // different flavours of the asset. It would be quite a bit of effort to add generic support to the - // asset and tradeCurrency classes and to handle it correctly from their many client classes. - // So we decided to hack in the sub-assets as copies of the price and accept the annoyance to see - // 3 different prices for the same master asset. But who knows, maybe prices will differ over time for - // the sub assets so then we are better prepared that way... - if (currencyCode.equals("USDT")) { - addPrice(marketPriceMap, "USDT-O", price, timestampSec); - addPrice(marketPriceMap, "USDT-E", price, timestampSec); - addPrice(marketPriceMap, "L-USDT", price, timestampSec); - } else { - // NON_EXISTING_SYMBOL is returned from service for nto found items - // Sometimes it has post fixes as well so we use a 'contains' check. - if (!currencyCode.contains("NON_EXISTING_SYMBOL")) { - addPrice(marketPriceMap, currencyCode, price, timestampSec); - } - } + marketPriceMap.put(currencyCode, new MarketPrice(currencyCode, price, timestampSec, true)); } catch (Throwable t) { log.error(t.toString()); t.printStackTrace(); @@ -97,13 +80,6 @@ public class PriceProvider extends HttpClientProvider { return new Tuple2<>(tsMap, marketPriceMap); } - private void addPrice(Map marketPriceMap, - String currencyCode, - double price, - long timestampSec) { - marketPriceMap.put(currencyCode, new MarketPrice(currencyCode, price, timestampSec, true)); - } - public String getBaseUrl() { return httpClient.getBaseUrl(); }