Imperative Swaps allow Solana users to trade tokens with full control over the route and transaction execution. Using Imperative Swaps through DFlow Swap API is simple. DFlow Swap API aggregates liquidity from all the major Solana DEXs and offers an API for trading any SPL token.

This quickstart assumes familiarity with Solana’s transaction and network connection logic. If unfamiliar, please refer to the Solana Cookbook.

1

Request a Quote

DFlow Swap API returns a quote specific to the token pair, amount, slippage tolerance, platform fee, segmenter fee, and other parameters.

A route is calculated for the swap at this step and returned along with the quote.

2

Request a Swap Transaction for the Quote

Given the quote, DFlow Swap API returns an executable transaction that encodes the route that was calculated for the quote.

3

Submit the Transaction

Sign and then send the swap transaction directly to a Solana RPC or transaction submission endpoint of your choice.