internet-court/internet-court-skill / vendored/jupiter/jupiter-swap-migration
jupiter-swap-migration
VerifiedMigration 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.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.0 KB |
| README.md | markdown | 1.1 KB |
| SKILL.md | skill md | 4.8 KB |
| examples/metis-to-build.md | markdown | 4.2 KB |
| examples/metis-to-order.md | markdown | 2.4 KB |
| examples/ultra-to-order.md | markdown | 2.1 KB |
examples/ultra-to-order.md
View on GitHub# Path 1: Ultra → Swap v2 `/order`
**Effort**: Minimal — only the base URL changes. Parameters are identical; `/execute` response fields are renamed (see below).
| Element | Before | After |
|---------|--------|-------|
| Base URL | `https://ultra-api.jup.ag` | `https://api.jup.ag/swap/v2` |
| Order endpoint | `GET /order` | `GET /order` (unchanged) |
| Execute endpoint | `POST /execute` | `POST /execute` (unchanged) |
## Before
```typescript
const BASE_URL = "https://ultra-api.jup.ag";
const order = await fetch(`${BASE_URL}/order?` + new URLSearchParams({
inputMint: SOL_MINT,
outputMint: USDC_MINT,
amount: "100000000",
taker: walletAddress,
}), { headers: { "x-api-key": API_KEY } }).then(r => r.json());
// ... sign transaction ...
const result = await fetch(`${BASE_URL}/execute`, {
method: "POST",
headers: { "Content-Type": "application/json", "x-api-key": API_KEY },
body: JSON.stringify({ signedTransaction, requestId: order.requestId }),
}).then(r => r.json());
```
## After
```typescript
const BASE_URL = "https://api.jup.ag/swap/v2"; // ← only change
const order = await fetch(`${BASE_URL}/order?` + new URLSearchParams({
inputMint: SOL_MINT,
outputMint: USDC_MINT,
amount: "100000000",
taker: walletAddress,
}), { headers: { "x-api-key": API_KEY } }).then(r => r.json());
// ... sign transaction ...
const result = await fetch(`${BASE_URL}/execute`, {
method: "POST",
headers: { "Content-Type": "application/json", "x-api-key": API_KEY },
body: JSON.stringify({ signedTransaction, requestId: order.requestId }),
}).then(r => r.json());
```
## New response fields
The v2 `/order` response now also includes:
- `router` — which router won: `"metis"`, `"jupiterz"`, `"dflow"`, or `"okx"`
- `mode` — `"ultra"` (all routers competed) or `"manual"` (optional params restricted routing)
- `feeBps` — fee basis points applied
- `feeMint` — mint of the fee token
**Breaking change**: V2 `/execute` renames `inputAmount` → `inputAmountResult` and `outputAmount` → `outputAmountResult`. Update all callers that read these fields.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |