🤖 New: DFlow Agent CLI. Give your AI agent a Solana wallet and let it trade. Get started
curl --request POST \
--url https://quote-api.dflow.net/swap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteResponse": {
"contextSlot": 1,
"inAmount": "<string>",
"inputMint": "<string>",
"minOutAmount": "<string>",
"otherAmountThreshold": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"priceImpactPct": "<string>",
"routePlan": [
{
"data": "<string>",
"inAmount": "<string>",
"inputMint": "<string>",
"inputMintDecimals": 1,
"marketKey": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"outputMintDecimals": 1,
"venue": "<string>"
}
],
"slippageBps": 1,
"forJitoBundle": true,
"outTransferFee": "<string>",
"platformFee": {
"amount": "<string>",
"feeBps": 1,
"mode": "outputMint"
},
"requestId": "<string>",
"routingSlot": 1,
"simulatedComputeUnits": 1,
"skipPumpfunCashbackClaim": true
},
"userPublicKey": "<string>",
"computeUnitPriceMicroLamports": 1,
"destinationTokenAccount": {
"associatedTokenAccount": {
"owner": "<string>"
}
},
"dynamicComputeUnitLimit": true,
"feeAccount": "<string>",
"includeJitoSandwichMitigationAccount": true,
"outputCloseAuthority": "<string>",
"perLegSlippage": true,
"prioritizationFeeLamports": {
"autoMultiplier": 1
},
"sponsor": "<string>",
"sponsorExec": true,
"wrapAndUnwrapSol": true
}
'{
"computeUnitLimit": 1,
"lastValidBlockHeight": 1,
"prioritizationFeeLamports": 1,
"swapTransaction": "<string>",
"prioritizationType": {
"computeBudget": {
"microLamports": 1,
"estimatedMicroLamports": 1
}
}
}API reference for POST /swap
curl --request POST \
--url https://quote-api.dflow.net/swap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteResponse": {
"contextSlot": 1,
"inAmount": "<string>",
"inputMint": "<string>",
"minOutAmount": "<string>",
"otherAmountThreshold": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"priceImpactPct": "<string>",
"routePlan": [
{
"data": "<string>",
"inAmount": "<string>",
"inputMint": "<string>",
"inputMintDecimals": 1,
"marketKey": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"outputMintDecimals": 1,
"venue": "<string>"
}
],
"slippageBps": 1,
"forJitoBundle": true,
"outTransferFee": "<string>",
"platformFee": {
"amount": "<string>",
"feeBps": 1,
"mode": "outputMint"
},
"requestId": "<string>",
"routingSlot": 1,
"simulatedComputeUnits": 1,
"skipPumpfunCashbackClaim": true
},
"userPublicKey": "<string>",
"computeUnitPriceMicroLamports": 1,
"destinationTokenAccount": {
"associatedTokenAccount": {
"owner": "<string>"
}
},
"dynamicComputeUnitLimit": true,
"feeAccount": "<string>",
"includeJitoSandwichMitigationAccount": true,
"outputCloseAuthority": "<string>",
"perLegSlippage": true,
"prioritizationFeeLamports": {
"autoMultiplier": 1
},
"sponsor": "<string>",
"sponsorExec": true,
"wrapAndUnwrapSol": true
}
'{
"computeUnitLimit": 1,
"lastValidBlockHeight": 1,
"prioritizationFeeLamports": 1,
"swapTransaction": "<string>",
"prioritizationType": {
"computeBudget": {
"microLamports": 1,
"estimatedMicroLamports": 1
}
}
}Documentation Index
Fetch the complete documentation index at: https://pond.dflow.net/llms.txt
Use this file to discover all available pages before exploring further.
/order endpoint for new
integrations. This endpoint is still available but /order is the preferred
approach. For a code example, see the
imperative trade recipe.API key for authentication. Contact hello@dflow.net to obtain an API key.
The response from the quote endpoint
Show child attributes
Base58-encoded address of the swapper's wallet
Compute unit price in micro-lamports. Mutually exclusive with prioritizationFeeLamports.
x >= 0If the fee account isn't a referral token account derived from the seeds
["referral_ata", referral_account, mint] and the Referral program ID
REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3, this should be unspecified. If specified, the
transaction will create the fee_account if it doesn't already exist. The user pays for the
creation of the fee account. Ignored if fee_account is unspecified.
Show child attributes
The account that will receive the output token. If not specified, the user's associated token account for the output mint will be used. Allowed values are:
associatedTokenAccount - object
owner - base58-encoded address of the owner of the destination token accountShow child attributes
If true, the server will simulate the transaction to determine its compute unit limit. If unspecified or false, the transaction will use the default compute unit limit.
Base58-encoded address of the token account that will receive the platform fee if a platform fee applies to the swap. If specified, this account's mint must match the fee mint for the swap.
If specified, the transaction will include a Jito sandwich mitigation account in the swap instruction. Allowed values are:
true - uses the default Jito sandwich mitigation accountfalse - does not include the accountIf unspecified, the account is not included. See https://docs.jito.wtf/lowlatencytxnsend/#sandwich-mitigation for more details.
Base58-encoded address of the close authority to assign to the output token account. If specified, the swap instruction will idempotently initialize the output token account and set its close authority to the specified address. The action is a no-op if the output token account already exists at execution time.
Cannot be used when the output mint is SOL (wrapped or native). Cannot be used with
destinationTokenAccount.
If true or unspecified, per-leg slippage checks are enabled. If false, per-leg slippage checks are disabled.
Positive slippage fee parameters. If specified, then the swap will pay some or all positive slippage to the specified account.
Show child attributes
Prioritization fee in lamports. Mutually exclusive with computeUnitPriceMicroLamports.
If both computeUnitPriceMicroLamports and prioritizationFeeLamports are unspecified, the
default of prioritizationFeeLamports="auto" will be used.
Allowed values are:
priorityLevelWithMaxLamports - object
priorityLevel - string, either medium, high, or veryHighmaxLamports - integer, a cap on the prioritization feeautoMultiplier - a u32 which specifies how much to multiply the automatically
determined fee by. The total prioritization fee will be capped at 0.005 SOL.Show child attributes
Base58-encoded address of the sponsor's wallet. If specified, the sponsor will pay the transaction fee and for token account creation, and both the user and the sponsor must sign the swap transaction. This can be used to implement gasless swaps.
If true, the sponsor will be the executor of the swap for sponsored swaps. If false, the user will be the executor of the swap for sponsored swaps. Default is true.
If false, the transaction will use wrapped SOL
Imperative swap transaction
Compute unit limit assigned to the transaction
x >= 0The last block height at which the transaction is valid
x >= 0Prioritization fee in lamports
x >= 0Base64-encoded swap transaction. The user must sign before sending it to Solana.
Prioritization fee type for the transaction
Show child attributes