Skip to content

feat(solana-solvers): PR 2.2 buy orders via Jupiter v1 API#4637

Merged
squadgazzz merged 1 commit into
mainfrom
solana-solvers/PR2.2-buy-orders
Jul 20, 2026
Merged

feat(solana-solvers): PR 2.2 buy orders via Jupiter v1 API#4637
squadgazzz merged 1 commit into
mainfrom
solana-solvers/PR2.2-buy-orders

Conversation

@squadgazzz

@squadgazzz squadgazzz commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Buy-order support for the Jupiter solver, split out from PR2 and gated off by default. Both sides share the v1 path: PR2 quotes sells with ExactIn, this adds ExactOut for buys. Stacked on PR2.

Changes

  • enable_buy_orders config flag, off by default. While off, buy orders return OrderNotSupported.
  • swap() picks swapMode per side: ExactIn for sells, ExactOut for buys. Same /swap/v1/quote + /swap-instructions path and DTO as sells, no new response type.

How to test

New unit test (buy gated off). Live #[ignore] buy test (ExactOut): cargo test -p solana-solvers -- --ignored jupiter_live (keyless works, JUPITER_API_KEY optional).

@squadgazzz
squadgazzz force-pushed the solana-solvers/PR2.2-buy-orders branch 2 times, most recently from 636bc46 to 742b0ac Compare July 17, 2026 17:22
@squadgazzz
squadgazzz force-pushed the solana-solvers/PR2-jupiter-adapter branch from 3ca086e to 66b0a05 Compare July 20, 2026 08:18
@squadgazzz
squadgazzz force-pushed the solana-solvers/PR2.2-buy-orders branch 4 times, most recently from fa36489 to 7c5a64e Compare July 20, 2026 10:47
@squadgazzz
squadgazzz marked this pull request as ready for review July 20, 2026 10:55
@squadgazzz
squadgazzz requested a review from a team as a code owner July 20, 2026 10:55
@claude

claude Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Claude finished @squadgazzz's task in 1m 42s —— View job


PR Review: buy orders via v1 ExactOut

  • Read diff against origin/solana-solvers/PR2-jupiter-adapter
  • Review config.rs, mod.rs, dto.rs, and call sites
  • Post findings

Verdict: LGTM. The change is small, focused, and correctly gated. The SwapMode enum reads better than the previous stringly-typed &str, buy orders remain rejected with OrderNotSupported while the flag is off, and both sides share the same /quote + /swap-instructions path and DTO as advertised. Config default (#[serde(default)], off) and the renamed tests are all consistent.

No change-worthy issues to flag inline.

One non-blocking observation for a later PR (not this one — /solve is still a scaffold so swap() isn't wired into solving yet): for ExactOut, slippageBps bounds the input, so the actual sell amount can exceed the quoted inAmount by up to the slippage. Swap.in_amount here is the quoted mid input, not the worst case. When solution accounting is wired up, whoever reserves sell tokens will need the slippage-adjusted max rather than the quoted in_amount (the mirror concern exists for sells' out_amount). Worth keeping in mind, nothing to do here.

Note: I couldn't run cargo check/tests in this environment (command approval denied), but the change is mechanical (enum + config field + test rename) and reads as compiling correctly.
· solana-solvers/PR2.2-buy-orders

@squadgazzz squadgazzz changed the title feat(solana-solvers): PR 2.2 buy orders via v1 ExactOut feat(solana-solvers): PR 2.2 buy orders via Jupiter v1 API Jul 20, 2026
@squadgazzz
squadgazzz force-pushed the solana-solvers/PR2.2-buy-orders branch from 7c5a64e to 2d8f70c Compare July 20, 2026 11:48
Base automatically changed from solana-solvers/PR2-jupiter-adapter to main July 20, 2026 16:51
@squadgazzz
squadgazzz force-pushed the solana-solvers/PR2.2-buy-orders branch from 2d8f70c to 3ef61f5 Compare July 20, 2026 17:08
@squadgazzz
squadgazzz enabled auto-merge July 20, 2026 17:13
@squadgazzz
squadgazzz added this pull request to the merge queue Jul 20, 2026
Merged via the queue into main with commit 5e4ac3d Jul 20, 2026
22 checks passed
@squadgazzz
squadgazzz deleted the solana-solvers/PR2.2-buy-orders branch July 20, 2026 17:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants