From 18c769f7e3a06fc8a18e5808d4da6bfcffbd28d2 Mon Sep 17 00:00:00 2001 From: vibes Date: Tue, 6 Jan 2026 10:36:05 +0000 Subject: [PATCH] Add use_exact_in_instruction to TradeBuyParams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass through the new field from TradeBuyParams to SwapParams so users can opt-in to using buy_exact_sol_in and buy_exact_quote_in instructions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 46f24eb..dfdd41c 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -187,6 +187,10 @@ pub struct TradeBuyParams { pub gas_fee_strategy: GasFeeStrategy, /// Whether to simulate the transaction instead of executing it pub simulate: bool, + /// Use exact input instructions (buy_exact_sol_in for PumpFun, buy_exact_quote_in for PumpSwap). + /// When true, the exact SOL/quote amount is spent and slippage is applied to output tokens. + /// When false (default), uses regular buy instruction where slippage is applied to SOL/quote input. + pub use_exact_in_instruction: bool, } /// Parameters for executing sell orders across different DEX protocols @@ -508,7 +512,7 @@ impl TradingClient { fixed_output_amount: params.fixed_output_token_amount, gas_fee_strategy: params.gas_fee_strategy, simulate: params.simulate, - use_exact_in_instruction: false, + use_exact_in_instruction: params.use_exact_in_instruction, }; // Validate protocol params