fix: bot oluştururken sembol USDT ile biter, runner temizlendi
This commit is contained in:
parent
c23c08d1e6
commit
e2e5b2e6c6
2 changed files with 5 additions and 8 deletions
|
|
@ -81,7 +81,10 @@ pub async fn create_bot(
|
|||
let config = BotConfig {
|
||||
id: Uuid::new_v4().to_string(),
|
||||
name: req.name,
|
||||
symbol: req.symbol.to_uppercase(),
|
||||
symbol: {
|
||||
let s = req.symbol.to_uppercase();
|
||||
if s.ends_with("USDT") { s } else { format!("{}USDT", s) }
|
||||
},
|
||||
timeframe: req.timeframe,
|
||||
usdt_amount: req.usdt_amount,
|
||||
profit_percent: req.profit_percent,
|
||||
|
|
|
|||
|
|
@ -43,13 +43,7 @@ impl BotRunner {
|
|||
let client = BinanceClient::new(api_key, api_secret, config.testnet);
|
||||
// Fiyat verisi her zaman canlı Binance stream'inden gelir
|
||||
let ws_base = BINANCE_WS_URL;
|
||||
let symbol_lower = config.symbol.to_lowercase();
|
||||
let stream_symbol = if symbol_lower.ends_with("usdt") {
|
||||
symbol_lower
|
||||
} else {
|
||||
format!("{}usdt", symbol_lower)
|
||||
};
|
||||
let stream = format!("{}/{}@kline_{}", ws_base, stream_symbol, config.timeframe.as_str());
|
||||
let stream = format!("{}/{}@kline_{}", ws_base, config.symbol.to_lowercase(), config.timeframe.as_str());
|
||||
|
||||
info!("[{}] Bot başlatıldı. WS: {}", config.symbol, stream);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue