jupiter-swap-migration
它能做什么
本指南展示如何把现有的 Jupiter 兑换代码,从旧的 Metis v1 或 Ultra 端点更新到统一的 Swap API v2。它说明新的基础地址和端点变化,适合兑换代码已失效或需要升级的开发者。
适用场景
- ✓当你的应用仍在调用旧的 Jupiter v1 报价或兑换指令端点时。
- ✓当 API 变更后,你的 Jupiter 兑换功能停止工作的时候。
- ✓当你需要从 Ultra 端点迁移到较新的订单或构建端点的时候。
技能链接
https://github.com/internet-court/internet-court-skill/blob/main/vendored/jupiter/jupiter-swap-migration/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Jupiter 兑换功能因为调用了旧的 v1 报价端点而失效了,我该如何迁移到 v2?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在你的代码中找到旧的调用,更新基础地址,并切换到统一的构建或订单端点。该技能列出了需要检查的已重命名参数和响应变化。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Jupiter Swap Migration Guide
Migrate existing Jupiter swap integrations from Metis (v1) or Ultra to the unified Swap API v2.
Target Base URL: https://api.jup.ag/swap/v2
Auth: x-api-key from developers.jup.ag (unchanged)
Use/Do Not Use
Use when:
- Migrating code that calls
api.jup.ag/swap/v1/quote,api.jup.ag/swap/v1/swap-instructions, orultra-api.jup.ag. - Updating Jupiter swap endpoints to v2.
- Switching from Metis two-step flow to the unified
/buildor/orderendpoint.
Do not use when:
- Building a new Jupiter integration from scratch (use
integrating-jupiterskill instead). - Working with non-swap Jupiter APIs (Lend, Trigger, Recurring, etc.).
Triggers: ultra, metis, ultra swap, ultra api, ultra-api.jup.ag, /ultra/v1, swap/v1, swap-instructions, migrate swap, ultra migration, metis migration, swap v1 to v2, v1 to v2, upgrade jupiter, swap-instructions deprecated, deprecated swap, old jupiter api, swap upgrade, update swap api, quote endpoint deprecated, swap stopped working, swap broken, ExactOut removed, swapMode removed, userPublicKey, parameter rename, addressLookupTable, response format changed
Migration Paths
| Source | Target | Effort | When to choose |
|---|---|---|---|
Ultra → /order |
GET /swap/v2/order + POST /swap/v2/execute |
Minimal (URL change only) | Default for Ultra users |
Metis → /build |
GET /swap/v2/build |
Moderate (parameter + response mapping) | Need transaction composability |
Metis → /order |
GET /swap/v2/order + POST /swap/v2/execute |
Moderate (flow change) | Don't need tx modification, want managed execution |
Path Details
Each path has a dedicated example with before/after code, parameter mappings, and response changes:
- Path 1: Ultra →
/order— Minimal migration, base URL change only - Path 2: Metis →
/build— Consolidates 2 calls into 1, parameter and response mapping - Path 3: Metis →
/order— Flow change to managed execution with multi-router competition
Post-Migration Checklist
- URL audit: Search codebase for
ultra-api.jup.ag,/ultra/v1/,/swap/v1/quote,/swap/v1/swap-instructions— all should be replaced - Parameter rename:
userPublicKey→taker(for/buildpath) swapModeremoval: V2 only supportsExactIn. If usingExactOut, redesign the flow — this mode is no longer availableslippageBpsdefault:/builddefaults to 50 bps if omitted. For/order, verify the default if your integration relies on a specific value- Response field names: Verify your code uses
inputAmountResult/outputAmountResultfor the/executeresponse (the canonical v2 field names) - ALT handling: If using
/build, switch fromaddressLookupTableAddresses(array) toaddressesByLookupTableAddress(object) — remove RPC ALT resolution code - Fee event parsing: V2 instructions don't emit fee events — update any transaction parser that depends on them
- Route plan format: If parsing route plans, use
bpsfield (canonical) instead ofpercent - Error codes: Update error handling to match Swap v2 error codes
- Test: Run end-to-end swap on devnet/mainnet with small amount to verify
Sunset
Remove this skill once Jupiter decommissions the v1 (/swap/v1) endpoints and the Ultra (ultra-api.jup.ag) domain. At that point all integrations will already be on v2.
Review by: 2026-09-01 — check if v1/Ultra endpoints have been decommissioned.
References
Migration is split into three profile-targeted guides (the old single migration page no longer exists):
常见问题
本指南适用于全新的 Jupiter 集成吗?
不适用。对于新代码,该技能会引导你查看通用的 Jupiter 集成指南。
迁移过程中 API 密钥会改变吗?
不会。该技能说明 x-api-key 请求头保持不变。
旧代码中哪些部分最容易出问题?
已重命名的参数、已移除的选项(例如 ExactOut 和 swapMode),以及已改变的响应格式。
详情
作者的原始描述
Migration guide from Jupiter Metis (v1) or Ultra to Swap API v2. Use when migrating existing Jupiter swap integrations, updating base URLs, or transitioning from quote+swap-instructions to the unified build endpoint.
热度
- GitHub 星标
- 7.0k
- 排名
- #13635
- 许可证
- —
- 更新时间
- 2026/10/26
评论
- …
同一仓库的更多技能
internet-court
7.0k帮你的智能体安全地向其他 AI 智能体或付费服务付款、雇用或进行交易,并指引它找到合适的专业指南。
genlayer-erc7710-connector
7.0k帮你的智能体把 AI 审核结果与权限系统连接起来,使不合格的审核可以限制或取消智能体的权限。
genlayer-intelligent-contracts
7.0k帮你的智能体定义 AI 裁判的规则、证据和输出,用于检查另一个智能体是否遵循了其授权范围。
x402-erc7710
7.0k帮你的智能体按次为网络服务付款,并设置在权限预算范围内的持续支出。