Skip to main content
Swap any SPL token on Solana through the Trading API. DFlow charges no protocol fee on spot trades, and you can add your own platform fee on top. Spot trades are imperative: your app sends the trade parameters to DFlow, and DFlow returns a fully constructed transaction for you to sign and submit.

Features

  • Best execution: JIT routing re-optimizes your route at execution time, so you get the best available price even as liquidity shifts.
  • Live market data: The quote stream pushes top-of-book prices, and the book stream pushes ten levels of depth. Use them to build live tickers and order books without polling.
  • Gasless swaps: Your app can sponsor users’ transaction fees, so they trade without holding SOL for gas.
  • Composable transactions: Each call to the order endpoint returns a transaction, so you can bundle it with your own instructions and run them atomically.
  • Fine-grained control: Optional parameters cover slippage, priority fees, and venue restrictions, so you decide how each order routes and lands.

How it works

  1. The app requests an order from the /order endpoint with input mint, output mint, and amount, plus optional parameters like slippage, platform fees, priority fees, and venue restriction.
  2. The user signs the returned transaction.
  3. The app submits it to a Solana RPC and confirms status.
Prediction market outcome tokens are SPL tokens too, so they route through the same /order endpoint. The flow on this page applies to both standard spot pairs and Kalshi outcome-token swaps.
DFlow also offers an intent-based declarative trade flow via GET /intent for stronger sandwich protection. The majority of builders stay on /order; /intent is the opt-in for apps where sandwich exposure matters more than transaction composability. Token-2022 mints (including Kalshi outcome tokens) are not supported on /intent.