diff --git a/src/executor/mod.rs b/src/executor/mod.rs index 7d998ca..cd835f7 100644 --- a/src/executor/mod.rs +++ b/src/executor/mod.rs @@ -4,6 +4,6 @@ use solana_sdk::pubkey::Pubkey; #[allow(async_fn_in_trait)] pub trait Executor { - async fn buy(&self, token: Pubkey, amount: f64) -> anyhow::Result<()>; - async fn sell(&self, token: Pubkey, amount: f64) -> anyhow::Result<()>; + async fn buy(&self, token: Pubkey, amount: u64) -> anyhow::Result<()>; + async fn sell(&self, token: Pubkey, amount: u64) -> anyhow::Result<()>; } diff --git a/src/executor/pump_fun.rs b/src/executor/pump_fun.rs index d0a5cf9..4037fe9 100644 --- a/src/executor/pump_fun.rs +++ b/src/executor/pump_fun.rs @@ -1,4 +1,6 @@ -use pump_rust_client::PumpSdk; +use pump_rust_client::{ + AccountWrapper, PumpSdk, pump::pump::accounts::BondingCurve, state::Global, +}; use crate::executor::Executor; @@ -7,16 +9,20 @@ pub const PROGRAM_ID: &str = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; pub struct PumpFun { pub private_key: String, pub sdk: PumpSdk, + + pub global: Global, } impl Executor for PumpFun { - async fn buy(&self, token: solana_sdk::pubkey::Pubkey, amount: f64) -> anyhow::Result<()> { + async fn buy(&self, token: solana_sdk::pubkey::Pubkey, amount: u64) -> anyhow::Result<()> { log::info!("Buying {token}"); + // let bonding_curve: AccountWrapper = _; + // self.sdk.buy_v2_instructions( - // global, - // bonding_curve, - // base_mint, + // &self.global, + // &bonding_curve, + // token, // quote_token_program, // user, // amount, @@ -26,7 +32,7 @@ impl Executor for PumpFun { Ok(()) } - async fn sell(&self, token: solana_sdk::pubkey::Pubkey, amount: f64) -> anyhow::Result<()> { + async fn sell(&self, token: solana_sdk::pubkey::Pubkey, amount: u64) -> anyhow::Result<()> { log::info!("Selling {token}"); Ok(())