Skip to content

refactor: remove jupiter swapper (replaced by relay)#12265

Merged
kaladinlight merged 3 commits into
developfrom
remove-jupiter-swapper
Apr 9, 2026
Merged

refactor: remove jupiter swapper (replaced by relay)#12265
kaladinlight merged 3 commits into
developfrom
remove-jupiter-swapper

Conversation

@kaladinlight
Copy link
Copy Markdown
Member

@kaladinlight kaladinlight commented Apr 9, 2026

Description

Remove the Jupiter swapper entirely — Relay (which uses Jupiter under the hood) has fully replaced it.

Deleted:

  • packages/swapper/src/swappers/JupiterSwapper/ — full implementation (swapper, endpoints, IDL, helpers, constants)
  • headers/csps/jupiter.ts — CSP config for Jupiter API
  • src/components/.../SwapperIcon/jupiter-icon.svg — icon asset
  • src/constants/urls.ts — only contained Jupiter URLs

Removed from config/state:

  • SwapperName.Jupiter enum member and all switch/record branches
  • JupiterSwap feature flag (preferencesSlice, config.ts, vite-env.d.ts, .env, mock store)
  • VITE_JUPITER_API_URL from swapper config type, app config, public-api config/env
  • jupiterQuoteResponse field from trade step type
  • Jupiter-specific protocol fee validation in validateTradeQuote.ts
  • @jup-ag/api dependency from swapper package and root pnpm override
  • isSolBuyAssetId parameter from getEnabledSwappers (only used by Jupiter)
  • Jupiter entries from CSP index, swap-widget icons/colors, public-api rates

Relocated:

  • COMPUTE_UNIT_MARGIN_MULTIPLIER → inlined in solana-utils/getUnsignedSolanaTransaction.ts (still needed by Relay)
  • SolanaLogsError → moved to packages/swapper/src/utils.ts (still needed by error handling UI)

Risk

Medium — removes a swapper that is already superseded by Relay. No new on-chain transaction types introduced. Relay continues to handle all Solana swaps.

Solana swaps via Relay are unaffected. No other protocols, wallets, or contract interactions change.

Testing

Engineering

  • Verify Solana swaps still work via Relay
  • Verify type-check and lint pass (confirmed locally)
  • Verify no references to SwapperName.Jupiter remain in source

Operations

  • Confirm Solana swaps execute correctly in preview (routed through Relay)
  • Confirm no UI references to "Jupiter" appear in the swap flow

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Removed Features
    • Jupiter is no longer available as a swap provider option in the application

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kaladinlight kaladinlight requested a review from a team as a code owner April 9, 2026 16:15
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d655f652-908a-4715-b55d-f053ed478452

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request removes all Jupiter swapper integration from the codebase, including the Jupiter API dependency, environment variables, feature flags, type definitions, and all Jupiter-specific implementations across swapper, widget, and main application layers.

Changes

Cohort / File(s) Summary
Environment & Dependencies
.env, package.json, packages/swapper/package.json, packages/public-api/.env.example
Removed Jupiter feature flag, API dependency pins, and JUPITER_API_URL environment variable entries.
Type Definitions & Enums
packages/swap-widget/src/types/index.ts, packages/swapper/src/types.ts, src/vite-env.d.ts
Removed SwapperName.Jupiter enum member, VITE_JUPITER_API_URL config property, VITE_FEATURE_JUPITER_SWAP environment typing, and jupiterQuoteResponse field from TradeQuoteStep.
Jupiter Swapper Implementation
packages/swapper/src/swappers/JupiterSwapper/...
Removed entire Jupiter swapper module including JupiterSwapper.ts, endpoints.ts, errorPatterns.ts, idls/referral.ts, and all helper utilities (helpers.ts, constants.ts, jupiterService.ts).
Swapper API Functions
packages/swapper/src/swappers/JupiterSwapper/swapperApi/getTradeRate.ts, packages/swapper/src/swappers/JupiterSwapper/swapperApi/getTradeQuote.ts
Removed Jupiter trade-rate and trade-quote API implementations that handled quote fetching, fee computation, and swap instruction generation.
Swapper Registry & Exports
packages/swapper/src/index.ts, packages/swapper/src/constants.ts, headers/csps/index.ts, headers/csps/jupiter.ts
Removed Jupiter swapper registry entries, re-exports from index, and CSP module for Jupiter API connectivity.
Configuration & URLs
src/constants/urls.ts, src/config.ts, packages/public-api/src/config.ts, packages/public-api/src/env.ts
Removed JUPITER_BASE_API_URL and JUPITER_API_URL constants, and Jupiter API URL configuration validators.
Swapper Selection & State
src/state/helpers.ts, src/state/slices/preferencesSlice/preferencesSlice.ts, src/test/mocks/store.ts
Removed Jupiter from enabled swapper logic, cross-account support checks, feature-flag type, and mock store state.
API Query Logic
src/state/apis/swapper/swapperApi.ts, src/state/apis/swapper/selectors.ts, src/state/apis/swapper/helpers/validateTradeQuote.ts, src/state/slices/tradeQuoteSlice/selectors.ts
Removed Jupiter-specific query filters, parameters, and validation branches; updated enabled-swapper selector signatures.
UI Components & Display
packages/swap-widget/src/constants/swappers.ts, src/components/MultiHopTrade/components/TradeInput/components/SwapperIcon/SwapperIcon.tsx
Removed Jupiter icon SVG mapping, color definition, and UI component case handling.
Utility Relocation
packages/swapper/src/utils.ts, packages/swapper/src/solana-utils/getUnsignedSolanaTransaction.ts
Added SolanaLogsError class to main utils; moved COMPUTE_UNIT_MARGIN_MULTIPLIER constant from Jupiter module to local usage in transaction utility.
Rate Query Updates
packages/public-api/src/routes/rates/getRates.ts
Removed Jupiter from enabled swapper names in rate-query endpoint.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 A Swift Farewell to Jupiter's Light

Out goes the swapper, the code bids goodbye,
Jupiter's endpoints now graze in the sky.
With rm and delete, we trim down the tree,
Constants and queries dissolve, now set free!
No more cross-checking those Solana pathways—
Our codebase springs forward in cleaner-edged ways! 🌙✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: removing the Jupiter swapper implementation in favor of the Relay swapper.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-jupiter-swapper

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

kaladinlight and others added 2 commits April 9, 2026 10:17
@kaladinlight kaladinlight merged commit 2e4be48 into develop Apr 9, 2026
4 checks passed
@kaladinlight kaladinlight deleted the remove-jupiter-swapper branch April 9, 2026 17:02
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