From c39700e4c2e0ba1185a08080433ef036c62519ec Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Thu, 6 Aug 2026 21:56:22 +0200 Subject: [PATCH] Burst --- src/bot.rs | 4 ++-- src/strategy/{strat.rs => burst.rs} | 17 ++++++++++++++--- src/strategy/mod.rs | 2 +- src/types.rs | 11 ----------- 4 files changed, 17 insertions(+), 17 deletions(-) rename src/strategy/{strat.rs => burst.rs} (81%) diff --git a/src/bot.rs b/src/bot.rs index 7b74216..fa88d58 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -9,7 +9,7 @@ use tokio_tungstenite::{MaybeTlsStream, WebSocketStream, connect_async}; use crate::{ account::AccountManager, executor::Executor, - strategy::{Strategy, strat::Strat}, + strategy::{Strategy, burst::Burst}, }; pub struct Bot { @@ -69,7 +69,7 @@ impl Bot { ws: Mutex::new(connect_async("wss://pumpdev.io/ws").await?.0), executor: Mutex::new(Box::new(account.executor())), accounts: Mutex::new(accounts), - strategy: Mutex::new(Box::new(Strat { + strategy: Mutex::new(Box::new(Burst { tokens: HashMap::new(), })), })) diff --git a/src/strategy/strat.rs b/src/strategy/burst.rs similarity index 81% rename from src/strategy/strat.rs rename to src/strategy/burst.rs index 5a7ed87..08ae730 100644 --- a/src/strategy/strat.rs +++ b/src/strategy/burst.rs @@ -3,15 +3,26 @@ use std::{collections::HashMap, sync::Arc}; use crate::{ bot::Bot, strategy::Strategy, - types::{Mode, NewToken, Token, Trade}, + types::{NewToken, Trade}, }; -pub struct Strat { +pub enum Mode { + Observing, + WaitingForEntry, + WaitingForExit, +} + +pub struct Token { + pub mode: Mode, + pub execute_next: bool, +} + +pub struct Burst { pub tokens: HashMap, } #[async_trait::async_trait] -impl Strategy for Strat { +impl Strategy for Burst { async fn on_new_coin(&mut self, bot: Arc, token: NewToken) -> anyhow::Result<()> { self.tokens.insert( token.mint.clone(), diff --git a/src/strategy/mod.rs b/src/strategy/mod.rs index 3e47490..166c113 100644 --- a/src/strategy/mod.rs +++ b/src/strategy/mod.rs @@ -1,4 +1,4 @@ -pub mod strat; +pub mod burst; use std::sync::Arc; diff --git a/src/types.rs b/src/types.rs index 05243ec..918b9d5 100644 --- a/src/types.rs +++ b/src/types.rs @@ -73,17 +73,6 @@ pub struct NewToken { pub sol_amount: f64, } -pub enum Mode { - Observing, - WaitingForEntry, - WaitingForExit, -} - -pub struct Token { - pub mode: Mode, - pub execute_next: bool, -} - #[derive(Debug, Clone, Deserialize)] pub enum TradeType { #[serde(rename = "buy")]