feat: bonding_curve is transmitted from the outside

This commit is contained in:
wei
2025-06-18 17:39:20 +08:00
parent fa941174c2
commit 2303a4c1e6
4 changed files with 15 additions and 16 deletions
+1 -16
View File
@@ -51,20 +51,7 @@ impl InstructionBuilder for PumpFunInstructionBuilder {
)
.await?
} else {
let (bonding_curve, _) =
get_bonding_curve_account_v2(&PumpFun::get_instance().get_rpc(), &params.mint)
.await?;
Arc::new(BondingCurveAccount {
discriminator: bonding_curve.discriminator,
account: get_bonding_curve_pda(&params.mint).unwrap(),
virtual_token_reserves: bonding_curve.virtual_token_reserves,
virtual_sol_reserves: bonding_curve.virtual_sol_reserves,
real_token_reserves: bonding_curve.real_token_reserves,
real_sol_reserves: bonding_curve.real_sol_reserves,
token_total_supply: bonding_curve.token_total_supply,
complete: bonding_curve.complete,
creator: params.creator,
})
protocol_params.bonding_curve.clone().unwrap()
};
let max_sol_cost = calculate_with_slippage_buy(
@@ -108,8 +95,6 @@ impl InstructionBuilder for PumpFunInstructionBuilder {
},
));
println!("max_sol_cost: {:?}", max_sol_cost);
Ok(instructions)
}