[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78BXRGRRRJ58EWZCE2DCXC7":3,"skill-same:01M78BXRGRRRJ58EWZCE2DCXC7":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M78BXRGRRRJ58EWZCE2DCXC7","dflow-spot-trading",null,"Swap any pair of Solana tokens via DFlow. Use when the user wants to trade, swap, or convert tokens on Solana, get a price quote, build a swap UI, tune priority fees so a swap lands under congestion, or build a gasless \u002F sponsored swap where the app pays fees. Covers both the `dflow` CLI and the DFlow Trading API. Do NOT use for Kalshi prediction-market YES\u002FNO trades or builder-side platform fees.","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fdflow-spot-trading\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dflow-spot-trading\ndescription: Swap any pair of Solana tokens via DFlow. Use when the user wants to trade, swap, or convert tokens on Solana, get a price quote, build a swap UI, tune priority fees so a swap lands under congestion, or build a gasless \u002F sponsored swap where the app pays fees. Covers both the `dflow` CLI and the DFlow Trading API. Do NOT use for Kalshi prediction-market YES\u002FNO trades or builder-side platform fees.\n---\n\n# DFlow Spot Trading\n\nSwap any pair of Solana tokens via DFlow. Imperative trades (the default) settle synchronously in one transaction; declarative trades are opt-in for users who explicitly want better execution.\n\n## Prerequisites\n\n- **DFlow docs MCP** (`https:\u002F\u002Fpond.dflow.net\u002Fmcp`) — install per the [repo README](..\u002F..\u002FREADME.md#recommended-install-the-dflow-docs-mcp). This skill is the recipe; the MCP is the reference. Look up endpoint shapes, parameter details, error codes, and anything else field-level via `search_d_flow` \u002F `query_docs_filesystem_d_flow` — don't guess.\n- **`dflow` CLI** (optional, for command-line\u002Fagent use) — install per the [repo README](..\u002F..\u002FREADME.md#recommended-install-the-dflow-cli).\n\n## Choose your surface\n\n- **CLI** — command line, scripts, local agents. Manages keys, signs, broadcasts.\n- **API** — web\u002Fmobile apps, backends, automations with their own wallet\u002Fsigner. Browser apps must proxy HTTP through their backend (the Trading API serves no CORS).\n\nIf unclear, ask once: *\"From the command line, or wired into an app?\"*\n\n## Workflows\n\n### Quote (read-only)\n\n- CLI: `dflow quote \u003Catomic-amount> \u003CFROM> \u003CTO>`\n- API: `GET \u002Forder` doubles as a quote — *including without a `userPublicKey`*, in which case it returns all price fields with no transaction attached. Use this for live-quote UIs before the user has connected a wallet. Don't reach for `\u002Fquote` separately; it's the older surface and the docs redirect back to `\u002Forder`.\n\n### Trade — imperative `\u002Forder` (the default)\n\nSingle round-trip: get a quote and a signed-ready `VersionedTransaction` together; sign, submit, confirm. Fully synchronous. Works with **all** SPL + Token-2022 mints.\n\n- CLI: `dflow trade \u003Catomic-amount> \u003CFROM> \u003CTO>` (add `--confirm` for agents\u002Fscripts that need to block until confirmed).\n- API: `GET \u002Forder?userPublicKey=&inputMint=&outputMint=&amount=`, deserialize `transaction` (base64) → `VersionedTransaction`, sign + broadcast, confirm against the blockhash DFlow signed with. **Two broadcast idioms — pick the one that matches your context:**\n  - **Browser wallet-adapter app (the default for UIs).** `const sig = await wallet.sendTransaction(tx, connection)`. The wallet signs *and* broadcasts through its own RPC — your `connection` only needs to serve reads (`confirmTransaction`).\n  - **Node script \u002F server-side signing with a `Keypair`.** Two-step: `tx.sign([keypair])` → `connection.sendRawTransaction(tx.serialize())`. Your RPC is what broadcasts; a public endpoint will 403.\n\n  **The full browser-adapter happy path, end to end:**\n\n```ts\nconst { transaction, lastValidBlockHeight } = await fetch(\"\u002Fapi\u002Forder?...\").then(r => r.json());\nconst tx = VersionedTransaction.deserialize(Buffer.from(transaction, \"base64\"));\nconst sig = await sendTransaction(tx, connection);          \u002F\u002F wallet's RPC\nawait connection.confirmTransaction(                         \u002F\u002F app's RPC (reads only)\n  { signature: sig, blockhash: tx.message.recentBlockhash, lastValidBlockHeight },\n  \"confirmed\",\n);\n```\n\n  **Where each `\u002Forder` response field goes** (don't re-derive these locally — DFlow owns the authoritative value):\n\n  - `transaction` (base64) → `VersionedTransaction.deserialize` → `wallet.sendTransaction` (browser) or `connection.sendRawTransaction` (Node).\n  - `lastValidBlockHeight` → `connection.confirmTransaction`, paired with `tx.message.recentBlockhash` from the deserialized tx. **Never** a fresh `getLatestBlockhash` (see Gotchas).\n  - `inAmount` \u002F `outAmount` \u002F `otherAmountThreshold` \u002F `priceImpactPct` \u002F `slippageBps` → display.\n  - `prioritizationFeeLamports` \u002F `prioritizationType` → echo \u002F logging. The server-resolved priority-fee choice after `\"auto\"` resolution.\n  - `contextSlot` → logging \u002F staleness checks.\n  - `routePlan` → optional display \u002F debugging.\n\n  Fields marked *\"Specified if and only if the request included the user's public key\"* in the OpenAPI (`transaction`, `lastValidBlockHeight`, `computeUnitLimit`, `prioritizationFeeLamports`, `addressLookupTables`) are absent on quote-only calls — check before using.\n\n  Full runnable example (server-side `Keypair` variant): [`\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade`](https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade) (links to the DFlow Cookbook Repo). Field-level schema details via the docs MCP.\n\n### Trade — declarative `\u002Fintent` + `\u002Fsubmit-intent` (opt-in)\n\nUser signs an intent (asset pair, slippage, min-out); DFlow picks the route at execution time and fills via Jito bundles. Sells on: less slippage, better pricing, sandwich protection.\n\n**Hard restriction:** `\u002Fintent` does **not** support Token-2022 mints. Verify both mints are SPL before suggesting; otherwise stay on `\u002Forder`.\n\nOnly suggest declarative when the user explicitly asks for sandwich protection or \"best execution.\" Recipe details (intent shape, polling) via the docs MCP.\n\n## What to ASK the user (and what NOT to ask)\n\n**Trade shape — infer if unambiguous, confirm if not:**\n\n1. **Input + output token** — base58 mint addresses. The CLI resolves a small symbol set (SOL, USDC, USDT, JUP, BONK, etc.); **the API has no symbol resolver** — base58 mints only.\n2. **Amount in atomic units of the input token** — `500_000` = $0.50 USDC, `1_000_000_000` = 1 SOL. Convert before calling.\n\n**Infra — always ask, never infer:**\n\n3. **API only — wallet pubkey** (base58). Required for every `\u002Forder` call.\n4. **API only — DFlow API key** (only when the script is making direct HTTP calls to `\u002Forder` or `\u002Fquote`; pure CLI scripts don't need one — see the \"two auth paths\" gotcha). **Ask with a clean, neutral question: *\"Do you have a DFlow API key?\"*** Don't presuppose where the key lives — phrasings like *\"do you have it in env?\"* or *\"is `DFLOW_API_KEY` set?\"* nudge the user toward env-var defaults they didn't ask for. Surface the choice; don't silently fall back to env or to dev. It's **one key for everything DFlow** — same `x-api-key` unlocks the Trade API *and* the Metadata API, REST *and* WebSocket. If yes → prod host `https:\u002F\u002Fquote-api.dflow.net` with `x-api-key` on every request. If no → dev host `https:\u002F\u002Fdev-quote-api.dflow.net` (same features, rate-limited). Point them at `https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Fapi-key` for a prod key. **When you generate a script that does its own HTTP, log the resolved host + key-presence at startup** so the user can see which rails they're on.\n5. **Priority fee (both surfaces)** — \"Any priority-fee preference, or just use DFlow's default?\" Default on both surfaces = DFlow-auto, capped at 0.005 SOL (documented default on `\u002Forder`). Surface this explicitly so the user knows the lever exists for congestion \u002F cost-sensitive trades. Don't editorialize about what percentage of trades this covers — DFlow doesn't publish one and you don't know.\n   - **API** — pass `prioritizationFeeLamports` on `\u002Forder`: `auto` | `medium` | `high` | `veryHigh` | `disabled` | integer lamports. On `\u002Fintent` (declarative), roll the priority fee into `feeBudget = priority + 10_000` (the 10,000-lamport base processing fee). Live estimates for tuning: `GET \u002Fpriority-fees` (snapshot), `\u002Fpriority-fees\u002Fstream` (WebSocket).\n   - **CLI** — no tuning flag; `dflow trade` always uses the server-side default. If the user needs finer control (an exact lamport value, or `disabled`), they'll have to drop to the API.\n6. **Sponsored \u002F gasless (API only — skip for CLI)** — \"Does the user need to hold SOL for this trade, or is your app covering fees?\" Default = user pays. To sponsor, pass `sponsor=\u003Csponsor-wallet-base58>` on `\u002Forder` and co-sign the returned transaction with the sponsor keypair (both user and sponsor sign). Optional `sponsorExec=true|false` picks sponsor-executes (default) vs. user-executes. The CLI doesn't support sponsorship at all.\n\n**Do NOT ask about:**\n\n- **RPC** — CLI users set it during `dflow setup`. Browser wallet-adapter apps using `wallet.sendTransaction(tx, connection)` don't need their own RPC for the broadcast — the wallet handles it (see the broadcast-path Gotcha). Only ask when signing server-side (Node + `Keypair`), polling declarative trades, or when the app is explicitly going low-level with `connection.sendRawTransaction` in the browser. When one is needed, suggest [Helius](https:\u002F\u002Fhelius.dev).\n- **Slippage** — both surfaces default to `\"auto\"`. Override only on explicit user request (`--slippage` CLI; `slippageBps` API).\n- **Platform fee, DEX inclusion\u002Fexclusion, route length, Jito bundles, direct-only routes** — defaults are right for typical swaps; only surface these knobs on explicit user need. For platform fees specifically, defer to `dflow-platform-fees` if the user pivots there.\n\n## Gotchas (the docs MCP won't volunteer these)\n\n- **Atomic units always.** API rejects human-readable amounts. Confirm decimals each time — token metadata or RPC `getParsedAccountInfo`.\n- **API has no symbol resolver.** The CLI has a small allow-list; the API only accepts base58 mints. Don't assume `\"USDC\"` works on `\u002Forder`.\n- **Browser apps must proxy.** Trading API serves no CORS — call it from a backend (Next.js API route or equivalent), never directly from the browser.\n- **Two broadcast paths in browser apps; pick the right one.** In `@solana\u002Fwallet-adapter-react`, `wallet.sendTransaction(tx, connection)` delegates to the wallet's `signAndSendTransaction` — Phantom and most major wallets route the broadcast through their own RPC, so the app's `Connection` only needs to work for reads (`confirmTransaction`). A public `mainnet-beta` endpoint is fine for that. The low-level two-step (`signTransaction(tx)` + `connection.sendRawTransaction(signed.serialize())`) sends through *the app's* RPC — and public endpoints reliably 403 on `sendTransaction`. **Default to `wallet.sendTransaction` in browser apps**; drop to the two-step only when you need to inspect or modify the signed bytes before broadcast. Server-side signing (Node + `Keypair`) is always two-step, because there's no wallet adapter to delegate to — and there you do need a real RPC.\n- **Wire wallets via Wallet Standard auto-discovery, not per-wallet adapters.** Pass `wallets={[]}` to `\u003CWalletProvider>`. Modern Phantom \u002F Solflare \u002F Backpack \u002F Glow \u002F etc. implement the Wallet Standard protocol and are auto-detected at runtime — no explicit adapter instances needed. **Do not** instantiate `new PhantomWalletAdapter()` \u002F `new SolflareWalletAdapter()` from `@solana\u002Fwallet-adapter-wallets`; those are pre-Wallet-Standard shims, and the kicker is the `useWallet()` React surface looks identical either way — same `sendTransaction`, same `publicKey`. But underneath, the legacy adapter's `sendTransaction` silently downgrades to `signTransaction` + `connection.sendRawTransaction` through *your* app's RPC, re-introducing the public-RPC 403 the previous gotcha just fixed. Empty-array auto-discovery also lets you drop the `@solana\u002Fwallet-adapter-wallets` dep (and its `@walletconnect\u002F*` \u002F `pino-pretty` tail).\n- **Confirm against the blockhash DFlow signed with — never a fresh one.** The blockhash is on the deserialized transaction: `tx.message.recentBlockhash`. Pair it with `lastValidBlockHeight` from the `\u002Forder` response. **Never call `connection.getLatestBlockhash()` for confirmation.** It's wrong two ways: (1) semantically — a freshly-fetched blockhash can be past the `lastValidBlockHeight` DFlow returned, so `confirmTransaction` times out on a transaction that actually landed; (2) operationally — public `mainnet-beta` now 403s `getLatestBlockhash`, and `@solana\u002Fweb3.js` surfaces that as `\"failed to get recent blockhash: ...\"`, which falsely looks like you're using the deprecated `getRecentBlockhash`. The right pattern is in the code sketch under the `\u002Forder` workflow above.\n- **Declarative ≠ Token-2022.** `\u002Fintent` rejects Token-2022 mints. Stay on `\u002Forder` for those (which is the default for everyone anyway).\n- **`route_not_found` is often a units or mint mistake before it's a liquidity issue.** Before assuming no route exists, double-check you're passing atomic units (not human-readable amounts) and the mint addresses are correct.\n- **`price_impact_too_high` is real.** Trade size exceeds available liquidity; reduce `amount`, or pass `priceImpactTolerancePct` only with the user's explicit consent.\n- **Onchain failure with slippage logs.** Don't silently bump `slippageBps` on retry — surface to the user.\n- **CLI shell-outs authenticate themselves; direct HTTP calls don't.** If your script or backend shells out to `dflow trade`, that leg uses the CLI's stored config from `dflow setup` (key, wallet, RPC) — **you plumb nothing** for CLI invocations. If the same script *also* hits the Trade API or Metadata API directly over HTTP (e.g. scanner-style discovery, your own `\u002Forder` call, `\u002Fquote`), that HTTP client needs the key handed in explicitly (env var, `.env`, `--api-key` flag, header). The CLI's stored key is not reusable by a sibling HTTP client, and an env-var key is not injected into the CLI either — they're independent plumbing sites for the same DFlow key. **Only ask about an API key for the HTTP portion; pure CLI scripts don't need one.**\n\n## When something doesn't fit\n\nFor anything not covered above — full parameter lists, full error tables, declarative intent shape, legacy `\u002Fquote` + `\u002Fswap` flow, sponsorship fields, new features — query the docs MCP (`search_d_flow`, `query_docs_filesystem_d_flow`). Don't guess.\n\nFor runnable code, point the user at the **DFlow docs recipes** (each links to the DFlow Cookbook Repo for clone-and-go): [`\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade`](https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade), [`\u002Fbuild\u002Frecipes\u002Ftrading\u002Fdeclarative-trade`](https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Frecipes\u002Ftrading\u002Fdeclarative-trade).\n\n## Sibling skills\n\nDefer if the user pivots to:\n\n- `dflow-kalshi-trading` — Kalshi prediction-market YES\u002FNO trades\n- `dflow-platform-fees` — charge a builder cut on swaps\n","# DFlow Spot Trading\n\nSwap any pair of Solana tokens via DFlow. Imperative trades (the default) settle synchronously in one transaction; declarative trades are opt-in for users who explicitly want better execution.\n\n## Prerequisites\n\n- **DFlow docs MCP** (`https:\u002F\u002Fpond.dflow.net\u002Fmcp`) — install per the [repo README](..\u002F..\u002FREADME.md#recommended-install-the-dflow-docs-mcp). This skill is the recipe; the MCP is the reference. Look up endpoint shapes, parameter details, error codes, and anything else field-level via `search_d_flow` \u002F `query_docs_filesystem_d_flow` — don't guess.\n- **`dflow` CLI** (optional, for command-line\u002Fagent use) — install per the [repo README](..\u002F..\u002FREADME.md#recommended-install-the-dflow-cli).\n\n## Choose your surface\n\n- **CLI** — command line, scripts, local agents. Manages keys, signs, broadcasts.\n- **API** — web\u002Fmobile apps, backends, automations with their own wallet\u002Fsigner. Browser apps must proxy HTTP through their backend (the Trading API serves no CORS).\n\nIf unclear, ask once: *\"From the command line, or wired into an app?\"*\n\n## Workflows\n\n### Quote (read-only)\n\n- CLI: `dflow quote \u003Catomic-amount> \u003CFROM> \u003CTO>`\n- API: `GET \u002Forder` doubles as a quote — *including without a `userPublicKey`*, in which case it returns all price fields with no transaction attached. Use this for live-quote UIs before the user has connected a wallet. Don't reach for `\u002Fquote` separately; it's the older surface and the docs redirect back to `\u002Forder`.\n\n### Trade — imperative `\u002Forder` (the default)\n\nSingle round-trip: get a quote and a signed-ready `VersionedTransaction` together; sign, submit, confirm. Fully synchronous. Works with **all** SPL + Token-2022 mints.\n\n- CLI: `dflow trade \u003Catomic-amount> \u003CFROM> \u003CTO>` (add `--confirm` for agents\u002Fscripts that need to block until confirmed).\n- API: `GET \u002Forder?userPublicKey=&inputMint=&outputMint=&amount=`, deserialize `transaction` (base64) → `VersionedTransaction`, sign + broadcast, confirm against the blockhash DFlow signed with. **Two broadcast idioms — pick the one that matches your context:**\n  - **Browser wallet-adapter app (the default for UIs).** `const sig = await wallet.sendTransaction(tx, connection)`. The wallet signs *and* broadcasts through its own RPC — your `connection` only needs to serve reads (`confirmTransaction`).\n  - **Node script \u002F server-side signing with a `Keypair`.** Two-step: `tx.sign([keypair])` → `connection.sendRawTransaction(tx.serialize())`. Your RPC is what broadcasts; a public endpoint will 403.\n\n  **The full browser-adapter happy path, end to end:**\n\n```ts\nconst { transaction, lastValidBlockHeight } = await fetch(\"\u002Fapi\u002Forder?...\").then(r => r.json());\nconst tx = VersionedTransaction.deserialize(Buffer.from(transaction, \"base64\"));\nconst sig = await sendTransaction(tx, connection);          \u002F\u002F wallet's RPC\nawait connection.confirmTransaction(                         \u002F\u002F app's RPC (reads only)\n  { signature: sig, blockhash: tx.message.recentBlockhash, lastValidBlockHeight },\n  \"confirmed\",\n);\n```\n\n  **Where each `\u002Forder` response field goes** (don't re-derive these locally — DFlow owns the authoritative value):\n\n  - `transaction` (base64) → `VersionedTransaction.deserialize` → `wallet.sendTransaction` (browser) or `connection.sendRawTransaction` (Node).\n  - `lastValidBlockHeight` → `connection.confirmTransaction`, paired with `tx.message.recentBlockhash` from the deserialized tx. **Never** a fresh `getLatestBlockhash` (see Gotchas).\n  - `inAmount` \u002F `outAmount` \u002F `otherAmountThreshold` \u002F `priceImpactPct` \u002F `slippageBps` → display.\n  - `prioritizationFeeLamports` \u002F `prioritizationType` → echo \u002F logging. The server-resolved priority-fee choice after `\"auto\"` resolution.\n  - `contextSlot` → logging \u002F staleness checks.\n  - `routePlan` → optional display \u002F debugging.\n\n  Fields marked *\"Specified if and only if the request included the user's public key\"* in the OpenAPI (`transaction`, `lastValidBlockHeight`, `computeUnitLimit`, `prioritizationFeeLamports`, `addressLookupTables`) are absent on quote-only calls — check before using.\n\n  Full runnable example (server-side `Keypair` variant): [`\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade`](https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade) (links to the DFlow Cookbook Repo). Field-level schema details via the docs MCP.\n\n### Trade — declarative `\u002Fintent` + `\u002Fsubmit-intent` (opt-in)\n\nUser signs an intent (asset pair, slippage, min-out); DFlow picks the route at execution time and fills via Jito bundles. Sells on: less slippage, better pricing, sandwich protection.\n\n**Hard restriction:** `\u002Fintent` does **not** support Token-2022 mints. Verify both mints are SPL before suggesting; otherwise stay on `\u002Forder`.\n\nOnly suggest declarative when the user explicitly asks for sandwich protection or \"best execution.\" Recipe details (intent shape, polling) via the docs MCP.\n\n## What to ASK the user (and what NOT to ask)\n\n**Trade shape — infer if unambiguous, confirm if not:**\n\n1. **Input + output token** — base58 mint addresses. The CLI resolves a small symbol set (SOL, USDC, USDT, JUP, BONK, etc.); **the API has no symbol resolver** — base58 mints only.\n2. **Amount in atomic units of the input token** — `500_000` = $0.50 USDC, `1_000_000_000` = 1 SOL. Convert before calling.\n\n**Infra — always ask, never infer:**\n\n3. **API only — wallet pubkey** (base58). Required for every `\u002Forder` call.\n4. **API only — DFlow API key** (only when the script is making direct HTTP calls to `\u002Forder` or `\u002Fquote`; pure CLI scripts don't need one — see the \"two auth paths\" gotcha). **Ask with a clean, neutral question: *\"Do you have a DFlow API key?\"*** Don't presuppose where the key lives — phrasings like *\"do you have it in env?\"* or *\"is `DFLOW_API_KEY` set?\"* nudge the user toward env-var defaults they didn't ask for. Surface the choice; don't silently fall back to env or to dev. It's **one key for everything DFlow** — same `x-api-key` unlocks the Trade API *and* the Metadata API, REST *and* WebSocket. If yes → prod host `https:\u002F\u002Fquote-api.dflow.net` with `x-api-key` on every request. If no → dev host `https:\u002F\u002Fdev-quote-api.dflow.net` (same features, rate-limited). Point them at `https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Fapi-key` for a prod key. **When you generate a script that does its own HTTP, log the resolved host + key-presence at startup** so the user can see which rails they're on.\n5. **Priority fee (both surfaces)** — \"Any priority-fee preference, or just use DFlow's default?\" Default on both surfaces = DFlow-auto, capped at 0.005 SOL (documented default on `\u002Forder`). Surface this explicitly so the user knows the lever exists for congestion \u002F cost-sensitive trades. Don't editorialize about what percentage of trades this covers — DFlow doesn't publish one and you don't know.\n   - **API** — pass `prioritizationFeeLamports` on `\u002Forder`: `auto` | `medium` | `high` | `veryHigh` | `disabled` | integer lamports. On `\u002Fintent` (declarative), roll the priority fee into `feeBudget = priority + 10_000` (the 10,000-lamport base processing fee). Live estimates for tuning: `GET \u002Fpriority-fees` (snapshot), `\u002Fpriority-fees\u002Fstream` (WebSocket).\n   - **CLI** — no tuning flag; `dflow trade` always uses the server-side default. If the user needs finer control (an exact lamport value, or `disabled`), they'll have to drop to the API.\n6. **Sponsored \u002F gasless (API only — skip for CLI)** — \"Does the user need to hold SOL for this trade, or is your app covering fees?\" Default = user pays. To sponsor, pass `sponsor=\u003Csponsor-wallet-base58>` on `\u002Forder` and co-sign the returned transaction with the sponsor keypair (both user and sponsor sign). Optional `sponsorExec=true|false` picks sponsor-executes (default) vs. user-executes. The CLI doesn't support sponsorship at all.\n\n**Do NOT ask about:**\n\n- **RPC** — CLI users set it during `dflow setup`. Browser wallet-adapter apps using `wallet.sendTransaction(tx, connection)` don't need their own RPC for the broadcast — the wallet handles it (see the broadcast-path Gotcha). Only ask when signing server-side (Node + `Keypair`), polling declarative trades, or when the app is explicitly going low-level with `connection.sendRawTransaction` in the browser. When one is needed, suggest [Helius](https:\u002F\u002Fhelius.dev).\n- **Slippage** — both surfaces default to `\"auto\"`. Override only on explicit user request (`--slippage` CLI; `slippageBps` API).\n- **Platform fee, DEX inclusion\u002Fexclusion, route length, Jito bundles, direct-only routes** — defaults are right for typical swaps; only surface these knobs on explicit user need. For platform fees specifically, defer to `dflow-platform-fees` if the user pivots there.\n\n## Gotchas (the docs MCP won't volunteer these)\n\n- **Atomic units always.** API rejects human-readable amounts. Confirm decimals each time — token metadata or RPC `getParsedAccountInfo`.\n- **API has no symbol resolver.** The CLI has a small allow-list; the API only accepts base58 mints. Don't assume `\"USDC\"` works on `\u002Forder`.\n- **Browser apps must proxy.** Trading API serves no CORS — call it from a backend (Next.js API route or equivalent), never directly from the browser.\n- **Two broadcast paths in browser apps; pick the right one.** In `@solana\u002Fwallet-adapter-react`, `wallet.sendTransaction(tx, connection)` delegates to the wallet's `signAndSendTransaction` — Phantom and most major wallets route the broadcast through their own RPC, so the app's `Connection` only needs to work for reads (`confirmTransaction`). A public `mainnet-beta` endpoint is fine for that. The low-level two-step (`signTransaction(tx)` + `connection.sendRawTransaction(signed.serialize())`) sends through *the app's* RPC — and public endpoints reliably 403 on `sendTransaction`. **Default to `wallet.sendTransaction` in browser apps**; drop to the two-step only when you need to inspect or modify the signed bytes before broadcast. Server-side signing (Node + `Keypair`) is always two-step, because there's no wallet adapter to delegate to — and there you do need a real RPC.\n- **Wire wallets via Wallet Standard auto-discovery, not per-wallet adapters.** Pass `wallets={[]}` to `\u003CWalletProvider>`. Modern Phantom \u002F Solflare \u002F Backpack \u002F Glow \u002F etc. implement the Wallet Standard protocol and are auto-detected at runtime — no explicit adapter instances needed. **Do not** instantiate `new PhantomWalletAdapter()` \u002F `new SolflareWalletAdapter()` from `@solana\u002Fwallet-adapter-wallets`; those are pre-Wallet-Standard shims, and the kicker is the `useWallet()` React surface looks identical either way — same `sendTransaction`, same `publicKey`. But underneath, the legacy adapter's `sendTransaction` silently downgrades to `signTransaction` + `connection.sendRawTransaction` through *your* app's RPC, re-introducing the public-RPC 403 the previous gotcha just fixed. Empty-array auto-discovery also lets you drop the `@solana\u002Fwallet-adapter-wallets` dep (and its `@walletconnect\u002F*` \u002F `pino-pretty` tail).\n- **Confirm against the blockhash DFlow signed with — never a fresh one.** The blockhash is on the deserialized transaction: `tx.message.recentBlockhash`. Pair it with `lastValidBlockHeight` from the `\u002Forder` response. **Never call `connection.getLatestBlockhash()` for confirmation.** It's wrong two ways: (1) semantically — a freshly-fetched blockhash can be past the `lastValidBlockHeight` DFlow returned, so `confirmTransaction` times out on a transaction that actually landed; (2) operationally — public `mainnet-beta` now 403s `getLatestBlockhash`, and `@solana\u002Fweb3.js` surfaces that as `\"failed to get recent blockhash: ...\"`, which falsely looks like you're using the deprecated `getRecentBlockhash`. The right pattern is in the code sketch under the `\u002Forder` workflow above.\n- **Declarative ≠ Token-2022.** `\u002Fintent` rejects Token-2022 mints. Stay on `\u002Forder` for those (which is the default for everyone anyway).\n- **`route_not_found` is often a units or mint mistake before it's a liquidity issue.** Before assuming no route exists, double-check you're passing atomic units (not human-readable amounts) and the mint addresses are correct.\n- **`price_impact_too_high` is real.** Trade size exceeds available liquidity; reduce `amount`, or pass `priceImpactTolerancePct` only with the user's explicit consent.\n- **Onchain failure with slippage logs.** Don't silently bump `slippageBps` on retry — surface to the user.\n- **CLI shell-outs authenticate themselves; direct HTTP calls don't.** If your script or backend shells out to `dflow trade`, that leg uses the CLI's stored config from `dflow setup` (key, wallet, RPC) — **you plumb nothing** for CLI invocations. If the same script *also* hits the Trade API or Metadata API directly over HTTP (e.g. scanner-style discovery, your own `\u002Forder` call, `\u002Fquote`), that HTTP client needs the key handed in explicitly (env var, `.env`, `--api-key` flag, header). The CLI's stored key is not reusable by a sibling HTTP client, and an env-var key is not injected into the CLI either — they're independent plumbing sites for the same DFlow key. **Only ask about an API key for the HTTP portion; pure CLI scripts don't need one.**\n\n## When something doesn't fit\n\nFor anything not covered above — full parameter lists, full error tables, declarative intent shape, legacy `\u002Fquote` + `\u002Fswap` flow, sponsorship fields, new features — query the docs MCP (`search_d_flow`, `query_docs_filesystem_d_flow`). Don't guess.\n\nFor runnable code, point the user at the **DFlow docs recipes** (each links to the DFlow Cookbook Repo for clone-and-go): [`\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade`](https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Frecipes\u002Ftrading\u002Fimperative-trade), [`\u002Fbuild\u002Frecipes\u002Ftrading\u002Fdeclarative-trade`](https:\u002F\u002Fpond.dflow.net\u002Fbuild\u002Frecipes\u002Ftrading\u002Fdeclarative-trade).\n\n## Sibling skills\n\nDefer if the user pivots to:\n\n- `dflow-kalshi-trading` — Kalshi prediction-market YES\u002FNO trades\n- `dflow-platform-fees` — charge a builder cut on swaps\n",{"name":5,"description":7},"main","be3de0244dc1a57e323d8160787ebb40fb64930e","skills\u002Fdflow-spot-trading","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Solizardking\u002Fskillhub-main --skill dflow-spot-trading",{"tool":39,"command":40},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill dflow-spot-trading",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill dflow-spot-trading","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fdflow-spot-trading\u002FSKILL.md",true,[],[48,55,62,69,76,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]