From 5447dd27186cfb3e48a863c88cdb99385ab5edcc Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Fri, 7 Aug 2026 20:30:55 +0200 Subject: [PATCH] Using solana rpc for new tokens for credit saving --- src/launchpad/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/launchpad/mod.rs b/src/launchpad/mod.rs index 24aa7b6..d5a9142 100644 --- a/src/launchpad/mod.rs +++ b/src/launchpad/mod.rs @@ -16,6 +16,7 @@ pub struct Client( pub struct Executor { pub client: Arc, + pub new_tokens_client: Arc, pub pump_fun: Mutex, } @@ -59,6 +60,12 @@ impl Executor { .0, ))), + new_tokens_client: Arc::new(Client(Mutex::new( + tokio_tungstenite::connect_async(format!("wss://api.mainnet-beta.solana.com")) + .await? + .0, + ))), + pump_fun: Mutex::new(PumpFun::new()), })) } @@ -109,7 +116,7 @@ impl Executor { pub async fn listen(self: &Arc) -> anyhow::Result> { let (tx, rx) = mpsc::channel(100); - tokio::spawn(PumpFun::listen(self.client.clone(), tx)); + tokio::spawn(PumpFun::listen(self.new_tokens_client.clone(), tx)); Ok(rx) }