diff --git a/app/lib/models/market_data.dart b/app/lib/models/market_data.dart index c82fdf45..ff114535 100644 --- a/app/lib/models/market_data.dart +++ b/app/lib/models/market_data.dart @@ -1,18 +1,14 @@ class TftMarketData { final double lastPrice; final double lastUsdPrice; - final double change24h; final double high24h; final double low24h; - final double volume24h; TftMarketData({ required this.lastPrice, required this.lastUsdPrice, - required this.change24h, required this.high24h, required this.low24h, - required this.volume24h, }); factory TftMarketData.fromTrades(List trades) { @@ -25,30 +21,19 @@ class TftMarketData { double high24h = lastUsdcPrice; double low24h = lastUsdcPrice; - double volume24h = 0; - - final oldestTrade = trades.last; - final double oldestUsdcPrice = double.parse(oldestTrade['base_amount']) / - double.parse(oldestTrade['counter_amount']); for (var trade in trades) { double usdcPrice = double.parse(trade['base_amount']) / double.parse(trade['counter_amount']); high24h = usdcPrice > high24h ? usdcPrice : high24h; low24h = usdcPrice < low24h ? usdcPrice : low24h; - volume24h += double.parse(trade['counter_amount']); } - final double change24h = - ((lastUsdcPrice - oldestUsdcPrice) / oldestUsdcPrice) * 100; - return TftMarketData( lastPrice: 1 / lastPrice, lastUsdPrice: lastUsdcPrice, - change24h: change24h, high24h: high24h, low24h: low24h, - volume24h: volume24h / 1000, ); } @@ -56,10 +41,8 @@ class TftMarketData { return TftMarketData( lastPrice: 0, lastUsdPrice: 0, - change24h: 0, high24h: 0, low24h: 0, - volume24h: 0, ); } } diff --git a/app/lib/screens/market/overview.dart b/app/lib/screens/market/overview.dart index 697dba7d..16bacb44 100644 --- a/app/lib/screens/market/overview.dart +++ b/app/lib/screens/market/overview.dart @@ -440,8 +440,6 @@ class _OverviewWidgetState extends ConsumerState { '${marketData!.lastPrice.toStringAsFixed(7)} USDC'), _buildMarketColumn('Last USD Price', '\$${marketData!.lastUsdPrice.toStringAsFixed(7)}'), - _buildMarketColumn('24H Change', - '${marketData!.change24h.toStringAsFixed(7)}%'), ], ), ), @@ -455,8 +453,6 @@ class _OverviewWidgetState extends ConsumerState { '${marketData!.high24h.toStringAsFixed(7)} USDC'), _buildMarketColumn('24H Low', '${marketData!.low24h.toStringAsFixed(7)} USDC'), - _buildMarketColumn('24H Volume', - '${marketData!.volume24h.toStringAsFixed(7)}K USDC'), ], ), ),