Remove never traded coins

This commit is contained in:
Manfred Karrer 2017-09-17 13:10:34 -05:00
parent 02b9d9153f
commit 7c45fb78cc
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
2 changed files with 58 additions and 107 deletions

View File

@ -86,149 +86,57 @@ public class CurrencyUtil {
public static List<CryptoCurrency> createAllSortedCryptoCurrenciesList() {
final List<CryptoCurrency> result = new ArrayList<>();
result.add(new CryptoCurrency("AIB", "Advanced Internet Blocks"));
result.add(new CryptoCurrency("ANC", "Anoncoin"));
result.add(new CryptoCurrency("ANTI", "Anti"));
result.add(new CryptoCurrency("ARCO", "AquariusCoin"));
result.add(new CryptoCurrency("ARG", "Argentum"));
result.add(new CryptoCurrency("REP", "Augur", true));
result.add(new CryptoCurrency("BATL", "Battlestars"));
result.add(new CryptoCurrency("BIGUP", "BigUp"));
// result.add(new CryptoCurrency("BSQ", "Bisq Token"));
if (!baseCurrencyCode.equals("BTC"))
result.add(new CryptoCurrency("BTC", "Bitcoin"));
result.add(new CryptoCurrency("BITAUD", "BitAUD", true));
result.add(new CryptoCurrency("BITCHF", "BitCHF", true));
result.add(new CryptoCurrency("BITCNY", "BitCNY", true));
result.add(new CryptoCurrency("BITEUR", "BitEUR", true));
result.add(new CryptoCurrency("BITGBP", "BitGBP", true));
result.add(new CryptoCurrency("BITHKD", "BitHKD", true));
result.add(new CryptoCurrency("BITNZD", "BitNZD", true));
result.add(new CryptoCurrency("BITSEK", "BitSEK", true));
result.add(new CryptoCurrency("BITSGD", "BitSGD", true));
result.add(new CryptoCurrency("SYNQ", "BitSYNQ"));
result.add(new CryptoCurrency("BTS", "BitShares"));
result.add(new CryptoCurrency("BITUSD", "BitUSD", true));
result.add(new CryptoCurrency("BLK", "Blackcoin"));
result.add(new CryptoCurrency("BURST", "Burstcoin"));
result.add(new CryptoCurrency("GBYTE", "Byte"));
result.add(new CryptoCurrency("CLAM", "Clams"));
result.add(new CryptoCurrency("CLOAK", "CloakCoin"));
result.add(new CryptoCurrency("CMT", "Comet"));
result.add(new CryptoCurrency("XCP", "Counterparty"));
result.add(new CryptoCurrency("CRBIT", "Creditbit"));
result.add(new CryptoCurrency("CRW", "Crown"));
result.add(new CryptoCurrency("CBX", "Crypto Bullion"));
result.add(new CryptoCurrency("DNET", "DarkNet"));
result.add(new CryptoCurrency("DIBC", "DIBCOIN"));
if (!baseCurrencyCode.equals("DASH"))
result.add(new CryptoCurrency("DASH", "Dash"));
result.add(new CryptoCurrency("DCR", "Decred"));
result.add(new CryptoCurrency("DGB", "Digibyte"));
result.add(new CryptoCurrency("DRS", "Digital Rupees"));
result.add(new CryptoCurrency("DGD", "DigixDAO Tokens", true));
if (!baseCurrencyCode.equals("DOGE"))
result.add(new CryptoCurrency("DOGE", "Dogecoin"));
result.add(new CryptoCurrency("DMC", "DynamicCoin"));
result.add(new CryptoCurrency("EMC", "Emercoin"));
result.add(new CryptoCurrency("EURT", "EUR Tether"));
result.add(new CryptoCurrency("ESP", "Espers"));
result.add(new CryptoCurrency("ENT", "Eternity"));
result.add(new CryptoCurrency("ETH", "Ether"));
result.add(new CryptoCurrency("ETC", "Ether Classic"));
result.add(new CryptoCurrency("ERC", "Europecoin"));
result.add(new CryptoCurrency("EGC", "EverGreenCoin"));
result.add(new CryptoCurrency("EOS", "EOS", true));
result.add(new CryptoCurrency("FCT", "Factom"));
result.add(new CryptoCurrency("FAIR", "FairCoin"));
result.add(new CryptoCurrency("FLO", "FlorinCoin"));
//TODO ticker?
//result.add(new CryptoCurrency("FILE", "Filecoin", true));
result.add(new CryptoCurrency("GAME", "GameCredits"));
result.add(new CryptoCurrency("GEMZ", "Gemz"));
result.add(new CryptoCurrency("GRC", "Gridcoin"));
result.add(new CryptoCurrency("GRS", "Groestlcoin"));
result.add(new CryptoCurrency("NLG", "Gulden"));
result.add(new CryptoCurrency("HODL", "HOdlcoin"));
result.add(new CryptoCurrency("HNC", "HunCoin"));
result.add(new CryptoCurrency("IOC", "I/O Coin"));
result.add(new CryptoCurrency("IOTA", "IOTA", true));
result.add(new CryptoCurrency("IOP", "Fermat"));
result.add(new CryptoCurrency("JNS", "Janus", true));
result.add(new CryptoCurrency("JPYT", "JPY Tether"));
result.add(new CryptoCurrency("JBS", "Jumbucks"));
result.add(new CryptoCurrency("GRC", "Gridcoin"));
result.add(new CryptoCurrency("LBC", "LBRY Credits"));
result.add(new CryptoCurrency("LTBC", "LTBcoin"));
result.add(new CryptoCurrency("LSK", "Lisk"));
if (!baseCurrencyCode.equals("LTC"))
result.add(new CryptoCurrency("LTC", "Litecoin"));
result.add(new CryptoCurrency("MAID", "MaidSafeCoin"));
result.add(new CryptoCurrency("MKR", "Maker", true));
result.add(new CryptoCurrency("MXT", "MarteXcoin"));
result.add(new CryptoCurrency("MOIN", "Moin"));
result.add(new CryptoCurrency("XMR", "Monero"));
result.add(new CryptoCurrency("MT", "Mycelium Token", true));
result.add(new CryptoCurrency("XMY", "Myriadcoin"));
result.add(new CryptoCurrency("NAV", "Nav Coin"));
result.add(new CryptoCurrency("XEM", "NEM"));
result.add(new CryptoCurrency("NEVA", "Nevacoin"));
result.add(new CryptoCurrency("NMC", "Namecoin"));
result.add(new CryptoCurrency("NBT", "NuBits"));
result.add(new CryptoCurrency("NSR", "NuShares"));
result.add(new CryptoCurrency("NXT", "Nxt"));
result.add(new CryptoCurrency("888", "OctoCoin"));
result.add(new CryptoCurrency("OK", "OKCash"));
result.add(new CryptoCurrency("OMNI", "Omni"));
result.add(new CryptoCurrency("OPAL", "Opal"));
result.add(new CryptoCurrency("PART", "Particl"));
result.add(new CryptoCurrency("PASC", "Pascal Coin", true));
result.add(new CryptoCurrency("PPC", "Peercoin"));
result.add(new CryptoCurrency("PEPECASH", "Pepe Cash"));
result.add(new CryptoCurrency("PINK", "Pinkcoin"));
result.add(new CryptoCurrency("PIVX", "PIVX"));
result.add(new CryptoCurrency("XPTX", "PlatinumBar"));
result.add(new CryptoCurrency("PLU", "Plutons", true));
result.add(new CryptoCurrency("POST", "PostCoin"));
result.add(new CryptoCurrency("POT", "PotCoin"));
result.add(new CryptoCurrency("XPM", "Primecoin"));
result.add(new CryptoCurrency("RADS", "Radium"));
result.add(new CryptoCurrency("REALEST", "RealEst. Coin"));
result.add(new CryptoCurrency("PNC", "Pranacoin"));
result.add(new CryptoCurrency("RDD", "ReddCoin"));
result.add(new CryptoCurrency("XRP", "Ripple"));
result.add(new CryptoCurrency("SFSC", "Safe FileSystem Coin"));
result.add(new CryptoCurrency("SHIFT", "Shift"));
result.add(new CryptoCurrency("SC", "Siacoin"));
result.add(new CryptoCurrency("SF", "Siafund"));
result.add(new CryptoCurrency("SIB", "Sibcoin"));
result.add(new CryptoCurrency("SMLY", "Smileycoin"));
result.add(new CryptoCurrency("SLR", "SolarCoin"));
result.add(new CryptoCurrency("STEEM", "STEEM"));
result.add(new CryptoCurrency("STEEMUSD", "Steem Dollars", true));
result.add(new CryptoCurrency("XLM", "Stellar Lumens"));
result.add(new CryptoCurrency("SJCX", "StorjcoinX"));
result.add(new CryptoCurrency("STRAT", "Stratis"));
result.add(new CryptoCurrency("SWT", "Swarm City Token", true));
result.add(new CryptoCurrency("SYNX", "Syndicate"));
result.add(new CryptoCurrency("AMP", "Synereo", true));
result.add(new CryptoCurrency("TRI", "Triangles"));
result.add(new CryptoCurrency("USDT", "USD Tether"));
result.add(new CryptoCurrency("UNO", "Unobtanium"));
result.add(new CryptoCurrency("VCN", "VCoin"));
result.add(new CryptoCurrency("VPN", "VPNCoin"));
result.add(new CryptoCurrency("XVG", "Verge"));
result.add(new CryptoCurrency("VRC", "VeriCoin"));
result.add(new CryptoCurrency("WDC", "Worldcoin"));
result.add(new CryptoCurrency("WAVES", "Waves"));
result.add(new CryptoCurrency("XAUR", "Xaurum"));
result.add(new CryptoCurrency("YACC", "YACCoin"));
result.add(new CryptoCurrency("YBC", "YbCoin"));
result.add(new CryptoCurrency("WAC", "WACoins"));
result.add(new CryptoCurrency("ZEC", "Zcash"));
result.add(new CryptoCurrency("XZC", "Zcoin"));
result.add(new CryptoCurrency("ZEN", "ZenCash"));
result.sort(TradeCurrency::compareTo);
// Util for printing all altcoins for adding to FAQ page
/*
StringBuilder sb = new StringBuilder();
result.stream().forEach(e -> sb.append("<li>\"")
.append(e.getCode())
@ -237,7 +145,7 @@ public class CurrencyUtil {
.append("\"</li>")
.append("\n"));
log.info(sb.toString());
*/
return result;
}

View File

@ -133,7 +133,7 @@ public class TradeStatisticsManager implements PersistedDataHost {
dump();
// print all currencies sorted by nr. of trades
// printAllCurrencyStats();
printAllCurrencyStats();
}
@ -186,7 +186,7 @@ public class TradeStatisticsManager implements PersistedDataHost {
}
}
StringBuilder sb1 = new StringBuilder();
StringBuilder sb1 = new StringBuilder("\nAll traded Fiat currencies:\n");
map1.entrySet().stream()
.sorted((o1, o2) -> Integer.valueOf(o2.getValue().size()).compareTo(o1.getValue().size()))
.forEach(e -> sb1.append(e.getKey()).append(": ").append(e.getValue().size()).append("\n"));
@ -194,19 +194,62 @@ public class TradeStatisticsManager implements PersistedDataHost {
Map<String, Set<TradeStatistics>> map2 = new HashMap<>();
for (TradeStatistics tradeStatistics : tradeStatisticsSet) {
if (CurrencyUtil.isCryptoCurrency(tradeStatistics.getCounterCurrency())) {
final String counterCurrency = CurrencyUtil.getNameAndCode(tradeStatistics.getCounterCurrency());
if (!map2.containsKey(counterCurrency))
map2.put(counterCurrency, new HashSet<>());
if (CurrencyUtil.isCryptoCurrency(tradeStatistics.getBaseCurrency())) {
final String code = CurrencyUtil.getNameAndCode(tradeStatistics.getBaseCurrency());
if (!map2.containsKey(code))
map2.put(code, new HashSet<>());
map2.get(counterCurrency).add(tradeStatistics);
map2.get(code).add(tradeStatistics);
}
}
StringBuilder sb2 = new StringBuilder();
List<String> allCryptoCurrencies = new ArrayList<>();
Set<String> coinsWithValidator = new HashSet<>();
coinsWithValidator.add("BTC");
coinsWithValidator.add("LTC");
coinsWithValidator.add("DOGE");
coinsWithValidator.add("DASH");
coinsWithValidator.add("ETH");
coinsWithValidator.add("PIVX");
coinsWithValidator.add("IOP");
coinsWithValidator.add("888");
coinsWithValidator.add("ZEC");
coinsWithValidator.add("GBYTE");
coinsWithValidator.add("NXT");
coinsWithValidator.add("PNC");
coinsWithValidator.add("ZEN");
coinsWithValidator.add("WAC");
Set<String> newlyAdded = new HashSet<>();
newlyAdded.add("PNC");
newlyAdded.add("WAC");
newlyAdded.add("ZEN");
CurrencyUtil.getAllSortedCryptoCurrencies().stream()
.forEach(e -> allCryptoCurrencies.add(e.getNameAndCode()));
StringBuilder sb2 = new StringBuilder("\nAll traded Crypto currencies:\n");
StringBuilder sb3 = new StringBuilder("\nNever traded Crypto currencies:\n");
map2.entrySet().stream()
.sorted((o1, o2) -> Integer.valueOf(o2.getValue().size()).compareTo(o1.getValue().size()))
.forEach(e -> sb2.append(e.getKey()).append(": ").append(e.getValue().size()).append("\n"));
.forEach(e -> {
final String key = e.getKey();
sb2.append(key).append(": ").append(e.getValue().size()).append("\n");
// key is: USD Tether (USDT)
String code = key.substring(key.indexOf("(")+1, key.length() - 1);
if (!coinsWithValidator.contains(code) && !newlyAdded.contains(code))
allCryptoCurrencies.remove(key);
});
log.error(sb2.toString());
// Not considered age of newly added coins, so take care with removal if coin was added recently.
allCryptoCurrencies.sort(String::compareTo);
allCryptoCurrencies.stream()
.forEach(e -> {
// key is: USD Tether (USDT)
String code = e.substring(e.indexOf("(") + 1, e.length() - 1);
if (!coinsWithValidator.contains(code) && !newlyAdded.contains(code))
sb3.append(e).append("\n");
});
log.error(sb3.toString());
}
}