Skip to content

Bump deps and improve getRecentPriorityFee for Orca#68

Merged
0xh3rman merged 5 commits intomainfrom
mayan-jito-fix
Feb 11, 2026
Merged

Bump deps and improve getRecentPriorityFee for Orca#68
0xh3rman merged 5 commits intomainfrom
mayan-jito-fix

Conversation

@0xh3rman
Copy link
Collaborator

@0xh3rman 0xh3rman commented Feb 10, 2026

No description provided.

Introduce Jito tipping utilities and wire them into Solana swap flow, plus improve priority-fee retrieval.

- Add packages/swapper/src/chain/solana/jito.ts: new JITO_TIP_ACCOUNTS, fetchTipFloorLamports(), getJitoBudget(), and createJitoTipInstruction() to compute/construct Jito tips (with a minimum tip fallback and recommended split logic).
- Add tests packages/swapper/src/mayan/solana.test.ts covering getJitoBudget() behavior and createJitoTipInstruction() correctness.
- Update tx_builder.ts: let getRecentPriorityFee accept lockedWritableAccounts when calling connection.getRecentPrioritizationFees(), and use the desired percentile index (with bounds) when computing a recommended fee.
- Wire Jito into swap construction (mayan/solana.ts): fetch tip floor earlier, append a Jito tip transfer when applicable, then fetch recent blockhash and build the MessageV0 with the swapper as fee payer. Adjust imports accordingly.
- Update orca/provider.ts to pass the Whirlpool program address as a locked writable account when querying recent priority fees.

These changes enable optional on-chain tipping to Jito, make priority-fee estimation respect locked accounts and percentile selection, and include unit tests for the new Jito helpers.
@semanticdiff-com
Copy link

semanticdiff-com bot commented Feb 10, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  packages/swapper/src/orca/provider.ts  58% smaller
  packages/swapper/src/chain/solana/tx_builder.ts  31% smaller
  pnpm-lock.yaml  19% smaller
  AGENTS.md Unsupported file format
  package.json  0% smaller
  packages/swapper/package.json  0% smaller
  packages/swapper/src/mayan/solana.ts  0% smaller

@gemini-code-assist
Copy link

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 integrates Jito tipping into the Solana transaction building process, specifically for Mayan swaps. The primary goal is to enable users to include Jito tip instructions, which can help prioritize their transactions on the Solana blockchain. The changes involve adding new Jito-specific utilities, updating how priority fees are calculated, and ensuring these new instructions are correctly incorporated into versioned transactions, while acknowledging that Jito instructions are currently only compatible with legacy messages for Mayan.

Highlights

  • Jito Tipping Integration: Introduced Jito tipping functionality for Solana transactions, including utilities to fetch tip floor, calculate budgets, and create tip instructions. This allows for priority transaction processing on the Solana network.
  • Mayan Swap Transaction Updates: Modified the Mayan Solana swap transaction builder to incorporate Jito tip instructions, ensuring that Jito instructions are added to transactions where applicable. The fee payer for these transactions was also explicitly set to the swapper's public key.
  • Priority Fee Calculation Enhancement: Enhanced the getRecentPriorityFee function to accept lockedWritableAccounts, allowing for more accurate priority fee estimation, and adjusted the calculation to use a percentile-based approach instead of a simple median.
  • Dependency Updates: Updated several core Solana-related dependencies, including @orca-so/whirlpools-client, @solana/spl-token, and @solana/web3.js, along with development dependencies like ts-jest.

🧠 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
  • package.json
    • Updated ts-jest dependency from 29.4.5 to 29.4.6.
  • packages/swapper/package.json
    • Updated @orca-so/whirlpools-client from 6.0.0 to 6.2.0.
    • Updated @solana/spl-token from 0.4.13 to 0.4.14.
    • Updated @solana/web3.js from 1.98.0 to 1.98.4.
  • packages/swapper/src/chain/solana/jito.ts
    • Added a new file containing constants for Jito tip accounts.
    • Added fetchTipFloorLamports function to retrieve the current Jito tip floor.
    • Added getJitoBudget function to calculate Jito tip and priority micro-lamports.
    • Added createJitoTipInstruction function to generate a Solana SystemProgram transfer instruction for Jito tips.
  • packages/swapper/src/chain/solana/tx_builder.ts
    • Imported PublicKey from @solana/web3.js.
    • Modified getRecentPriorityFee to accept an optional lockedWritableAccounts parameter for more precise fee estimation.
    • Adjusted the priority fee calculation to use a percentile-based approach instead of a median.
  • packages/swapper/src/mayan/solana.test.ts
    • Added a new test file for Jito-related functionalities.
    • Included tests for getJitoBudget to verify priority fee splitting and minimum enforcement.
    • Added tests for createJitoTipInstruction to ensure correct instruction creation and target tip accounts.
  • packages/swapper/src/mayan/solana.ts
    • Imported createJitoTipInstruction and fetchTipFloorLamports for Jito integration.
    • Integrated Jito tip instruction into the prepareSolanaSwapTransaction function, conditionally adding a tip if tipLamports is greater than zero.
    • Updated the payerKey and feePayer to use the swapper's public key.
  • packages/swapper/src/orca/provider.ts
    • Imported WHIRLPOOL_PROGRAM_ADDRESS from @orca-so/whirlpools-client.
    • Modified getRecentPriorityFee call to include WHIRLPOOL_PROGRAM_ADDRESS as a lockedWritableAccount for Orca Whirlpool transactions.
  • pnpm-lock.yaml
    • Updated various package resolutions, including ts-jest, @orca-so/whirlpools-client, @solana/spl-token, and @solana/web3.js.
    • Removed @babel/runtime@7.27.0, @noble/curves@1.8.1, @noble/hashes@1.7.1, @types/ws@8.18.0, regenerator-runtime@0.14.1, and ws@8.18.1 entries.
    • Added new package resolutions for @solana/codecs-core@2.3.0, @solana/codecs-numbers@2.3.0, and @solana/errors@2.3.0.
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.

Copy link

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

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 introduces Jito tipping for Mayan swaps on Solana. It adds a new jito.ts utility file for fetching tip data and creating tip instructions, and integrates this into the Mayan swap flow. The changes also include updating Solana dependencies and improving priority fee estimation. My review focuses on a potential critical issue regarding the safety of adding instructions to Mayan's versioned transactions, as well as opportunities for performance and type safety improvements in the new Jito utility functions.

Cache JITO tip account PublicKey instances and use node:crypto.randomInt for selection instead of recreating PublicKey objects on each call. Add a JitoTipFloorEntry interface and cast the fetched JSON to improve typing for fetchTipFloorLamports. Also add the required randomInt import. These changes reduce allocations and improve type safety when creating Jito tip transfer instructions.
@0xh3rman 0xh3rman changed the title Insert Jito instruction for Mayan Bump deps and improve getRecentPriorityFee for Orca Feb 11, 2026
@0xh3rman 0xh3rman merged commit e60355b into main Feb 11, 2026
4 checks passed
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