prepare('SELECT uc_price, captured_at FROM uc_price_history WHERE quote_currency = "EUR" AND captured_at > NOW() - INTERVAL 24 HOUR ORDER BY captured_at ASC');
if ($stmt) { $stmt->execute(); $rows = $stmt->get_result()->fetch_all(MYSQLI_ASSOC); }
// Build SVG points (fallback flat 1.0 if no data)
$points = [];
if (count($rows) >= 2) {
$n = count($rows); $pmin = min(array_column($rows,'uc_price')); $pmax = max(array_column($rows,'uc_price'));
if ($pmax == $pmin) { $pmax = $pmin + 0.01; }
for ($i = 0; $i < $n; $i++) {
$x = 40 + ($i / max($n-1,1)) * 540;
$y = 200 - (($rows[$i]['uc_price'] - $pmin) / ($pmax - $pmin)) * 160;
$points[] = round($x,1) . ',' . round($y,1);
}
} else {
// Smooth fake series for first launch (UC pegged €1.00)
$base = [140,135,138,128,130,118,122,108,112,98,102,90,95,82,86,75,80,70,68];
foreach ($base as $i => $y) {
$x = 40 + ($i / (count($base)-1)) * 540;
$points[] = round($x,1) . ',' . $y;
}
}
$polyline = implode(' ', $points);
$last_price = $rows[count($rows)-1]['uc_price'] ?? 1.0;
$first_price = $rows[0]['uc_price'] ?? 0.9915;
$change_pct = (($last_price - $first_price) / max($first_price, 0.0001)) * 100;
$uc_subdomain = 'blockchain';
$uc_active_nav = 'trade';
?>
Trade UC — UC Blockchain
Trade UC Coin
UC PRICE — 24H
€= number_format($last_price, 4) ?>
= $change_pct >= 0 ? '+' : '' ?>= number_format($change_pct, 2) ?>%
UC
€= number_format($last_price,4) ?>
+0.85%
Buy / Sell UC
You pay€100.00
Network fee€0.00
You receive100.00 UC
CONFIRM TRADE
Your Trade-Code
Share this with senders so they can transfer UC to you. Public — safe to share.
= htmlspecialchars($wallet['trade_code']) ?>