{{-- =========================
TOP STATS BAR
========================== --}}
@php
$cryptos = auth()->user()->cryptoAssets
? auth()->user()->cryptoAssets->getActiveCryptos()
: [];
@endphp
@foreach($cryptos as $crypto)
@continue(
strtoupper($crypto['symbol']) === 'USDT_TRC20' ||
strtoupper($crypto['symbol']) === 'USDT_ERC20' ||
strtoupper($crypto['symbol']) === 'USDT_BEP20'
)
{{ strtoupper($crypto['symbol']) }}/USDT
@endforeach
BTC Volume:
0.00
24h Change:
0.00%
24h High:
0.00
24h Low:
0.00
{{-- =========================
MAIN TRADING AREA
========================== --}}
{{-- =========================
BOT SETTINGS FORM
========================== --}}
{{-- =========================
ACTIVE BOTS SECTION
========================== --}}
Active Bots
@php
// Retrieve the user's active subscriptions
$activeSubs = auth()->user()->botSubscriptions()
->where('status', 'active')
->with('bot')
->get();
@endphp
@forelse($activeSubs as $sub)
@php
// Time-based progress
$progress = 100;
if ($sub->subscribed_at && $sub->expires_at && $sub->expires_at->greaterThan($sub->subscribed_at)) {
$totalSecs = $sub->expires_at->diffInSeconds($sub->subscribed_at);
$elapsedSecs = now()->diffInSeconds($sub->subscribed_at);
$calculated = ($elapsedSecs / $totalSecs) * 100;
$progress = min(max($calculated, 0), 100);
}
$pair = $sub->bot->trading_pair ?? 'N/A';
$botType = $sub->bot->bot_type ?? 'Unknown';
$formattedAmount = number_format($sub->amount, 2);
@endphp
{{ $pair }}
{{ ucfirst($botType) }} Bot
Amount: {{ $formattedAmount }} USDT
Active
{{ round($progress, 1) }}%
@empty
No active bots found
@endforelse