Skip to content

feat(solana-solvers): PR 2 Jupiter v1 swap adapter (sells)#4635

Open
squadgazzz wants to merge 17 commits into
mainfrom
solana-solvers/PR2-jupiter-adapter
Open

feat(solana-solvers): PR 2 Jupiter v1 swap adapter (sells)#4635
squadgazzz wants to merge 17 commits into
mainfrom
solana-solvers/PR2-jupiter-adapter

Conversation

@squadgazzz

@squadgazzz squadgazzz commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Second PR of the Jupiter solver. Adds the adapter that turns one order into an executable Solana swap by calling Jupiter's v1 swap API, so later PRs can assemble solutions and run the solve loop. The solver holds no liquidity: for each order it asks Jupiter for a swap and returns the instructions. Builds on PR1. /solve stays a scaffold until PR3/4 wire the adapter in.

Changes

  • New dex module with Solana-native Order, Side, and Swap types (u64 amounts, Pubkey mints, instructions).
  • Jupiter adapter chaining GET /swap/v1/quote?swapMode=ExactIn then POST /swap/v1/swap-instructions, returning amounts, instructions (setup, swap, cleanup), and the lookup-table addresses the driver needs for the v0 transaction.
  • Sells only. Buy orders return OrderNotSupported, buys land in PR2.2.
  • Swap output goes to the settlement's buy-mint buffer (destinationTokenAccount), resolved upstream and passed in. FinalizeSettle pushes it to the user.
  • Provider boundary: api.jup.ag, or a Triton-hosted endpoint (same v1 API), a config base-URL and key swap.
  • Adds reqwest, solana-sdk, base64, thiserror.

How to test

New unit tests (buy rejection, response parsing). Also an #[ignore] live sell test: cargo test -p solana-solvers -- --ignored jupiter_live (keyless works, JUPITER_API_KEY optional).

Notes

  • Stacked on PR1 (solana-solvers/PR1-skeleton), review that first.
  • taker is the driver's settlement signer, supplied at solve time in PR4.
  • We use v1, not the newer /swap/v2/build, so a Triton-hosted endpoint stays a drop-in failover. Triton runs v1/Metis only.
  • Part of the Jupiter solver plan (specs PR cowprotocol/solana-services-specifications#33).

@squadgazzz squadgazzz changed the title feat(solana-solvers): PR 2 Jupiter /swap-instructions adapter feat(solana-solvers): PR 2 Jupiter Swap V2 /build adapter Jul 17, 2026
@linear-code

linear-code Bot commented Jul 17, 2026

Copy link
Copy Markdown

BE-103

@squadgazzz squadgazzz changed the title feat(solana-solvers): PR 2 Jupiter Swap V2 /build adapter feat(solana-solvers): PR 2 Jupiter v1 swap adapter (sells) Jul 17, 2026
@squadgazzz
squadgazzz marked this pull request as ready for review July 17, 2026 17:14
@squadgazzz
squadgazzz requested a review from a team as a code owner July 17, 2026 17:14
…o solana-solvers/PR2-jupiter-adapter

# Conflicts:
#	crates/solana-solvers/config/example.jupiter.toml
Base automatically changed from solana-solvers/PR1-skeleton to main July 17, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant