Exemplo n.º 1
0
        public void BitcoinType_AllTickets()
        {
            var cmc     = new CoinMarketCap();
            var tickets = cmc.GetAllTickets();

            Assert.AreNotSame(tickets.Count, 0);
        }
Exemplo n.º 2
0
        public void BitcoinType_OneTicket()
        {
            var cmc    = new CoinMarketCap();
            var ticket = cmc.GetTicket(CurrencyTypeEnum.bitcoin);

            Assert.AreEqual(ticket.id, CurrencyTypeEnum.bitcoin.ToString());
        }
Exemplo n.º 3
0
        public async Task Test1()
        {
            var api  = new CoinMarketCap("e80d5567-c5cc-473c-8453-6b3cfcd35be0");
            var json = await api.LatestListings();

            Assert.NotNull(json);
        }
Exemplo n.º 4
0
        public async Task Test2()
        {
            var coinMarketCap = new CoinMarketCap("ea5b3852-d1fe-4f41-b6dc-0919836cf5d3");
            var json          = await coinMarketCap.LatestListings();

            Assert.NotNull(json);
        }
Exemplo n.º 5
0
        public ActionResult Index()
        {
            var model = new Models.viewModel();

            model.arz     = ArzPrice.GetArzs();
            model.digital = CoinMarketCap.GetResualt();
            return(View(model));
        }
Exemplo n.º 6
0
        private void UpdateBTCList()
        {
            if (symbol.Length > 0 && market.Length > 0)
            {
                List <ExchangeManager.ExchangeTicker> list = ExchangeManager.GetPriceWatchlist("BTC", symbol);

                if (list.Count > 0)
                {
                    toolStrip_btc_btc.Visible    = true;
                    toolStrip_btc_usd.Visible    = true;
                    toolStrip_btc_symbol.Visible = true;

                    Decimal high = 0;
                    Decimal low  = 0;

                    high = list[0].last;

                    foreach (ExchangeManager.ExchangeTicker ticker in list)
                    {
                        if (ticker.last > 0)
                        {
                            low = ticker.last;
                        }
                    }

                    Decimal spread = high - low;

                    toolStripLabel_btc_symbol.Text = CoinMarketCap.GetMarketCapBTCAmount(symbol, spread).ToString("N8");

                    if (listView_btc.Items.Count > 0)
                    {
                        //listView_btc.RefreshObjects(list);
                        listView_btc.BuildList();
                        //listView_btc.UpdateObjects(iEnumerable);
                    }
                    else
                    {
                        listView_btc.SetObjects(list);
                    }
                    //LogManager.AddLogMessage(Name, "UpdateUI", "symbol=" + symbol + " | " + market + " | " + high + " | " + low + " | " + spread);
                    toolStripLabel_btc_usd.Text = CoinMarketCap.GetMarketCapUSDAmount("BTC", spread).ToString("C");
                    toolStripLabel_btc_btc.Text = spread.ToString("N8");
                    toolStripLabel_symbol.Text  = CoinMarketCap.GetMarketCapCoinAmount(symbol, "BTC", spread).ToString("N8");
                }

                if (list.Sum(item => item.last) > 0)
                {
                    Enabled = true;
                }
                else
                {
                    Enabled = false;
                }
            }
        }
