During development, you can use the developer endpoints without an API key. For production use, request an API key for higher rate limits.
The v1 example below will work once the v1 transaction format is activated
on mainnet. Until then, use the v0 tab. See the
v1 migration guide for details.
- Transaction v1
- Transaction v0
Classic
@solana/web3.js can’t sign or send v1 transactions (it can only
read them back). This flow uses @solana/kit 8.0.0+ instead, which has
a different API shape than the rest of this site’s recipes.1
Set up
Imports, env config, and the wallet/RPC client used across every step.
Imports, env, and wallet
Imports, env, and wallet
2
Request an order
GET /order returns a quote and a base64-encoded transaction in one call. Pass userPublicKey so DFlow can construct the transaction for you to sign, and transactionVersion to opt into v1.Request an order
Request an order
3
Sign and submit
Decode the returned wire transaction, sign it with the user’s keypair, and submit it through your RPC.
Sign and submit
Sign and submit
Related Resources
Spot Trading
How spot trading works on DFlow, and when the intent-based path makes sense.
Add Platform Fees
Monetize trades with builder fees.
Add Priority Fees
Control execution speed with priority fees.
Authenticate Requests
Authenticate requests for production rate limits.