Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

Update Jupiter v6 and remove auto-slippage - #950

Merged
0xh3rman merged 1 commit into
mainfrom
jupiter-token-2022
Feb 15, 2026
Merged

0xh3rman merged 1 commit into
mainfrom
jupiter-token-2022

Conversation

@0xh3rman

@0xh3rman 0xh3rman commented Feb 14, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #947

Update models and provider to align with Jupiter v6:

  • replace auto_slippage/max_auto_slippage_bps with an instruction_version field in QuoteRequest/QuoteResponse
  • remove DynamicSlippage and dynamic_slippage usage, and pass a constant INSTRUCTION_VERSION ("V2") when requesting quotes.
  • Adjust provider logic to use swap_quote.slippage_bps directly and remove computed auto-slippage handling.
  • Also change Solana default slippage mode to Exact (with increased bps) in config.

Tested txs:

Update models and provider to align with Jupiter API V2: replace auto_slippage/max_auto_slippage_bps with an instruction_version field in QuoteRequest/QuoteResponse, remove DynamicSlippage and dynamic_slippage usage, and pass a constant INSTRUCTION_VERSION ("V2") when requesting quotes. Adjust provider logic to use swap_quote.slippage_bps directly and remove computed auto-slippage handling. Also change Solana default slippage mode to Exact (with increased bps) in config.
@semanticdiff-com

semanticdiff-com Bot commented Feb 14, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/swapper/src/jupiter/model.rs  5% smaller
  crates/swapper/src/jupiter/provider.rs  3% smaller
  crates/swapper/src/config.rs  0% smaller

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @0xh3rman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the Jupiter integration by adapting to the v6 API changes. The primary goal is to streamline how slippage is handled, moving away from an auto-slippage mechanism to a more explicit instruction version. This change simplifies the API interaction and ensures compatibility with the latest Jupiter features, improving the reliability and clarity of swap operations.

Highlights

  • Jupiter v6 API Alignment: Updated Jupiter API models and provider logic to align with the Jupiter v6 specification, specifically by replacing auto-slippage fields with an instruction version.
  • Slippage Handling Refactor: Removed auto_slippage and max_auto_slippage_bps fields from QuoteRequest and computed_auto_slippage from QuoteResponse, introducing an instruction_version field instead. The DynamicSlippage struct and its usage were also removed.
  • Constant Instruction Version: Implemented a constant INSTRUCTION_VERSION ('V2') to be passed when requesting quotes from Jupiter, standardizing the instruction version used.
  • Direct Slippage Usage: Adjusted the provider logic to directly use swap_quote.slippage_bps from the Jupiter response, eliminating previous computed auto-slippage handling.
  • Solana Default Slippage: Changed the default slippage mode for Solana from Auto to Exact in the configuration, while maintaining an increased base points (bps).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • crates/swapper/src/config.rs
    • Changed Solana's default slippage mode from Auto to Exact.
  • crates/swapper/src/jupiter/model.rs
    • Replaced auto_slippage and max_auto_slippage_bps fields with instruction_version in QuoteRequest.
    • Removed computed_auto_slippage and added instruction_version to QuoteResponse.
    • Deleted the DynamicSlippage struct.
    • Removed the dynamic_slippage field from QuoteDataRequest.
  • crates/swapper/src/jupiter/provider.rs
    • Removed DynamicSlippage import.
    • Added INSTRUCTION_VERSION constant for Jupiter API calls.
    • Updated get_swap_quote to use instruction_version instead of auto_slippage and max_auto_slippage_bps.
    • Modified get_swap_quote to directly use swap_quote.slippage_bps for the final quote.
    • Removed dynamic_slippage handling from get_swap_quote_data.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully updates the Jupiter provider to align with its v6 API. The changes correctly replace the deprecated auto-slippage functionality with the instruction_version field in the request and response models. The related logic for DynamicSlippage and computed_auto_slippage has been properly removed. Additionally, the default slippage mode for Solana is updated to Exact, which is consistent with the removal of auto-slippage features. The code modifications are clean, well-contained, and directly address the requirements of the Jupiter v6 migration. The changes look good to me.

@0xh3rman
0xh3rman merged commit 70228f9 into main Feb 15, 2026
3 of 4 checks passed
@0xh3rman
0xh3rman deleted the jupiter-token-2022 branch February 15, 2026 08:46
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.

Jupiter (Metis) swap api update

2 participants