Exemplo n.º 7
0
        static async Task MainAsync(string[] args)
        {
            // set up a task completion source so we can quit on CTRL+C
            TaskCompletionSource <bool> exitSource = new TaskCompletionSource <bool>();

            Console.CancelKeyPress += (sender, eventArgs) =>
            {
                eventArgs.Cancel = true;
                exitSource.SetResult(true);
            };

            Log.Logger = new LoggerConfiguration()
                         .Enrich.FromLogContext()
                         .WriteTo.Console()
                         .CreateLogger();

            // set up an ILogger
            ILoggerFactory loggerFactory = new LoggerFactory().AddSerilog();

            Microsoft.Extensions.Logging.ILogger logger = loggerFactory.CreateLogger("CoinBot");

            // set up the CoinMarketCap source
            ICoinSource coinSource = new CoinMarketCap(logger);

            coinSource.Start();

            // Create our DI container
            ServiceCollection serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton(coinSource);
            serviceCollection.AddSingleton(logger);
            IServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();

            // create the discord bot and start it
            string jsonFile = args.Length > 0 ? args[0] : "token.json";

            DiscordBot bot = new DiscordBot(DiscordBotToken.Load(jsonFile), serviceProvider, logger);
            await bot.Start();

            //wait for CTRL+C
            await exitSource.Task;

            // stop the discord bot
            await bot.Stop();

            // stop the source
            coinSource.Stop();
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var coins = new ObservableCollection <CoinMarketCap>();
            var token = JToken.Load(reader);

            if (token.Type != JTokenType.Array)
            {
                throw new JsonSerializationException("Unexpected token type: " + token.Type.ToString());
            }

            foreach (var element in token)
            {
                var jo   = JObject.Parse(element.ToString());
                var coin = new CoinMarketCap
                {
                    Id              = (string)jo[Keys.CoinKey.id],
                    Name            = (string)jo[Keys.CoinKey.name],
                    Symbol          = (string)jo[Keys.CoinKey.symbol],
                    Rank            = (int)jo[Keys.CoinKey.rank],
                    PriceUsd        = (decimal)jo[Keys.CoinKey.price_usd],
                    PriceBtc        = (decimal)jo[Keys.CoinKey.price_btc],
                    HVolume24       = (decimal)jo[Keys.CoinKey.twentfourh_volume_usd],
                    MarketCapUsd    = (decimal)jo[Keys.CoinKey.market_cap_usd],
                    AvailableSupply = (decimal)jo[Keys.CoinKey.available_supply],
                    TotalSupply     = (decimal)jo[Keys.CoinKey.total_supply],
                    //MarketCapUsd = Convert.ToInt64((decimal)jo[Keys.CoinKey.market_cap_usd]),
                    //AvailableSupply = Convert.ToInt64((decimal)jo[Keys.CoinKey.available_supply]),
                    //TotalSupply = Convert.ToInt64((decimal)jo[Keys.CoinKey.total_supply]),
                    //MaxSupply = jo[Keys.CoinKey.max_supply] == null ? null : Convert.ToInt64((decimal?)jo[Keys.CoinKey.max_supply]),
                    PercentChange1H  = (decimal)jo[Keys.CoinKey.percent_change_1h],
                    PercentChange24H = (decimal)jo[Keys.CoinKey.percent_change_24h],
                    PercentChange7D  = (decimal)jo[Keys.CoinKey.percent_change_7d],
                    LastUpdated      = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds((int)jo[Keys.CoinKey.last_updated])
                };
                //weird
                //https://stackoverflow.com/questions/6137974/no-implicit-conversion-when-using-conditional-operator
                if (jo[Keys.CoinKey.max_supply] != null)
                {
                    coin.MaxSupply = (decimal?)jo[Keys.CoinKey.max_supply];
                }
                coins.Add(coin);
            }

            return(coins);
        }
