From 15e860c6dbd608a9cbdaaf1669922c78a5ca4906 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 18 Sep 2026 20:03:39 +0200 Subject: [PATCH] After correcting the design on chart1 --- backend/src/db/schema.sql | 22 +++++++ backend/src/domain/candle-predict/index.ts | 59 +++++++++++++++++++ .../repositories/candlePredictRepository.ts | 32 ++++++++-- .../src/validation/adminResourceSchemas.ts | 13 ++++ .../models}/candle_predict_instrument.dart | 31 +++++++--- .../lib/data/models/prediction_models.dart | 7 +++ .../presentation/prediction_screen.dart | 2 + .../widgets/candle_chart_widget.dart | 10 ++-- .../candle-predict/CandlePredictPage.tsx | 1 + .../components/CandlestickChart.tsx | 12 +++- .../candle-predict/instrumentConfig.ts | 54 +++++++++++++---- .../src/features/candle-predict/types.ts | 9 +++ .../catalog/CandlePredictConfigPanel.tsx | 58 ++++++++++++++++++ prediqo_web/src/shared/i18n/locales/en.ts | 10 ++++ prediqo_web/src/shared/i18n/locales/fr.ts | 10 ++++ 15 files changed, 297 insertions(+), 33 deletions(-) rename prediqo_mobile/lib/{features/prediction/domain => data/models}/candle_predict_instrument.dart (58%) diff --git a/backend/src/db/schema.sql b/backend/src/db/schema.sql index 7ae033ed..6127df62 100644 --- a/backend/src/db/schema.sql +++ b/backend/src/db/schema.sql @@ -648,6 +648,11 @@ CREATE TABLE IF NOT EXISTS candle_predict_config ( wallet_type_code VARCHAR(32) NOT NULL DEFAULT 'USDT_TRC20', auto_modes JSONB NOT NULL DEFAULT '["each_round","interval"]'::jsonb, is_active BOOLEAN NOT NULL DEFAULT TRUE, + -- Display-only synthetic instrument branding (OHLC still from Prediqo engine). + instrument_symbol VARCHAR(16) NOT NULL DEFAULT 'FO', + instrument_display_name VARCHAR(64) NOT NULL DEFAULT 'Full Option', + instrument_quote_currency VARCHAR(16) NOT NULL DEFAULT 'USDT', + instrument_price_digits SMALLINT NOT NULL DEFAULT 2 CHECK (instrument_price_digits >= 0 AND instrument_price_digits <= 8), updated_at TIMESTAMPTZ DEFAULT NOW() ); @@ -2712,3 +2717,20 @@ BEGIN ); END $$; +-- Candle Predict chart instrument branding (admin-editable, display-only) +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_schema = 'public' AND table_name = 'candle_predict_config' + AND column_name = 'instrument_symbol' + ) THEN + ALTER TABLE candle_predict_config + ADD COLUMN instrument_symbol VARCHAR(16) NOT NULL DEFAULT 'FO', + ADD COLUMN instrument_display_name VARCHAR(64) NOT NULL DEFAULT 'Full Option', + ADD COLUMN instrument_quote_currency VARCHAR(16) NOT NULL DEFAULT 'USDT', + ADD COLUMN instrument_price_digits SMALLINT NOT NULL DEFAULT 2 + CHECK (instrument_price_digits >= 0 AND instrument_price_digits <= 8); + END IF; +END $$; + diff --git a/backend/src/domain/candle-predict/index.ts b/backend/src/domain/candle-predict/index.ts index 441c20fe..8ffe6682 100644 --- a/backend/src/domain/candle-predict/index.ts +++ b/backend/src/domain/candle-predict/index.ts @@ -245,6 +245,13 @@ function mapConfig(row: repo.CandlePredictConfigRow) { auto: row.prediction_auto_enabled ?? true, multiCandle: row.prediction_multi_enabled ?? true, }, + /** Display-only chart identity (synthetic; not an external market symbol). */ + instrument: { + symbol: row.instrument_symbol ?? 'FO', + displayName: row.instrument_display_name ?? 'Full Option', + quoteCurrency: row.instrument_quote_currency ?? 'USDT', + priceDigits: Number(row.instrument_price_digits ?? 2), + }, updatedAt: row.updated_at.toISOString(), }; } @@ -632,6 +639,54 @@ export async function updateAdminConfig(body: Record) { dailyRevenueOverflowStrategy = body.dailyRevenueOverflowStrategy; } + const instrumentBody = + typeof body.instrument === 'object' && body.instrument !== null + ? (body.instrument as Record) + : null; + + const instrumentSymbol = + typeof instrumentBody?.symbol === 'string' + ? instrumentBody.symbol.trim() + : typeof body.instrumentSymbol === 'string' + ? body.instrumentSymbol.trim() + : undefined; + const instrumentDisplayName = + typeof instrumentBody?.displayName === 'string' + ? instrumentBody.displayName.trim() + : typeof body.instrumentDisplayName === 'string' + ? body.instrumentDisplayName.trim() + : undefined; + const instrumentQuoteCurrency = + typeof instrumentBody?.quoteCurrency === 'string' + ? instrumentBody.quoteCurrency.trim() + : typeof body.instrumentQuoteCurrency === 'string' + ? body.instrumentQuoteCurrency.trim() + : undefined; + const instrumentPriceDigits = + typeof instrumentBody?.priceDigits === 'number' + ? instrumentBody.priceDigits + : typeof body.instrumentPriceDigits === 'number' + ? body.instrumentPriceDigits + : undefined; + + if (instrumentSymbol !== undefined && !instrumentSymbol) { + throw new Error('instrument.symbol must not be empty'); + } + if (instrumentDisplayName !== undefined && !instrumentDisplayName) { + throw new Error('instrument.displayName must not be empty'); + } + if (instrumentQuoteCurrency !== undefined && !instrumentQuoteCurrency) { + throw new Error('instrument.quoteCurrency must not be empty'); + } + if ( + instrumentPriceDigits !== undefined && + (!Number.isInteger(instrumentPriceDigits) || + instrumentPriceDigits < 0 || + instrumentPriceDigits > 8) + ) { + throw new Error('instrument.priceDigits must be an integer between 0 and 8'); + } + const updated = await repo.updateConfig({ stakeAmounts, minStakeAmount, @@ -681,6 +736,10 @@ export async function updateAdminConfig(body: Record) { typeof (body.predictionTypes as { multiCandle?: boolean }).multiCandle === 'boolean' ? (body.predictionTypes as { multiCandle: boolean }).multiCandle : undefined, + instrumentSymbol, + instrumentDisplayName, + instrumentQuoteCurrency, + instrumentPriceDigits, }); // Global enable toggles should win over stale per-interval "on/off" overrides. diff --git a/backend/src/repositories/candlePredictRepository.ts b/backend/src/repositories/candlePredictRepository.ts index 5c9a4583..17bbf7d9 100644 --- a/backend/src/repositories/candlePredictRepository.ts +++ b/backend/src/repositories/candlePredictRepository.ts @@ -27,6 +27,14 @@ export type CandlePredictConfigRow = { prediction_single_enabled: boolean; prediction_auto_enabled: boolean; prediction_multi_enabled: boolean; + /** Short ticker shown on the chart, e.g. FO */ + instrument_symbol: string; + /** Full instrument name, e.g. Full Option */ + instrument_display_name: string; + /** Quote currency for the pair, e.g. USDT */ + instrument_quote_currency: string; + /** Decimal places for chart price labels */ + instrument_price_digits: number; updated_at: Date; }; @@ -158,6 +166,10 @@ export type ConfigUpdate = Partial<{ predictionSingleEnabled: boolean; predictionAutoEnabled: boolean; predictionMultiEnabled: boolean; + instrumentSymbol: string; + instrumentDisplayName: string; + instrumentQuoteCurrency: string; + instrumentPriceDigits: number; }>; export async function updateConfig(update: ConfigUpdate): Promise { @@ -181,12 +193,16 @@ export async function updateConfig(update: ConfigUpdate): Promise '$pairSymbol — ${price.toStringAsFixed(priceDigits)}'; + factory CandlePredictInstrument.fromJson(Map? json) { + if (json == null) return defaultCandlePredictInstrument; + final digits = (json['priceDigits'] as num?)?.toInt(); + return defaultCandlePredictInstrument.copyWith( + symbol: (json['symbol'] as String?)?.trim(), + displayName: (json['displayName'] as String?)?.trim(), + quoteCurrency: (json['quoteCurrency'] as String?)?.trim(), + priceDigits: digits == null ? null : digits.clamp(0, 8), + ); + } + CandlePredictInstrument copyWith({ String? id, String? symbol, @@ -51,19 +60,25 @@ class CandlePredictInstrument { }) { return CandlePredictInstrument( id: id ?? this.id, - symbol: symbol ?? this.symbol, - displayName: displayName ?? this.displayName, - quoteCurrency: quoteCurrency ?? this.quoteCurrency, + symbol: (symbol == null || symbol.isEmpty) ? this.symbol : symbol, + displayName: + (displayName == null || displayName.isEmpty) ? this.displayName : displayName, + quoteCurrency: (quoteCurrency == null || quoteCurrency.isEmpty) + ? this.quoteCurrency + : quoteCurrency, instrumentType: instrumentType ?? this.instrumentType, priceDigits: priceDigits ?? this.priceDigits, ); } } -/// Active chart instrument — edit these fields to rename / rebrand the pair. -const candlePredictInstrument = CandlePredictInstrument( +/// Fallback branding when API config has not loaded yet. +const defaultCandlePredictInstrument = CandlePredictInstrument( id: 'fo', symbol: 'FO', displayName: 'Full Option', quoteCurrency: 'USDT', ); + +/// @deprecated Prefer [defaultCandlePredictInstrument] or config.instrument. +const candlePredictInstrument = defaultCandlePredictInstrument; diff --git a/prediqo_mobile/lib/data/models/prediction_models.dart b/prediqo_mobile/lib/data/models/prediction_models.dart index 3d1129ad..4a199407 100644 --- a/prediqo_mobile/lib/data/models/prediction_models.dart +++ b/prediqo_mobile/lib/data/models/prediction_models.dart @@ -1,6 +1,8 @@ /// Candle Predict game models parsed from API responses. library; +import 'candle_predict_instrument.dart'; + class GameStateModel { const GameStateModel({ required this.config, @@ -96,6 +98,7 @@ class PredictConfigModel { this.walletTypeCode = 'USDT_TRC20', this.predictionTypes = const PredictionTypesModel(), this.autoModes = const ['each_round'], + this.instrument = defaultCandlePredictInstrument, }); final List stakeAmounts; @@ -107,6 +110,7 @@ class PredictConfigModel { final String walletTypeCode; final PredictionTypesModel predictionTypes; final List autoModes; + final CandlePredictInstrument instrument; factory PredictConfigModel.fromJson(Map json) => PredictConfigModel( @@ -128,6 +132,9 @@ class PredictConfigModel { autoModes: (json['autoModes'] as List? ?? ['each_round']) .map((e) => e.toString()) .toList(), + instrument: CandlePredictInstrument.fromJson( + json['instrument'] as Map?, + ), ); } diff --git a/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart b/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart index a7a23b5c..f57ddb05 100644 --- a/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart +++ b/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart @@ -4,6 +4,7 @@ import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import '../../../../core/theme/app_colors.dart'; import '../../../../data/models/prediction_models.dart'; +import '../../../../data/models/candle_predict_instrument.dart'; import '../../../../l10n/app_strings.dart'; import '../../../../shared/widgets/pred_card.dart'; import '../../../../shared/widgets/pred_text_field.dart'; @@ -165,6 +166,7 @@ class _PredictionScreenState extends State { candles: state.candles, isLoadingOlder: state.isLoadingOlderCandles, hasMoreOlder: state.hasMoreOlderCandles, + instrument: gs?.config.instrument ?? defaultCandlePredictInstrument, ), if (context.watch().state.isAdmin && round != null && diff --git a/prediqo_mobile/lib/features/prediction/presentation/widgets/candle_chart_widget.dart b/prediqo_mobile/lib/features/prediction/presentation/widgets/candle_chart_widget.dart index c22547d9..48852917 100644 --- a/prediqo_mobile/lib/features/prediction/presentation/widgets/candle_chart_widget.dart +++ b/prediqo_mobile/lib/features/prediction/presentation/widgets/candle_chart_widget.dart @@ -4,7 +4,7 @@ import '../../../../core/theme/app_colors.dart'; import '../../../../data/models/prediction_models.dart'; import '../../../../l10n/app_strings.dart'; import '../../bloc/prediction_bloc.dart'; -import '../../domain/candle_predict_instrument.dart'; +import '../../../../data/models/candle_predict_instrument.dart'; /// Horizontally scrollable candlestick chart (latest candles on the right). /// Y-scale fits the **visible** window so candle size stays consistent across intervals. @@ -14,11 +14,13 @@ class CandleChartWidget extends StatefulWidget { required this.candles, this.isLoadingOlder = false, this.hasMoreOlder = true, + this.instrument = defaultCandlePredictInstrument, }); final List candles; final bool isLoadingOlder; final bool hasMoreOlder; + final CandlePredictInstrument instrument; static const double candleSlot = 14; static const double chartHeight = 240; @@ -234,7 +236,7 @@ class _CandleChartWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - candlePredictInstrument.pairSymbol, + widget.instrument.pairSymbol, style: Theme.of(context).textTheme.titleSmall?.copyWith( fontWeight: FontWeight.w800, color: Colors.white.withValues(alpha: 0.92), @@ -244,7 +246,7 @@ class _CandleChartWidgetState extends State { ), ), Text( - candlePredictInstrument.displayName, + widget.instrument.displayName, style: Theme.of(context).textTheme.bodySmall?.copyWith( color: Colors.white.withValues(alpha: 0.72), shadows: const [ @@ -255,7 +257,7 @@ class _CandleChartWidgetState extends State { Padding( padding: const EdgeInsets.only(top: 2), child: Text( - candlePredictInstrument.priceLabel(candles.last.close), + widget.instrument.priceLabel(candles.last.close), style: Theme.of(context).textTheme.bodySmall?.copyWith( fontFamily: 'monospace', fontWeight: FontWeight.w600, diff --git a/prediqo_web/src/features/candle-predict/CandlePredictPage.tsx b/prediqo_web/src/features/candle-predict/CandlePredictPage.tsx index ec0c8aa6..87d19e3e 100644 --- a/prediqo_web/src/features/candle-predict/CandlePredictPage.tsx +++ b/prediqo_web/src/features/candle-predict/CandlePredictPage.tsx @@ -636,6 +636,7 @@ export function CandlePredictPage() { hasMoreOlder={candlesQ.hasMore} loadingOlder={candlesQ.loadingMore} onLoadOlder={() => void candlesQ.loadOlder()} + instrument={config?.instrument} /> )} diff --git a/prediqo_web/src/features/candle-predict/components/CandlestickChart.tsx b/prediqo_web/src/features/candle-predict/components/CandlestickChart.tsx index 393bce11..f02aaa67 100644 --- a/prediqo_web/src/features/candle-predict/components/CandlestickChart.tsx +++ b/prediqo_web/src/features/candle-predict/components/CandlestickChart.tsx @@ -4,7 +4,7 @@ import { memo, useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import type { OhlcCandle } from '../types'; import { - getActiveInstrument, + resolveInstrument, instrumentChartTitle, instrumentPairSymbol, instrumentPriceLabel, @@ -25,6 +25,13 @@ type Props = { hasMoreOlder?: boolean; loadingOlder?: boolean; onLoadOlder?: () => void; + /** Synthetic instrument branding from game config (falls back to defaults). */ + instrument?: { + symbol?: string; + displayName?: string; + quoteCurrency?: string; + priceDigits?: number; + }; }; function chartCandle(c: OhlcCandle) { @@ -67,6 +74,7 @@ export const CandlestickChart = memo(function CandlestickChart({ hasMoreOlder = false, loadingOlder = false, onLoadOlder, + instrument: instrumentProp, }: Props) { const { t } = useTranslation(); const containerRef = useRef(null); @@ -84,7 +92,7 @@ export const CandlestickChart = memo(function CandlestickChart({ hasMoreOlderRef.current = hasMoreOlder; loadingOlderRef.current = loadingOlder; - const instrument = getActiveInstrument(); + const instrument = resolveInstrument(instrumentProp); const lastClose = candles.length ? candles[candles.length - 1]!.close : null; const pairSymbol = instrumentPairSymbol(instrument); const chartTitle = instrumentChartTitle(instrument); diff --git a/prediqo_web/src/features/candle-predict/instrumentConfig.ts b/prediqo_web/src/features/candle-predict/instrumentConfig.ts index 154c6452..29a6d343 100644 --- a/prediqo_web/src/features/candle-predict/instrumentConfig.ts +++ b/prediqo_web/src/features/candle-predict/instrumentConfig.ts @@ -4,9 +4,9 @@ * Display-only identity — OHLC always comes from our backend engine, never from * TradingView / Binance / any external market feed. * - * Candle Predict uses a single active instrument. To change it, edit - * {@link CANDLE_PREDICT_INSTRUMENT} below (symbol, name, quote currency). - * Helpers always resolve through {@link getActiveInstrument}. + * Runtime values are loaded from the game config API (`config.instrument`) and + * edited under Options → Catalog → Candle. {@link DEFAULT_CANDLE_PREDICT_INSTRUMENT} + * is only a fallback before config arrives / if fields are missing. */ export type InstrumentType = 'SYNTHETIC'; @@ -25,11 +25,8 @@ export type SyntheticInstrumentConfig = { priceDigits: number; }; -/** - * Active chart instrument — edit this object to rename / rebrand the pair. - * Keep a single entry; multi-instrument switching is not required today. - */ -export const CANDLE_PREDICT_INSTRUMENT: SyntheticInstrumentConfig = { +/** Fallback branding when API config has not loaded yet. */ +export const DEFAULT_CANDLE_PREDICT_INSTRUMENT: SyntheticInstrumentConfig = { id: 'fo', symbol: 'FO', displayName: 'Full Option', @@ -38,21 +35,52 @@ export const CANDLE_PREDICT_INSTRUMENT: SyntheticInstrumentConfig = { priceDigits: 2, }; -/** Returns the instrument currently shown on the Candle Predict chart. */ +/** @deprecated Use {@link DEFAULT_CANDLE_PREDICT_INSTRUMENT} or {@link resolveInstrument}. */ +export const CANDLE_PREDICT_INSTRUMENT = DEFAULT_CANDLE_PREDICT_INSTRUMENT; + +type InstrumentPartial = { + symbol?: string; + displayName?: string; + quoteCurrency?: string; + priceDigits?: number; +}; + +/** + * Merges API instrument branding onto the default synthetic instrument. + * @param partial Instrument fields from game / admin config (optional). + */ +export function resolveInstrument( + partial?: InstrumentPartial | null +): SyntheticInstrumentConfig { + if (!partial) return DEFAULT_CANDLE_PREDICT_INSTRUMENT; + return { + ...DEFAULT_CANDLE_PREDICT_INSTRUMENT, + symbol: partial.symbol?.trim() || DEFAULT_CANDLE_PREDICT_INSTRUMENT.symbol, + displayName: partial.displayName?.trim() || DEFAULT_CANDLE_PREDICT_INSTRUMENT.displayName, + quoteCurrency: + partial.quoteCurrency?.trim() || DEFAULT_CANDLE_PREDICT_INSTRUMENT.quoteCurrency, + priceDigits: + typeof partial.priceDigits === 'number' && Number.isFinite(partial.priceDigits) + ? Math.max(0, Math.min(8, Math.trunc(partial.priceDigits))) + : DEFAULT_CANDLE_PREDICT_INSTRUMENT.priceDigits, + }; +} + +/** @deprecated Prefer {@link resolveInstrument} with API config. */ export function getActiveInstrument(): SyntheticInstrumentConfig { - return CANDLE_PREDICT_INSTRUMENT; + return DEFAULT_CANDLE_PREDICT_INSTRUMENT; } /** Pair ticker shown on the chart, e.g. FO/USDT */ export function instrumentPairSymbol( - instrument: SyntheticInstrumentConfig = getActiveInstrument() + instrument: SyntheticInstrumentConfig = DEFAULT_CANDLE_PREDICT_INSTRUMENT ): string { return `${instrument.symbol}/${instrument.quoteCurrency}`; } /** Header line, e.g. FO/USDT — Full Option */ export function instrumentChartTitle( - instrument: SyntheticInstrumentConfig = getActiveInstrument() + instrument: SyntheticInstrumentConfig = DEFAULT_CANDLE_PREDICT_INSTRUMENT ): string { return `${instrumentPairSymbol(instrument)} — ${instrument.displayName}`; } @@ -60,7 +88,7 @@ export function instrumentChartTitle( /** Price subtitle, e.g. FO/USDT — 105.50 */ export function instrumentPriceLabel( price: number, - instrument: SyntheticInstrumentConfig = getActiveInstrument() + instrument: SyntheticInstrumentConfig = DEFAULT_CANDLE_PREDICT_INSTRUMENT ): string { return `${instrumentPairSymbol(instrument)} — ${price.toFixed(instrument.priceDigits)}`; } diff --git a/prediqo_web/src/features/candle-predict/types.ts b/prediqo_web/src/features/candle-predict/types.ts index 161ef2eb..8f52171f 100644 --- a/prediqo_web/src/features/candle-predict/types.ts +++ b/prediqo_web/src/features/candle-predict/types.ts @@ -52,6 +52,13 @@ export type MultiCandlePrediction = { createdAt: string; }; +export type CandlePredictInstrument = { + symbol: string; + displayName: string; + quoteCurrency: string; + priceDigits: number; +}; + export type CandlePredictConfig = { stakeAmounts: number[]; minStakeAmount: number; @@ -78,6 +85,8 @@ export type CandlePredictConfig = { autoModes: string[]; isActive: boolean; predictionTypes: PredictionTypeFlags; + /** Synthetic chart instrument branding (display-only). */ + instrument?: CandlePredictInstrument; updatedAt: string; }; diff --git a/prediqo_web/src/features/catalog/CandlePredictConfigPanel.tsx b/prediqo_web/src/features/catalog/CandlePredictConfigPanel.tsx index a03af43f..63f72d27 100644 --- a/prediqo_web/src/features/catalog/CandlePredictConfigPanel.tsx +++ b/prediqo_web/src/features/catalog/CandlePredictConfigPanel.tsx @@ -49,6 +49,10 @@ export function CandlePredictConfigPanel() { predictionSingleEnabled: true, predictionAutoEnabled: true, predictionMultiEnabled: true, + instrumentSymbol: 'FO', + instrumentDisplayName: 'Full Option', + instrumentQuoteCurrency: 'USDT', + instrumentPriceDigits: 2, }); const [feedback, setFeedback] = useState<{ severity: 'success' | 'error'; text: string } | null>( null @@ -75,6 +79,12 @@ export function CandlePredictConfigPanel() { walletTypeCode: string; isActive: boolean; predictionTypes?: { single: boolean; auto: boolean; multiCandle: boolean }; + instrument?: { + symbol?: string; + displayName?: string; + quoteCurrency?: string; + priceDigits?: number; + }; }; setForm({ stakeAmounts: c.stakeAmounts.join(','), @@ -97,6 +107,10 @@ export function CandlePredictConfigPanel() { predictionSingleEnabled: c.predictionTypes?.single ?? true, predictionAutoEnabled: c.predictionTypes?.auto ?? true, predictionMultiEnabled: c.predictionTypes?.multiCandle ?? true, + instrumentSymbol: c.instrument?.symbol ?? 'FO', + instrumentDisplayName: c.instrument?.displayName ?? 'Full Option', + instrumentQuoteCurrency: c.instrument?.quoteCurrency ?? 'USDT', + instrumentPriceDigits: c.instrument?.priceDigits ?? 2, }); } }, [configQ.data]); @@ -132,6 +146,12 @@ export function CandlePredictConfigPanel() { auto: form.predictionAutoEnabled, multiCandle: form.predictionMultiEnabled, }, + instrument: { + symbol: form.instrumentSymbol.trim(), + displayName: form.instrumentDisplayName.trim(), + quoteCurrency: form.instrumentQuoteCurrency.trim(), + priceDigits: form.instrumentPriceDigits, + }, }); setFeedback({ severity: 'success', @@ -179,6 +199,44 @@ export function CandlePredictConfigPanel() { )} + + {t('admin.catalog.candlePredict.config.instrumentTitle')} + + + {t('admin.catalog.candlePredict.config.instrumentIntro')} + + setForm({ ...form, instrumentSymbol: e.target.value })} + fullWidth + helperText={t('admin.catalog.candlePredict.config.instrumentSymbolHint')} + /> + setForm({ ...form, instrumentDisplayName: e.target.value })} + fullWidth + /> + setForm({ ...form, instrumentQuoteCurrency: e.target.value })} + fullWidth + helperText={t('admin.catalog.candlePredict.config.instrumentQuoteHint', { + pair: `${form.instrumentSymbol.trim() || 'FO'}/${form.instrumentQuoteCurrency.trim() || 'USDT'}`, + })} + /> + setForm({ ...form, instrumentPriceDigits: Number(e.target.value) })} + fullWidth + helperText={t('admin.catalog.candlePredict.config.instrumentPriceDigitsHint')} + /> +