Add configurable tick interval (time between trades)

- Seed tick_interval_seconds setting (default 60s)
- Expose tick_interval_seconds via GET/PATCH /api/settings
- startScheduler reads the setting at start time; enforces 5s minimum
- getSchedulerStatus returns intervalSeconds for the UI
- Main page: "Every [__] s" input in idle bar — saves on blur, persists across
  restarts; running state displays "every Ns" next to symbol/action

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Senofy
2026-03-12 03:42:54 -05:00
co-authored by Claude Sonnet 4.6
parent 39d7c5761c
commit 245a15666e
4 changed files with 39 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from 'next/server';
import { getSetting, setSetting } from '@/lib/db';
const VALID_KEYS = ['max_concurrent_accounts'] as const;
const VALID_KEYS = ['max_concurrent_accounts', 'tick_interval_seconds'] as const;
type SettingKey = typeof VALID_KEYS[number];
export async function GET() {