Exemplo n.º 9
0
        public async Task Crypto([Remainder] string symbols)
        {
            symbols = symbols.ToUpper();
            string[] Symbols = symbols.ToUpper().Split(',');
            string   msg     = "";
            Dictionary <string, CoinMarketCap.Currency> currencies = CoinMarketCap.GetTokens(symbols);

            for (int i = 0; i < Symbols.Length; i++)
            {
                if (i > 0)
                {
                    msg += "\n";
                }
                msg += "\n**Name:** " + currencies[Symbols[i]].name;
                msg += "\n**Symbol:** " + currencies[Symbols[i]].symbol;
                double price       = currencies[Symbols[i]].quote.USD.price;
                string priceString = string.Format("${0:N2}", price);
                if (price <= 1.99)
                {
                    priceString = string.Format("${0:N6}", price);
                }
                else if (price <= 9.99)
                {
                    priceString = string.Format("${0:N3}", price);
                }
                msg += "\n**Rank:** " + string.Format("{0}", currencies[Symbols[i]].cmc_rank);
                msg += "\n**USD Price:** " + priceString;
                msg += "\n**Market Cap:** " + string.Format("${0:N2}", currencies[Symbols[i]].quote.USD.market_cap);
                msg += "\n**Volume 24h:** " + string.Format("${0:N2}", currencies[Symbols[i]].quote.USD.volume_24h);
                msg += "\n**1h Change:** " + string.Format("{0:N2}%", currencies[Symbols[i]].quote.USD.percent_change_1h);
                msg += "\n**24h Change:** " + string.Format("{0:N2}%", currencies[Symbols[i]].quote.USD.percent_change_24h);
                msg += "\n**7d Change:** " + string.Format("{0:N2}%", currencies[Symbols[i]].quote.USD.percent_change_7d);
                msg += "\n**Circulating Supply:** " + string.Format("{0:N0}", currencies[Symbols[i]].circulating_supply);
                string max_supply = "None";
                if (currencies[Symbols[i]].max_supply != null)
                {
                    max_supply = "" + currencies[Symbols[i]].max_supply;
                }
                msg += "\n**Max Supply:** " + max_supply;
            }
            await PrintEmbedMessage("Cyptocurrency " + symbols, msg);
        }
        // Prime Weighted Index
        private float MarketCapAnalysis()
        {
            var tickers  = CoinMarketCap.GetTickers(50);
            var elements = from t in tickers
                           select(long) float.Parse(t.market_cap_usd);

            long marketCapSum = elements.Sum();

            var   mcPercentage = new Dictionary <string, float>();
            float indexValue   = 0.0f;

            foreach (var t in tickers)
            {
                long mc = (long)float.Parse(t.market_cap_usd);
                mcPercentage[t.symbol] = mc / (float)marketCapSum;
                float contribution = mcPercentage[t.symbol] * float.Parse(t.price_usd);
                indexValue += contribution;
                dout("{0,-5} ({1,5:0.00}%)  index_value:${2,15:n0}  market_cap:${3,15:n0}  price:${4,8:0.00}  contribution_to_index:${5,8:0.00}", t.symbol, mcPercentage[t.symbol] * 100, marketCapSum, (long)float.Parse(t.market_cap_usd), float.Parse(t.price_usd), contribution);
            }
            dout("TOTAL INDEX VALUE: $ {0:0.00}", indexValue);
            return(indexValue);
        }
Exemplo n.º 11
0
        private static string AdditionInfoFromCoinMarketCap(Balance balance, CurrencyTypeEnum currency)
        {
            var cmc        = new CoinMarketCap(currency);
            var tickets    = cmc.GetAllTickets();
            var ticketCurr = tickets.FirstOrDefault(t => t.id == currency.ToString());

            if (ticketCurr != null)
            {
                balance.VolumeUsd = ticketCurr.price_usd * balance.Volume;
            }
            var result = balance.Date.ToString("f");

            result += Environment.NewLine + balance;
            if (balance.VolumeUsd != null)
            {
                result += $" ({balance.VolumeUsd.Value.ToString("N4")}$)" + Environment.NewLine;
            }
            foreach (var itemTicket in tickets.Select(t => Environment.NewLine + t.name + "\t\t" + t.price_usd))
            {
                result += itemTicket;
            }

            return(result);
        }
