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")]