@extends('nexus.layouts.app') @section('page-title', 'Controls') @section('sys-mode', 'ADMIN CONTROLS') @section('content') @php /* * HUMAN LABEL MAP * Maps actual database config keys to human-readable labels and units. * Source: live server screenshot (March 9, 2026). * Keys not in this map fall back to ucwords(str_replace('_', ' ', $key)). */ $humanMap = [ // General 'nexus_status' => ['label' => 'Engine Status', 'unit' => ''], 'nexus_version' => ['label' => 'Engine Version', 'unit' => ''], 'nexus_go_live_date' => ['label' => 'Target Go-Live', 'unit' => ''], 'emergency_pause' => ['label' => 'Emergency Pause', 'unit' => ''], 'first_timer_guarantee' => ['label' => 'First-Timer Guarantee', 'unit' => ''], // Session 'session_1_start_utc' => ['label' => 'Session 1 Start', 'unit' => 'UTC'], 'session_2_start_utc' => ['label' => 'Session 2 Start', 'unit' => 'UTC'], 'session_3_start_utc' => ['label' => 'Session 3 Start', 'unit' => 'UTC'], 'session_duration_minutes' => ['label' => 'Session Duration', 'unit' => 'mins'], 'criteria_rotation_enabled' => ['label' => 'Criteria Rotation', 'unit' => ''], // Win Rate 'win_rate_session_1' => ['label' => 'Win Rate Session 1', 'unit' => '%'], 'win_rate_session_2' => ['label' => 'Win Rate Session 2', 'unit' => '%'], 'win_rate_session_3' => ['label' => 'Win Rate Session 3', 'unit' => '%'], // Loss 'loss_requirement_min' => ['label' => 'Loss Requirement Min', 'unit' => 'losses'], 'loss_requirement_max' => ['label' => 'Loss Requirement Max', 'unit' => 'losses'], // Economy 'recess_threshold_percent' => ['label' => 'Recess Threshold', 'unit' => '%'], 'excess_threshold_percent' => ['label' => 'Excess Threshold', 'unit' => '%'], 'buyback_zone_percent' => ['label' => 'Buyback Zone', 'unit' => '%'], 'buyback_proximity_percent' => ['label' => 'Buyback Proximity Buffer', 'unit' => '%'], // Economy (pre-go-live review) 'min_bid_percent' => ['label' => 'Minimum Bid Floor', 'unit' => '%'], 'monthly_profit_cap_percent' => ['label' => 'Monthly Profit Cap', 'unit' => '%'], 'max_sell_margin' => ['label' => 'Max Sell Margin', 'unit' => '%'], 'win_rate_ceiling' => ['label' => 'Win Rate Ceiling', 'unit' => '%'], // Economy (cap overhaul) 'cap_period_days' => ['label' => 'Cap Window Length', 'unit' => 'days'], 'weekly_pace_randomness_min' => ['label' => 'Weekly Budget Randomness Min', 'unit' => 'x'], 'weekly_pace_randomness_max' => ['label' => 'Weekly Budget Randomness Max', 'unit' => 'x'], 'daily_pace_randomness_min' => ['label' => 'Daily Budget Randomness Min', 'unit' => 'x'], 'daily_pace_randomness_max' => ['label' => 'Daily Budget Randomness Max', 'unit' => 'x'], // Economy (cap tuning) 'loss_brake_threshold' => ['label' => 'Loss Brake Threshold', 'unit' => '%'], 'daily_budget_floor' => ['label' => 'Daily Budget Floor', 'unit' => '$'], 'weekly_budget_floor' => ['label' => 'Weekly Budget Floor', 'unit' => '$'], // Economy (split cap) 'ictp_profit_cap_min' => ['label' => 'ICTP/Grant Cap Min', 'unit' => '%'], 'ictp_profit_cap_max' => ['label' => 'ICTP/Grant Cap Max', 'unit' => '%'], 'main_profit_cap_min' => ['label' => 'Main Balance Cap Min', 'unit' => '%'], 'main_profit_cap_max' => ['label' => 'Main Balance Cap Max', 'unit' => '%'], // Session (dynamic wins per session) 'max_wins_per_session' => ['label' => 'Wins Per Session Cap', 'unit' => 'wins'], 'max_wins_per_session_min' => ['label' => 'Wins Per Session Min', 'unit' => 'wins'], 'max_wins_per_session_max' => ['label' => 'Wins Per Session Max', 'unit' => 'wins'], // Bot 'bot_session_alignment' => ['label' => 'Session Alignment', 'unit' => ''], 'bot_fund_range_enforcement'=> ['label' => 'Fund Range Enforcement', 'unit' => ''], ]; /* * SECTION DESCRIPTIONS * Matches actual database group names from nexus_config table. */ $sectionMeta = [ 'general' => ['title' => 'General', 'desc' => 'Core engine identity and state. nexus_status controls the master kill switch.'], 'session' => ['title' => 'Session Schedule', 'desc' => '3 daily bidding sessions. Times in 24hr UTC format. Duration in minutes.'], 'winrate' => ['title' => 'Win Rates', 'desc' => 'Target win rate per session. Session 1 highest (80%), Session 3 lowest (30%).'], 'loss' => ['title' => 'Loss Requirements', 'desc' => 'Dynamic loss requirement baseline range. NEXUS sets the actual value per session.'], 'economy' => ['title' => 'Economy', 'desc' => 'Dynamic pricing thresholds, profit caps, and pacing budgets. Cap window is per-user rolling.'], 'bot' => ['title' => 'Bot Governance', 'desc' => 'AI bot behaviour toggles. Fund ranges are set per-plan in the table below.'], ]; /* * SECTION ORDER -- controls page layout. * Matches the actual group values in nexus_config table. */ $sectionOrder = ['general', 'session', 'winrate', 'loss', 'economy', 'bot']; /* * HIDDEN FROM CONFIG LIST * emergency_pause is handled by the dedicated toggle at the top. */ $hiddenKeys = ['emergency_pause']; /* Sort config groups by defined order */ $allConfig = $allConfig ?? []; $sortedConfig = []; foreach ($sectionOrder as $group) { if (isset($allConfig[$group])) { $sortedConfig[$group] = $allConfig[$group]; } } foreach ($allConfig as $group => $configs) { if (!isset($sortedConfig[$group])) { $sortedConfig[$group] = $configs; } } $isPaused = \App\Nexus\Engine\NexusConfig::get('emergency_pause', '0'); $isPaused = $isPaused === '1' || $isPaused === 1 || $isPaused === true; @endphp {{-- PAGE HEADER --}} {{-- ─── EMERGENCY PAUSE ─── --}}
Emergency Controls Immediate effect on all trading
Emergency Pause: {{ $isPaused ? 'ACTIVE' : 'OFF' }}
When active, all trading operations halt immediately. Sessions will not open, sells will not be evaluated, bids will not be processed. AI bots continue their own cycles unaffected.
{{-- ─── CONFIG SECTIONS ─── --}} @foreach ($sortedConfig as $groupName => $configs) @php $groupKey = strtolower($groupName); $meta = $sectionMeta[$groupKey] ?? ['title' => ucwords(str_replace('_', ' ', $groupName)), 'desc' => '']; @endphp
{{ $meta['title'] }} @if ($meta['desc']) {{ $meta['desc'] }} @endif
@foreach ($configs as $config) @php $configKey = $config['key'] ?? ($config->key ?? ''); $configValue = $config['value'] ?? ($config->value ?? ''); $configDesc = $config['description'] ?? ($config->description ?? ''); $isEditable = $config['is_editable'] ?? ($config->is_editable ?? 1); $configType = $config['type'] ?? ($config->type ?? 'string'); $isProtected = $configKey === 'nexus_status'; /* Skip hidden keys */ if (in_array($configKey, $hiddenKeys)) continue; /* Look up human label and unit */ $mapped = $humanMap[$configKey] ?? null; $humanLabel = $mapped ? $mapped['label'] : ucwords(str_replace('_', ' ', $configKey)); $unit = $mapped ? $mapped['unit'] : ''; @endphp
{{ $humanLabel }} {{ $configKey }} @if ($isProtected) PROTECTED @endif
@if ($unit) {{ $unit }} @endif
@if ($configDesc)
{{ $configDesc }}
@endif @php $changeInfo = ($configChanges ?? [])[$configKey] ?? null; @endphp @if ($changeInfo)
Last changed: {{ \Carbon\Carbon::parse($changeInfo['last_changed'])->format('M j, Y H:i') }} @if ($changeInfo['last_actor_id']) by admin #{{ $changeInfo['last_actor_id'] }} @endif
@endif
@if ($isEditable && !$isProtected) @else LOCKED @endif
@endforeach
@endforeach {{-- ─── PLAN RANGES ─── --}}
AI Plan NEXUS Ranges Bot profit governance parameters
{{-- Table header --}}
Plan
Daily Min / Max %
Monthly Min / Max %
Success Min / Max %
@php $plans = $plans ?? collect(); @endphp @foreach ($plans as $plan)
{{ $plan->name }}
/
/
/
@endforeach
@endsection @section('scripts') @endsection