Exemplo n.º 12
0
        public bool UpdateUI(bool resize = false)
        {
            if (InvokeRequired)
            {
                UpdateUICallback d = new UpdateUICallback(UpdateUI);
                Invoke(d, new object[] { resize });
            }
            else
            {
                List <ExchangeManager.Exchange> list;
                //List<ExchangeManager.Exchange> list = ExchangeManager.Exchanges.Where(item => item.Active).ToList();

                if (preferences.ShowOnlyAPIExchanges)
                {
                    list = ExchangeManager.Exchanges.Where(item => item.Active && item.HasAPI == true).ToList();
                }
                else
                {
                    list = ExchangeManager.Exchanges.Where(item => item.Active).ToList();
                }

                // HEADER
                toolStripLabel_Exchanges.Text = list.Count + " Exchanges";

                Decimal orderBTC    = list.Sum(exchange => exchange.BalanceList.Sum(balance => balance.TotalInBTCOrders));
                Decimal orderUSD    = CoinMarketCap.getUSDValue("BTC", orderBTC);
                string  orderString = "Orders : " + orderBTC.ToString("N8") + " (" + orderUSD.ToString("C") + ")";
                toolStripButton_OrderTotals.Text = orderString;

                Decimal totalBTC = list.Sum(exchange => exchange.BalanceList.Sum(balance => balance.TotalInBTC));
                Decimal totalUSD = list.Sum(exchange => exchange.BalanceList.Sum(balance => balance.TotalInUSD));
                toolStripButton_Totals.Text = "Totals : " + totalBTC.ToString("N8") + " (" + totalUSD.ToString("C") + ")";


                // LIST
                listView.SetObjects(list);
                listView.Sort(column_TotalInBTC, SortOrder.Descending);

                toolStripButton_API.Image = ContentManager.GetActiveIcon(!preferences.ShowOnlyAPIExchanges);
                // TIMERS
                toolStripButton_Tickers.Checked     = (preferences.TimerFlags & ExchangeManager.ExchangeTimerType.TICKERS) != ExchangeManager.ExchangeTimerType.NONE;
                toolStripButton_Tickers.ToolTipText = "TICKERS (" + ExchangeManager.Tickers.Count + ")";
                toolStripButton_Tickers.Image       = ContentManager.GetActiveIcon(toolStripButton_Tickers.Checked);

                toolStripButton_Balances.Checked     = (preferences.TimerFlags & ExchangeManager.ExchangeTimerType.BALANCES) != ExchangeManager.ExchangeTimerType.NONE;
                toolStripButton_Balances.ToolTipText = "BALANCES (" + ExchangeManager.Balances.Count + ")";
                toolStripButton_Balances.Image       = ContentManager.GetActiveIcon(toolStripButton_Balances.Checked);

                toolStripButton_Orders.Checked = (preferences.TimerFlags & ExchangeManager.ExchangeTimerType.ORDERS) != ExchangeManager.ExchangeTimerType.NONE;
                toolStripButton_Orders.Image   = ContentManager.GetActiveIcon(toolStripButton_Orders.Checked);

                toolStripButton_History.Checked = (preferences.TimerFlags & ExchangeManager.ExchangeTimerType.HISTORY) != ExchangeManager.ExchangeTimerType.NONE;
                toolStripButton_History.Image   = ContentManager.GetActiveIcon(toolStripButton_History.Checked);

                //LogManager.AddLogMessage(Name, "UpdateUI", "Orders : " + ExchangeManager.Orders.Count, LogManager.LogMessageType.DEBUG);

                if (resize)
                {
                    ResizeUI();
                }
            }
            return(true);
        }
