@extends('nexus.layouts.app') @section('page-title', 'Markets') @section('sys-mode', 'MARKET ANALYTICS') @section('head') @endsection @section('content') @php $dateStart = $dates['start'] ?? now()->startOfMonth()->toDateString(); $dateEnd = $dates['end'] ?? now()->toDateString(); $isToday = $dateStart === now()->toDateString() && $dateEnd === now()->toDateString(); if ($isToday) { $periodSuffix = 'Today'; } elseif ($dateStart === now()->subDay()->toDateString() && $dateEnd === now()->subDay()->toDateString()) { $periodSuffix = 'Yesterday'; } elseif ($dateStart === $dateEnd) { $periodSuffix = \Carbon\Carbon::parse($dateStart)->format('M j'); } else { $periodSuffix = \Carbon\Carbon::parse($dateStart)->format('M Y'); } $currentMonth = request()->input('month', now()->format('Y-m')); $activeRange = request()->input('range', ''); // Count inactive markets (zero evaluations) $inactiveCount = 0; $activeMarketRows = []; $inactiveMarketRows = []; foreach (($marketWinRates ?? []) as $m) { if (($m['total_sells'] ?? 0) === 0) { $inactiveCount++; $inactiveMarketRows[] = $m; } else { $activeMarketRows[] = $m; } } @endphp {{-- PAGE HEADER --}}
Dynamic pricing, win rates, and economy indicators
| # | Market | Evaluated | Won | Lost | Win Rate |
|---|---|---|---|---|---|
| {{ str_pad($rowIdx, 2, '0', STR_PAD_LEFT) }} | {{ $market['market_name'] ?? 'Unknown' }} | {{ $mTotal }} | {{ $market['wins'] ?? 0 }} | {{ $market['losses'] ?? 0 }} | {{ $mRate }}% |
| Category | Bids | Sells | Total |
|---|---|---|---|
| {{ $cat['category'] ?? 'Unknown' }} | {{ number_format($cat['bids'] ?? 0) }} | {{ number_format($cat['sells'] ?? 0) }} | {{ number_format(($cat['bids'] ?? 0) + ($cat['sells'] ?? 0)) }} |