Loading...
Loading...
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 / 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/NO trades or builder-side platform fees.
npx skill4agent add dflowprotocol/dflow-skills dflow-spot-tradinghttps://pond.dflow.net/mcpsearch_d_flowquery_docs_filesystem_d_flowdflowdflow quote <atomic-amount> <FROM> <TO>GET /orderuserPublicKey/quote/order/orderVersionedTransactiondflow trade <atomic-amount> <FROM> <TO>--confirmGET /order?userPublicKey=&inputMint=&outputMint=&amount=transactionVersionedTransactionconst sig = await wallet.sendTransaction(tx, connection)connectionconfirmTransactionKeypairtx.sign([keypair])connection.sendRawTransaction(tx.serialize())const { transaction, lastValidBlockHeight } = await fetch("/api/order?...").then(r => r.json());
const tx = VersionedTransaction.deserialize(Buffer.from(transaction, "base64"));
const sig = await sendTransaction(tx, connection); // wallet's RPC
await connection.confirmTransaction( // app's RPC (reads only)
{ signature: sig, blockhash: tx.message.recentBlockhash, lastValidBlockHeight },
"confirmed",
);/ordertransactionVersionedTransaction.deserializewallet.sendTransactionconnection.sendRawTransactionlastValidBlockHeightconnection.confirmTransactiontx.message.recentBlockhashgetLatestBlockhashinAmountoutAmountotherAmountThresholdpriceImpactPctslippageBpsprioritizationFeeLamportsprioritizationType"auto"contextSlotroutePlantransactionlastValidBlockHeightcomputeUnitLimitprioritizationFeeLamportsaddressLookupTablesKeypair/build/recipes/trading/imperative-trade/intent/submit-intent/intent/order500_0001_000_000_000/order/order/quoteDFLOW_API_KEYx-api-keyhttps://quote-api.dflow.netx-api-keyhttps://dev-quote-api.dflow.nethttps://pond.dflow.net/build/api-key/orderprioritizationFeeLamports/orderautomediumhighveryHighdisabled/intentfeeBudget = priority + 10_000GET /priority-fees/priority-fees/streamdflow tradedisabledsponsor=<sponsor-wallet-base58>/ordersponsorExec=true|falsedflow setupwallet.sendTransaction(tx, connection)Keypairconnection.sendRawTransaction"auto"--slippageslippageBpsdflow-platform-feesgetParsedAccountInfo"USDC"/order@solana/wallet-adapter-reactwallet.sendTransaction(tx, connection)signAndSendTransactionConnectionconfirmTransactionmainnet-betasignTransaction(tx)connection.sendRawTransaction(signed.serialize())sendTransactionwallet.sendTransactionKeypairwallets={[]}<WalletProvider>new PhantomWalletAdapter()new SolflareWalletAdapter()@solana/wallet-adapter-walletsuseWallet()sendTransactionpublicKeysendTransactionsignTransactionconnection.sendRawTransaction@solana/wallet-adapter-wallets@walletconnect/*pino-prettytx.message.recentBlockhashlastValidBlockHeight/orderconnection.getLatestBlockhash()lastValidBlockHeightconfirmTransactionmainnet-betagetLatestBlockhash@solana/web3.js"failed to get recent blockhash: ..."getRecentBlockhash/order/intent/orderroute_not_foundprice_impact_too_highamountpriceImpactTolerancePctslippageBpsdflow tradedflow setup/order/quote.env--api-key/quote/swapsearch_d_flowquery_docs_filesystem_d_flow/build/recipes/trading/imperative-trade/build/recipes/trading/declarative-tradedflow-kalshi-tradingdflow-platform-fees