Exemplo n.º 13
0
        public async Task EthTokens([Remainder] string address = null)
        {
            NanoPool.UserAccount account = NanoPool.GetUser(Context.User, address);
            string msg = "";

            if (account == null)
            {
                msg = "Account **" + address + "**\nNot Found! Please use linketh cmd or enter an address to link!";
                await PrintEmbedMessage("Account Retrieval Failed", msg);

                return;
            }
            if (address == null)
            {
                address = account.address;
            }
            List <EtherScan.Token> tokens = EtherScan.GetTokens(address);
            string symbols = "";
            int    count   = 0;

            foreach (EtherScan.Token token in tokens)
            {
                if (token.tokenSymbol != "" && !token.tokenName.ToLower().Contains("promo"))
                {
                    if (count == 1)
                    {
                        symbols += ",";
                        count    = 0;
                    }
                    symbols += token.tokenSymbol;
                    count++;
                }
            }

            Dictionary <string, CoinMarketCap.Currency> currencies = CoinMarketCap.GetTokens(symbols);

            count = 0;
            int num = 0;

            msg += "**Account:** " + address;
            double totalValue = 0;

            foreach (EtherScan.Token token in tokens)
            {
                int decPlace = 0;
                if (token.tokenDecimal != "0" && token.tokenDecimal != "")
                {
                    decPlace = int.Parse(token.tokenDecimal);
                }
                double div = 1;
                for (int i = 0; i < decPlace; i++)
                {
                    div *= 10d;
                }
                double balance = double.Parse(token.value) / div;
                if (currencies.ContainsKey(token.tokenSymbol))
                {
                    totalValue += currencies[token.tokenSymbol].quote.USD.price * balance;
                }
            }
            msg += string.Format("\n**Total Value:** ${0:N5}", totalValue);
            foreach (EtherScan.Token token in tokens)
            {
                int decPlace = 0;
                if (token.tokenDecimal != "0" && token.tokenDecimal != "")
                {
                    decPlace = int.Parse(token.tokenDecimal);
                }
                double div = 1;
                for (int i = 0; i < decPlace; i++)
                {
                    div *= 10d;
                }
                msg += "\n\n**Name:** " + token.tokenName;
                msg += "\n**Symbol:** " + token.tokenSymbol;
                double balance = double.Parse(token.value) / div;
                if (decPlace == 0)
                {
                    msg += "\n**Balance:** " + string.Format("{0:N0} " + token.tokenSymbol, balance);
                }
                if (decPlace == 8)
                {
                    msg += "\n**Balance:** " + string.Format("{0:N8} " + token.tokenSymbol, balance);
                }
                if (decPlace == 18)
                {
                    msg += "\n**Balance:** " + string.Format("{0:N15} " + token.tokenSymbol, balance);
                }
                if (currencies.ContainsKey(token.tokenSymbol))
                {
                    msg += string.Format("\n**USD Value:** ${0:N15}", currencies[token.tokenSymbol].quote.USD.price * balance);
                }
                msg += "\n**Date:** " + SteamAccounts.UnixTimeStampToDateTime(double.Parse(token.timeStamp));
                msg += "\n**Confirmations:** " + string.Format("{0:N0}", ulong.Parse(token.confirmations));
                if (count > 8)
                {
                    msg  += "|";
                    count = 0;
                }
                count++;
                num++;
            }
            string[] split = msg.Split('|');
            for (int i = 0; i < split.Length; i++)
            {
                await PrintEmbedMessage("ETH Tokens", split[i]);
            }


            //await Context.Channel.SendMessageAsync(msg);
        }
Exemplo n.º 14
0
        public async Task <ActionResult> About()
        {
            var model = CoinMarketCap.GetResualt();

            return(View(model));
        }
Exemplo n.º 15
0
 // Within this method, put any tasks that should be run periodically (i.e. daily)
 static void RunDaily()
 {
     CoinMarketCap.WriteToFile();            // output to a file the CoinMarketCap rankings and other data
 }
