Imperative Swap API Endpoints
Create Swap
DFlow Swap API Documentation
Imperative Swap API Endpoints
Declarative Swap API Endpoints
Token API Endpoints
Imperative Swap API Endpoints
Create Swap
POST
/
swap
curl --request POST \
--url https://quote-api.dflow.net/swap \
--header 'Content-Type: application/json' \
--data '{
"computeUnitPriceMicroLamports": 1,
"createFeeAccount": {
"referralAccount": "<string>"
},
"destinationTokenAccount": "<string>",
"dynamicComputeUnitLimit": true,
"feeAccount": "<string>",
"positiveSlippage": {
"feeAccount": "<string>",
"limitPct": 1
},
"prioritizationFeeLamports": {
"autoMultiplier": 1
},
"quoteResponse": {
"inAmount": "<string>",
"inputMint": "<string>",
"minOutAmount": "<string>",
"otherAmountThreshold": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"platformFee": null,
"priceImpactPct": "<string>",
"routePlan": [
{
"inAmount": "<string>",
"inputMint": "<string>",
"inputMintDecimals": 1,
"leg": "<any>",
"marketKey": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"outputMintDecimals": 1,
"venue": "<string>"
}
],
"simulatedComputeUnits": 1,
"slippageBps": 1
},
"sponsor": "<string>",
"userPublicKey": "<string>",
"wrapAndUnwrapSol": true
}'
{
"computeUnitLimit": 1,
"lastValidBlockHeight": 1,
"prioritizationFeeLamports": 1,
"prioritizationType": null,
"swapTransaction": "<string>"
}
Body
application/json
Response
200
application/json
Imperative swap transaction
The response is of type object
.
curl --request POST \
--url https://quote-api.dflow.net/swap \
--header 'Content-Type: application/json' \
--data '{
"computeUnitPriceMicroLamports": 1,
"createFeeAccount": {
"referralAccount": "<string>"
},
"destinationTokenAccount": "<string>",
"dynamicComputeUnitLimit": true,
"feeAccount": "<string>",
"positiveSlippage": {
"feeAccount": "<string>",
"limitPct": 1
},
"prioritizationFeeLamports": {
"autoMultiplier": 1
},
"quoteResponse": {
"inAmount": "<string>",
"inputMint": "<string>",
"minOutAmount": "<string>",
"otherAmountThreshold": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"platformFee": null,
"priceImpactPct": "<string>",
"routePlan": [
{
"inAmount": "<string>",
"inputMint": "<string>",
"inputMintDecimals": 1,
"leg": "<any>",
"marketKey": "<string>",
"outAmount": "<string>",
"outputMint": "<string>",
"outputMintDecimals": 1,
"venue": "<string>"
}
],
"simulatedComputeUnits": 1,
"slippageBps": 1
},
"sponsor": "<string>",
"userPublicKey": "<string>",
"wrapAndUnwrapSol": true
}'
{
"computeUnitLimit": 1,
"lastValidBlockHeight": 1,
"prioritizationFeeLamports": 1,
"prioritizationType": null,
"swapTransaction": "<string>"
}