DFlow spot routing
Use this when the owner wants to swap a token on Solana and wants the best route. Everything goes through the keyless proxy https://musebook-proxy.mynameisjeffspicoli.workers.dev, which adds the DFlow API key on the server. Never ask the owner for a DFlow key and never call quote-api.dflow.net directly.
Routes
Use these proxy routes:
GET /api/trade/dflow/order?inputMint&outputMint&amount&slippageBps&userPublicKey. This is live today. It returns the quote plus an unsigned transaction for userPublicKey.
GET /api/trade/quote?inputMint&outputMint&amount&slippageBps. This races Jupiter and DFlow and returns the winner.
GET /api/trade/dflow/order-status?signature=...
- These routes are coming once the proxy deploy lands:
GET /api/dflow/quote, /api/dflow/order, /api/dflow/order-status, /api/dflow/tokens, /api/dflow/tokens-with-decimals, /api/dflow/venues, /api/dflow/priority-fees
POST /api/dflow/swap and /api/dflow/swap-instructions, with body {quoteResponse, userPublicKey}
GET /api/dflow/markets, /events, /series for prediction-market reads
- If a
/api/dflow/* route returns 404, fall back to the /api/trade/dflow/* routes.
amount is in base units, so 0.01 SOL is 10000000. The SOL mint is So11111111111111111111111111111111111111112 and the USDC mint is EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.
Flow
- Resolve both mints and their decimals. Check that the owner's wallet has enough balance.
- Get a DFlow quote and a Jupiter quote (
/api/trade/quote) with the same amount and slippage. Pick the higher outAmount, and say which venue won and by how much.
- Show the owner:
- the expected output and the minimum output (
otherAmountThreshold)
- the effective price
priceImpactPct
- the slippage, which defaults to 800 bps (8%). The allowed range is 5–10% unless the owner says otherwise.
- the route venues
For pump.fun tokens, also show market cap in SOL and graduation %. Warn when graduation is over 90%, when liquidity is thin, when price impact is over 3%, or when the curve looks drained.
- Build the unsigned transaction with
/api/trade/dflow/order (or /api/dflow/swap), using the owner's public key.
- Simulate the transaction with
simulateTransaction via POST /api/solana/rpc, using sigVerify:false and replaceRecentBlockhash:true. Report any errors and the expected balance changes.
- Return the base64 transaction for the owner to review and sign in their own wallet. After they send it, track it with order-status.
Rules
- Never sign, broadcast or submit an intent yourself. Never use
/api/trade/execute or /api/trade/broadcast on the owner's behalf.
- The bot's OWS wallet stays observe-only until the owner sets a policy with a spend limit and a scoped key.
- Requote if the quote is more than 30 seconds old. The proxy allows about 60 requests per minute per IP, so back off on a 429.
1---2name: pumpfun-dflow3description: "DFlow spot routing for pumpfun. Quote, build an unsigned swap through the keyless Musebook proxy, compare against Jupiter, simulate, and hand the transaction to the owner to sign. Never signs or broadcasts."4metadata:5 source: https://skillmd.com/skills/solizardking/pumpfun-dflow6---78# DFlow spot routing910Use this when the owner wants to swap a token on Solana and wants the best route. Everything goes through the keyless proxy `https://musebook-proxy.mynameisjeffspicoli.workers.dev`, which adds the DFlow API key on the server. Never ask the owner for a DFlow key and never call quote-api.dflow.net directly.1112## Routes13Use these proxy routes:14- `GET /api/trade/dflow/order?inputMint&outputMint&amount&slippageBps&userPublicKey`. This is live today. It returns the quote plus an unsigned `transaction` for `userPublicKey`.15- `GET /api/trade/quote?inputMint&outputMint&amount&slippageBps`. This races Jupiter and DFlow and returns the winner.16- `GET /api/trade/dflow/order-status?signature=...`17- These routes are coming once the proxy deploy lands:18 - `GET /api/dflow/quote`, `/api/dflow/order`, `/api/dflow/order-status`, `/api/dflow/tokens`, `/api/dflow/tokens-with-decimals`, `/api/dflow/venues`, `/api/dflow/priority-fees`19 - `POST /api/dflow/swap` and `/api/dflow/swap-instructions`, with body `{quoteResponse, userPublicKey}`20 - `GET /api/dflow/markets`, `/events`, `/series` for prediction-market reads21- If a `/api/dflow/*` route returns 404, fall back to the `/api/trade/dflow/*` routes.2223`amount` is in base units, so 0.01 SOL is `10000000`. The SOL mint is `So11111111111111111111111111111111111111112` and the USDC mint is `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`.2425## Flow261. Resolve both mints and their decimals. Check that the owner's wallet has enough balance.272. Get a DFlow quote and a Jupiter quote (`/api/trade/quote`) with the same amount and slippage. Pick the higher `outAmount`, and say which venue won and by how much.283. Show the owner:29 - the expected output and the minimum output (`otherAmountThreshold`)30 - the effective price31 - `priceImpactPct`32 - the slippage, which defaults to 800 bps (8%). The allowed range is 5–10% unless the owner says otherwise.33 - the route venues34 For pump.fun tokens, also show market cap in SOL and graduation %. Warn when graduation is over 90%, when liquidity is thin, when price impact is over 3%, or when the curve looks drained.354. Build the unsigned transaction with `/api/trade/dflow/order` (or `/api/dflow/swap`), using the owner's public key.365. Simulate the transaction with `simulateTransaction` via `POST /api/solana/rpc`, using `sigVerify:false` and `replaceRecentBlockhash:true`. Report any errors and the expected balance changes.376. Return the base64 transaction for the owner to review and sign in their own wallet. After they send it, track it with order-status.3839## Rules40- Never sign, broadcast or submit an intent yourself. Never use `/api/trade/execute` or `/api/trade/broadcast` on the owner's behalf.41- The bot's OWS wallet stays observe-only until the owner sets a policy with a spend limit and a scoped key.42- Requote if the quote is more than 30 seconds old. The proxy allows about 60 requests per minute per IP, so back off on a 429.