Exemplo n.º 16
0
        public async Task TopCrypto(int num = 0)
        {
            List <CoinMarketCap.Currency> currencies = CoinMarketCap.GetTop10();
            string msg   = "";
            int    count = 0;

            EmbedField[] fields = new EmbedField[(num == 0) ? 10 : num];
            foreach (CoinMarketCap.Currency currency in currencies)
            {
                msg += "\n\n__" + currency.name + "__";
                msg += "\n**Symbol:** " + currency.symbol;
                msg += "\n**Rank:** " + currency.cmc_rank;

                double price       = currency.quote.USD.price;
                string priceString = string.Format("${0:N2}", price);
                if (price <= 1.99)
                {
                    priceString = string.Format("${0:N6}", price);
                }
                else if (price <= 9.99)
                {
                    priceString = string.Format("${0:N3}", price);
                }
                msg += "\n**Price:** " + priceString;
                msg += "\n**Market Cap:** " + string.Format("${0:N2}", currency.quote.USD.market_cap);
                msg += "\n**Volume 24h:** " + string.Format("${0:N2}", currency.quote.USD.volume_24h);
                msg += "\n**Change 1h:** " + string.Format("{0:N2}%", currency.quote.USD.percent_change_1h);
                msg += "\n**Change 24h:** " + string.Format("{0:N2}%", currency.quote.USD.percent_change_24h);
                msg += "\n**Change 7d:** " + string.Format("{0:N2}%", currency.quote.USD.percent_change_7d);
                msg += "\n**Circulating Supply:** " + currency.circulating_supply;
                string max_supply = "None";
                if (currency.max_supply != null)
                {
                    max_supply = "" + currency.max_supply;
                }
                msg += "\n**Max Supply:** " + max_supply;
                if (num != 0)
                {
                    num--;
                    if (num <= 0)
                    {
                        break;
                    }
                }
                count++;
                if (count >= 6)
                {
                    msg  += "|";
                    count = 0;
                }
            }

            string[] split = msg.Split('|');
            for (int i = 0; i < split.Length; i++)
            {
                string title = "Top 10 Crypto";
                if (num != 0)
                {
                    title = "Top " + num + " Crypto";
                }
                await PrintEmbedMessage("Top Crypto", split[i]);
            }

            //await Context.Channel.SendMessageAsync(msg);
        }
Exemplo n.º 17
0
        static void Main(string[] args)
        {
            CoinMarketCap coinMarketCap = new CoinMarketCap();

            coinMarketCap.Scrape();
        }
 public async Task Add(CoinMarketCap coinMarketCap)
 {
     await _context.CoinMarketCapCollection.InsertOneAsync(coinMarketCap);
 }
Exemplo n.º 19
0
        public void UpdateUI(bool resize = false)
        {
            if (this.InvokeRequired)
            {
                UpdateUICallback d = new UpdateUICallback(UpdateUI);
                this.Invoke(d, new object[] { resize });
            }
            else
            {
                try
                {
                    List <ExchangeManager.ExchangeTicker> list = ExchangeManager.GetPriceWatchlist(market, symbol);
                    LogManager.AddLogMessage(Name, "UpdateUI", "count=" + list.Count, LogManager.LogMessageType.DEBUG);

                    if (list.Count > 0 && tableLayoutPanel.RowCount > 1)
                    {
                        int     rowIndex = 0;
                        Decimal high     = list[0].last;
                        Decimal low      = 0;

                        foreach (ExchangeManager.ExchangeTicker ticker in list)
                        {
                            Button button = tableLayoutPanel.GetControlFromPosition(0, rowIndex) as Button;
                            Label  label  = tableLayoutPanel.GetControlFromPosition(1, rowIndex) as Label;
                            //Control c = tableLayoutPanel.GetControlFromPosition(1, rowIndex);
                            //LogManager.AddLogMessage(Name, "UpdateUI", "Name=" + c.Name + " | " + c.GetType() + " | " + label.Text, LogManager.LogMessageType.DEBUG);
                            toolTip.SetToolTip(button, ticker.exchange);
                            button.Tag = ticker.exchange;
                            //button.

                            button.BackgroundImage = ContentManager.ResizeImage(ContentManager.GetExchangeIcon(ticker.exchange), iconSize, iconSize);

                            if (market.Contains("USD"))
                            {
                                //return e.last.ToString("C");
                                label.Text = ticker.last.ToString("C");
                            }
                            else
                            {
                                //return String.Format("{0:#,#.00000000}", e.last);
                                label.Text = ticker.last.ToString("N8");
                            }

                            if (ticker.last > 0)
                            {
                                low = ticker.last;
                            }
                            rowIndex++;
                        }
                        Decimal spread = high - low;

                        Label btcLabel = tableLayoutPanel.GetControlFromPosition(0, list.Count) as Label;
                        Label usdLabel = tableLayoutPanel.GetControlFromPosition(0, list.Count + 1) as Label;

                        if (market.Contains("USD"))
                        {
                            usdLabel.Text = spread.ToString("C");
                            btcLabel.Text = CoinMarketCap.GetMarketCapBTCAmount("BTC", spread).ToString("N8");
                        }
                        else
                        {
                            usdLabel.Text = CoinMarketCap.GetMarketCapUSDAmount("BTC", spread).ToString("C");
                            btcLabel.Text = spread.ToString("N8");
                        }
                    }

                    if (resize)
                    {
                        ResizeUI();
                    }
                }
                catch (Exception ex)
                {
                    LogManager.AddLogMessage(Name, "UpdateUI", ex.Message, LogManager.LogMessageType.EXCEPTION);
                }
            }
        }
