diff --git a/src/frontend/src/routes/bot/[id]/simulate/+page.svelte b/src/frontend/src/routes/bot/[id]/simulate/+page.svelte index 5e4cc6f..0ee24a3 100644 --- a/src/frontend/src/routes/bot/[id]/simulate/+page.svelte +++ b/src/frontend/src/routes/bot/[id]/simulate/+page.svelte @@ -7,7 +7,8 @@ import { SignalChart, ProUpgradeBanner } from '$lib/components'; let botId = $derived($page.params.id); - let token = $state('PEPE'); + let tokenName = $state(''); + let tokenAddress = $state(''); let intervalSeconds = $state(60); let autoExecute = $state(false); let isRunning = $state(false); @@ -27,6 +28,15 @@ try { const bot = await api.bots.get(botId); setCurrentBot(bot); + + // Extract token info from strategy config + const strategy = bot.strategy_config; + if (strategy) { + const condition = strategy.conditions?.[0]; + const action = strategy.actions?.[0]; + tokenName = condition?.token || action?.token || ''; + tokenAddress = condition?.token_address || action?.token_address || ''; + } } catch (e) { goto('/dashboard'); } @@ -57,7 +67,7 @@ try { const simulation = await api.simulate.start(botId, { - token, + token: tokenAddress, interval_seconds: intervalSeconds, auto_execute: autoExecute }); @@ -111,9 +121,14 @@