Skip to content

internet-court/internet-court-skill / vendored/jupiter/jupiter-swap-migration

jupiter-swap-migration

Verified

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.

FileKindSize
LICENSEother1.0 KB
README.mdmarkdown1.1 KB
SKILL.mdskill md4.8 KB
examples/metis-to-build.mdmarkdown4.2 KB
examples/metis-to-order.mdmarkdown2.4 KB
examples/ultra-to-order.mdmarkdown2.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.
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 implementationStars: 323kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 323kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 323kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 323kUpdated Claude CodeCodexVerifiedInstall