Exemplo n.º 20
0
        public void UpdateUI(bool resize = false)
        {
            if (InvokeRequired)
            {
                UpdateUICallback d = new UpdateUICallback(UpdateUI);
                Invoke(d, new object[] { resize });
            }
            else
            {
                try
                {
                    if (symbol.Length > 0 && market.Length > 0)
                    {
                        List <ExchangeManager.ExchangeTicker> list = ExchangeManager.GetPriceWatchlist(market, symbol);

                        if (list.Count > 0)
                        {
                            toolStrip_btc.Visible    = true;
                            toolStrip_usd.Visible    = true;
                            toolStrip_symbol.Visible = true;

                            Decimal high = 0;
                            Decimal low  = 0;

                            high = list[0].last;

                            foreach (ExchangeManager.ExchangeTicker ticker in list)
                            {
                                if (ticker.last > 0)
                                {
                                    low = ticker.last;
                                }
                            }

                            Decimal spread = high - low;
                            listView.SetObjects(list);

                            /*
                             * if (list.Count > PreferenceManager.ArbitragePreferences.maxListCount)
                             * {
                             *  PreferenceManager.ArbitragePreferences.maxListCount = list.Count;
                             * }
                             */
                            //arbitrageItem.SetListCount(listView.Items.Count);

                            toolStripLabel_symbol.Text = CoinMarketCap.GetMarketCapBTCAmount(symbol, spread).ToString("N8");
                            //LogManager.AddLogMessage(Name, "UpdateUI", "symbol=" + symbol + " | " + market + " | " + high + " | " + low + " | " + spread);

                            if (market.Contains("USD"))
                            {
                                // SPREAD IS IN USD
                                //LogManager.AddLogMessage(Name, "UpdateUI", "SPREAD IN USD - symbol=" + symbol + " | " + market + " | " + high + " | " + low + " | " + spread);
                                toolStripLabel_usd.Text    = spread.ToString("C");
                                toolStripLabel_btc.Text    = CoinMarketCap.GetMarketCapBTCAmount("USDT", spread).ToString("N8");
                                toolStripLabel_symbol.Text = CoinMarketCap.GetMarketCapCoinAmount(symbol, "USDT", spread).ToString("N8");
                            }
                            else
                            {
                                // SPREAD IS IN BTC
                                //LogManager.AddLogMessage(Name, "UpdateUI", "SPREAD IN BTC - symbol=" + symbol + " | " + market + " | " + high + " | " + low + " | " + spread);
                                toolStripLabel_usd.Text    = CoinMarketCap.GetMarketCapUSDAmount("BTC", spread).ToString("C");
                                toolStripLabel_btc.Text    = spread.ToString("N8");
                                toolStripLabel_symbol.Text = CoinMarketCap.GetMarketCapCoinAmount(symbol, "BTC", spread).ToString("N8");
                            }
                        }

                        if (list.Sum(item => item.last) > 0)
                        {
                            Enabled = true;
                        }
                        else
                        {
                            Enabled = false;
                        }

                        if (resize)
                        {
                            ResizeUI();
                        }
                    }
                }
                catch (Exception)
                {
                    //LogManager.AddLogMessage(Name, "UpdateUI", symbol + " | " + market + " | " + ex.Message, LogManager.LogMessageType.EXCEPTION);
                }
            }
        }