public decimal ToUsdVolume(CurrencyToken currencyToken) { if (currencyToken.CurrencyType == CurrencyType.Fiat) { throw new ArgumentException("MarketCap only accepts crypto currencies."); } var currency = currencyService.GetByTicker(currencyToken.Ticker); var info = coinMarketCapClient.Ticker(currency.CoinMarketCapId); return(info.Volume); }
private decimal ConvertCryptoToUSD(Currency currency) { var ticker = coinmarkcapClient.Ticker(currency.Type.CoinMarketCapId); return(currency.Amount * ticker.Price_usd); }