@extends('nexus.layouts.app') @section('page-title', 'Pilots') @section('sys-mode', 'PILOT MODE') @section('head') @endsection @section('content') @php $ov = $overview ?? []; $rows = $pilotsTable ?? []; $wrDist = $rollingWrDist ?? []; $followsChart = $followsPerPilot ?? []; $capChart = $followerCapDist ?? []; $dailyChart = $dailyActivity ?? []; $followRows = $follows ?? []; $dateStart = $dates['start'] ?? now()->startOfMonth()->toDateString(); $dateEnd = $dates['end'] ?? now()->toDateString(); $isToday = $dateStart === now()->toDateString() && $dateEnd === now()->toDateString(); if ($isToday) { $periodLabel = 'TODAY'; $periodSuffix = 'Today'; } elseif ($dateStart === now()->subDay()->toDateString() && $dateEnd === now()->subDay()->toDateString()) { $periodLabel = 'YESTERDAY'; $periodSuffix = 'Yesterday'; } elseif ($dateStart === $dateEnd) { $periodLabel = strtoupper(\Carbon\Carbon::parse($dateStart)->format('M j')); $periodSuffix = \Carbon\Carbon::parse($dateStart)->format('M j'); } else { $periodLabel = strtoupper(\Carbon\Carbon::parse($dateStart)->format('M Y')); $periodSuffix = \Carbon\Carbon::parse($dateStart)->format('M Y'); } $currentMonth = request()->input('month', now()->format('Y-m')); $activeRange = request()->input('range', ''); $currentSort = $currentSort ?? request()->input('sort', 'wins'); $currentDir = $currentDir ?? request()->input('dir', 'desc'); $followStatusFilter = $followStatusFilter ?? request()->input('follow_status', 'all'); // Phase 14-B: search + pagination defaults (backwards-safe) $followSearch = $followSearch ?? request()->input('follow_search', ''); $followsTotal = $followsTotal ?? count($followRows); $followsPages = $followsPages ?? 1; $followsPage = $followsPage ?? 1; $followsPerPageResolved = $followsPerPageResolved ?? 20; $followStatusLabels = [ 'all' => 'All', 'active' => 'Active', 'winding_down' => 'Winding Down', 'stopped' => 'Stopped', 'auto_stopped' => 'Auto-Stopped', ]; @endphp {{-- PAGE HEADER --}} {{-- STAT STRIP: Pilot roster --}}
Total Pilots
{{ $ov['total_pilots'] ?? 0 }}
Active roster
Circuit Normal
{{ $ov['normal_count'] ?? 0 }}
Paused {{ $ov['paused_count'] ?? 0 }} / Cool {{ $ov['cooldown_count'] ?? 0 }}
Active Follows
{{ number_format($ov['active_follows'] ?? 0) }}
{{ number_format($ov['unique_followers'] ?? 0) }} unique followers
Follower Capital
${{ number_format($ov['follower_capital'] ?? 0, 2) }}
${{ number_format($ov['total_invested'] ?? 0, 2) }} invested
{{-- STAT STRIP: Pilot activity (period) --}}
Pilot Bids {{ $periodSuffix }}
{{ number_format($ov['pilot_bids'] ?? 0) }}
Pilot Wins {{ $periodSuffix }}
{{ number_format($ov['pilot_wins'] ?? 0) }}
Pilot Losses {{ $periodSuffix }}
{{ number_format($ov['pilot_losses'] ?? 0) }}
Accepting Followers
{{ $ov['accepting_count'] ?? 0 }} / {{ $ov['total_pilots'] ?? 0 }}
{{ $ov['stop_loss_triggered'] ?? 0 }} stop-loss lifetime
{{-- STAT STRIP: Mirror activity (period) --}}
Mirror Trades {{ $periodSuffix }}
{{ number_format($ov['mirror_trades'] ?? 0) }}
{{ number_format($ov['mirror_skipped'] ?? 0) }} skipped
Mirror Win Rate
{{ $ov['mirror_win_rate'] ?? 0 }}%
{{ $ov['mirror_wins'] ?? 0 }}W / {{ $ov['mirror_losses'] ?? 0 }}L
Pilot Earnings {{ $periodSuffix }}
${{ number_format($ov['pilot_earnings'] ?? 0, 2) }}
From follower trades (pre-cutover)
Follower Gross {{ $periodSuffix }}
${{ number_format($ov['follower_gross'] ?? 0, 2) }}
Before pilot cut
{{-- STAT STRIP: New-model position (Phase 14-B) --}}
Mark-to-Market
${{ number_format($ov['mark_to_market_total'] ?? 0, 2) }}
across active + winding-down follows
Unrealized Cut Liability
${{ number_format($ov['unrealized_cut_liability'] ?? 0, 2) }}
platform will earn at sweep
Wind-downs In Progress
@php $wdCount = (int) ($ov['winding_down_count'] ?? 0); $wdColor = $wdCount > 0 ? 'yellow' : ''; @endphp
{{ $wdCount }}
${{ number_format($ov['winding_down_capital'] ?? 0, 2) }} committed
Realized Cut (Post-Cutover)
@php $realizedMonth = (float) ($ov['realized_post_cutover_month'] ?? 0); $realizedLifetime = (float) ($ov['realized_post_cutover_lifetime'] ?? 0); @endphp @if($realizedLifetime > 0)
${{ number_format($realizedMonth, 2) }}
${{ number_format($realizedLifetime, 2) }} lifetime
@else
Pending first sweep
no wind-down completed yet
@endif
{{-- CHARTS --}}
Pilot Rolling WR Distribution
Daily Pilot Activity • {{ $periodSuffix }}
Active Follows Per Pilot
Follower Capital Per Pilot
{{-- PILOTS TABLE --}}
Pilots Leaderboard {{ $periodSuffix }} • 25 pilots
@if (!empty($rows) && count($rows) > 0) @foreach ($rows as $idx => $p) @php $circuitClass = match ($p['circuit_state']) { 'normal' => 'chip-completed', 'paused' => 'chip-error', 'cooldown' => 'chip-warning', default => 'chip-pending', }; $wr = $p['circuit_rolling_wr']; @endphp @endforeach @else @endif
# Pilot Archetype Circuit Rolling WR Wins Losses WR Profit Bids Followers Follower Cap Mirror Mirror W/L Pilot Earned Follower APY Realized Cut Last Activity
{{ str_pad($idx + 1, 2, '0', STR_PAD_LEFT) }} {{ $p['display_name'] }} @if ($p['is_in_warmup']) WARMUP @endif {{ $p['archetype'] ?? '-' }} {{ $p['circuit_state'] }} {{ $wr !== null ? number_format($wr, 1) . '%' : '-' }} {{ $p['wins'] }} {{ $p['losses'] }} {{ $p['win_rate'] }}% ${{ number_format($p['total_profit'], 2) }} {{ $p['total_bids'] }} {{ $p['active_follows'] }} ${{ number_format($p['follower_capital'], 2) }} {{ $p['mirror_trades'] }} {{ $p['mirror_wins'] }} / {{ $p['mirror_losses'] }} ${{ number_format($p['pilot_earned'], 2) }} @php $apy = $p['follower_apy_30d'] ?? null; $conf = $p['apy_confidence'] ?? 'insufficient_trades'; @endphp @if($apy !== null) {{ $apy }}% @if($conf === 'medium')  · {{ $p['apy_wins_30d'] }}W @endif @else @php $confLabel = match($conf) { 'warmup' => 'Warmup', 'insufficient_trades' => '<50 wins', 'no_capital' => 'No cap', default => '-', }; @endphp {!! $confLabel !!} @endif @if(($p['realized_cut_lifetime'] ?? 0) > 0) ${{ number_format($p['realized_cut_lifetime'], 2) }} @if(($p['realized_cut_month'] ?? 0) > 0)
${{ number_format($p['realized_cut_month'], 2) }} this month
@endif @else Pending sweep @endif
{{ $p['last_activity_relative'] }}
No pilot data for this period
{{-- ACTIVE FOLLOWS --}}
Follow Records @php $followRangeStart = $followsTotal > 0 ? (($followsPage - 1) * $followsPerPageResolved) + 1 : 0; $followRangeEnd = min($followsPage * $followsPerPageResolved, $followsTotal); @endphp @if($followsTotal > 0) Showing {{ $followRangeStart }}-{{ $followRangeEnd }} of {{ number_format($followsTotal) }} @else 0 record(s) @endif
Status
Per page
@if (!empty($follows) && count($follows) > 0) @foreach ($follows as $idx => $f) @php $statusClass = match ($f['status']) { 'active' => 'chip-completed', 'winding_down' => 'chip-winding', 'stopped' => 'chip-pending', 'auto_stopped' => 'chip-error', default => 'chip-pending', }; $netProfitClass = $f['net_profit'] >= 0 ? 'text-green' : 'text-red'; $isNonTerminal = in_array($f['status'], ['active', 'winding_down'], true); $m2m = $f['mark_to_market']; $absoluteIdx = (($followsPage - 1) * $followsPerPageResolved) + $idx + 1; @endphp @endforeach @else @endif
# Follower Country Pilot Starting Balance Mark-to-Market Net Profit Pilot Earned Status Started Actions
{{ str_pad($absoluteIdx, 2, '0', STR_PAD_LEFT) }} {{ $f['follower_username'] }} {{ $f['country_name'] }} {{ $f['pilot_name'] }} ${{ number_format($f['starting_amount'], 2) }} ${{ number_format($f['current_balance'], 2) }} @if($isNonTerminal && $m2m !== null) ${{ number_format($m2m, 2) }} @if(($f['open_positions'] ?? 0) > 0)
{{ $f['open_positions'] }} open
@endif @else - @endif
${{ number_format($f['net_profit'], 2) }} ${{ number_format($f['pilot_earned'], 2) }} {{ str_replace('_', '-', $f['status']) }} {{ $f['started_relative'] }} @if($f['status'] === 'winding_down') @php $canForceSettle = ($f['open_positions'] ?? 0) === 0; @endphp @if($canForceSettle) @else {{ $f['open_positions'] }} open @endif @else - @endif
No follow records{{ $followStatusFilter !== 'all' ? ' for status: ' . $followStatusLabels[$followStatusFilter] : '' }}{{ !empty($followSearch) ? ' matching "' . e($followSearch) . '"' : '' }}
{{-- Pagination controls --}} @if($followsPages > 1)
Page {{ $followsPage }} of {{ $followsPages }} · {{ number_format($followsTotal) }} total record{{ $followsTotal === 1 ? '' : 's' }}
@php $prevPage = max(1, $followsPage - 1); $nextPage = min($followsPages, $followsPage + 1); $disablePrev = $followsPage <= 1; $disableNext = $followsPage >= $followsPages; // Show ~5 page buttons centered around current $winStart = max(1, $followsPage - 2); $winEnd = min($followsPages, $followsPage + 2); if ($winEnd - $winStart < 4) { if ($winStart === 1) { $winEnd = min($followsPages, $winStart + 4); } elseif ($winEnd === $followsPages) { $winStart = max(1, $winEnd - 4); } } @endphp @if($winStart > 1) @if($winStart > 2) @endif @endif @for($p = $winStart; $p <= $winEnd; $p++) @endfor @if($winEnd < $followsPages) @if($winEnd < $followsPages - 1) @endif @endif
@endif @endsection @section('scripts') @endsection