Add buy_exact_sol_in and buy_exact_quote_in instruction support

- Add BUY_EXACT_SOL_IN_DISCRIMINATOR for PumpFun
- Add BUY_EXACT_QUOTE_IN_DISCRIMINATOR for PumpSwap
- Add use_exact_in_instruction field to SwapParams
- When enabled, uses exact input instructions that spend exactly the
  specified SOL/quote amount with slippage applied to output tokens
- Defaults to false for backwards compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
vibes
2026-01-06 10:32:56 +00:00
co-authored by Claude Opus 4.5
parent e12c45cc4c
commit 16996b24d4
6 changed files with 52 additions and 10 deletions
+4
View File
@@ -67,6 +67,10 @@ pub struct SwapParams {
pub fixed_output_amount: Option<u64>,
pub gas_fee_strategy: GasFeeStrategy,
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,
}
impl std::fmt::Debug for SwapParams {