Skip to main content
During development, you can use the developer endpoints without an API key. For production use, you’ll need an API key to avoid rate limits.
Priority fees only affect when a trade executes. They do not change routing, slippage checks, or trade semantics (what priority fees do not affect). How DFlow handles priority fees details the two modes.
1

Choose your priority fee mode

Use max priority fee for adaptive speed (server selects a fee up to your cap), or exact priority fee when you need predictable costs.
2

Apply priority fees to your request

Set prioritizationFeeLamports on the /order request as either a lamport value or one of auto, medium, high, veryHigh, disabled.
const queryParams = new URLSearchParams();
queryParams.append("inputMint", SOL);
queryParams.append("outputMint", USDC);
queryParams.append("amount", amount.toString());
queryParams.append("userPublicKey", keypair.publicKey.toBase58());
queryParams.append("slippageBps", "50");

// Adaptive fee chosen by the server.
queryParams.append("prioritizationFeeLamports", "high");
// Or use automatic selection:
// queryParams.append("prioritizationFeeLamports", "auto");

const orderResponse = await fetch(
  `${API_BASE_URL}/order?${queryParams.toString()}`
).then((x) => x.json());
const queryParams = new URLSearchParams();
queryParams.append("inputMint", SOL);
queryParams.append("outputMint", USDC);
queryParams.append("amount", amount.toString());
queryParams.append("userPublicKey", keypair.publicKey.toBase58());
queryParams.append("slippageBps", "50");

// Fixed priority fee in lamports.
queryParams.append("prioritizationFeeLamports", "20000");

const orderResponse = await fetch(
  `${API_BASE_URL}/order?${queryParams.toString()}`
).then((x) => x.json());

API Routes

Cookbook Repository

This recipe, along with many more, is available in the DFlow Cookbook Repo. You can clone it and start coding immediately.