Skip to main content
GET
/
order
Returns a quote and optionally a transaction
curl --request GET \
  --url https://quote-api.dflow.net/order \
  --header 'x-api-key: <api-key>'
{
  "contextSlot": 1,
  "executionMode": "sync",
  "inAmount": "<string>",
  "inputMint": "<string>",
  "minOutAmount": "<string>",
  "otherAmountThreshold": "<string>",
  "outAmount": "<string>",
  "outputMint": "<string>",
  "priceImpactPct": "<string>",
  "slippageBps": 1,
  "addressLookupTables": [
    {
      "address": "<string>",
      "addresses": {}
    }
  ],
  "computeUnitLimit": 1,
  "initPredictionMarketCost": 1,
  "isNativePredictionMarketOutput": true,
  "lastValidBlockHeight": 1,
  "platformFee": {
    "amount": "<string>",
    "feeBps": 1,
    "mode": "outputMint"
  },
  "predictionMarketInitPayerMustSign": true,
  "predictionMarketSlippageBps": 1,
  "prioritizationFeeLamports": 1,
  "prioritizationType": {
    "computeBudget": {
      "microLamports": 1,
      "estimatedMicroLamports": 1
    }
  },
  "revertMint": "<string>",
  "routePlan": [
    {
      "data": "<string>",
      "inAmount": "<string>",
      "inputMint": "<string>",
      "inputMintDecimals": 1,
      "marketKey": "<string>",
      "outAmount": "<string>",
      "outputMint": "<string>",
      "outputMintDecimals": 1,
      "venue": "<string>"
    }
  ],
  "transaction": "<string>"
}

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.

Need Help?

https://mintcdn.com/dflow/a8Yx7HBusmKl4Z7w/images/meteor-icons_discord.svg?fit=max&auto=format&n=a8Yx7HBusmKl4Z7w&q=85&s=0ea834bc8a9fa3fe161ba181329effda

Join Our Discord

Connect with other developers, get help, and stay updated on the latest DFlow developments.
https://mintcdn.com/dflow/a8Yx7HBusmKl4Z7w/images/meteor-icons_telegram.svg?fit=max&auto=format&n=a8Yx7HBusmKl4Z7w&q=85&s=e928c5dd68311ff0d419936a35c86eed

Dev Notifications

Join the DFlow Dev Notifications Telegram group to stay in the loop on new features and other announcements.

Authorizations

x-api-key
string
header
required

API key for authentication. Contact hello@dflow.net to obtain an API key.

Query Parameters

userPublicKey
string

Base58-encoded address of the swapper's wallet. If specified, the response will include a transaction allowing the user to submit the order.

inputMint
string
required

Base58-encoded input mint address

outputMint
string
required

Base58-encoded output mint address

amount
integer<int64>
required

Input amount as a scaled integer. For example, 1 SOL is 1000000000.

Required range: x >= 0
slippageBps

Max allowed slippage for the swap. Default is "auto". Allowed values are:

  • a u16 which specifies the maximum allowed slippage in basis points
  • the string value "auto", where the server determines the maximum allowed slippage automatically Slippage tolerance specified in basis points
Required range: x >= 0
perLegSlippage
boolean

If true or unspecified, per-leg slippage checks are enabled. If false, per-leg slippage checks are disabled.

predictionMarketSlippageBps

Max allowed slippage for prediction market orders. Allowed values are:

  • a u16 which specifies the maximum allowed slippage in basis points
  • the string value "auto", where the server determines the maximum allowed slippage automatically

If specified as a u16:

  • must be greater than or equal to slippage_bps
  • this value will be used as the slippage for prediction market orders

If unspecified or "auto":

  • the server determines the maximum allowed slippage for prediction market orders

This will be the slippage value included in the created Prediction Order. This parameter is not used in routing, but only affects the minimum amount of Outcome mint that a prediction order must produce to fill successfully. Slippage tolerance specified in basis points

Required range: x >= 0
priceImpactTolerancePct
integer<int32>

If specified, the API will return an error if the price impact of the route is greater than the specified percentage. If unspecified, the server will determine the threshold. For example, 10 is 10% and 100 is 100%.

Required range: x >= 0
dexes
string

Comma-separated list of DEXes to include. If not specified, all DEXes will be included.

excludeDexes
string

Comma-separated list of DEXes to exclude. If not specified, all DEXes will be included.

onlyDirectRoutes
boolean

If true, only use single-leg routes

maxRouteLength
integer<int32>

If specified, the route will be limited to the specified number of legs. Ignored if only_direct_routes is true.

Required range: x >= 0
onlyJitRoutes
boolean

If true, only use JIT routes. Every leg in the route will use the JIT router.

forJitoBundle
boolean

If true, only use routes that are compatible with Jito bundles. This should only be specified as true if the swap will be executed in a Jito bundle. Default is false.

allowSyncExec
boolean

If true, allow synchronous execution. Default is true.

allowAsyncExec
boolean

If true, allow asynchronous execution. Default is true.

restrictRevertMint
boolean

If true, enforces that the input mint must be the revert mint for orders that use asynchronous execution. Default is false.

platformFeeMode
enum<string>

Optional platform fee mode. If not specified, the default is outputMint. For async prediction market swaps, this is ignored, and the platform fee is paid in the stablecoin mint.

Available options:
outputMint,
inputMint
platformFeeBps
integer<int32>

Optional platform fee in basis points. This should only be nonzero if the swap will collect the platform fee. The fee account must be able to collect the fee mint at execution time.

Required range: x >= 0
platformFeeScale
integer<int32>

Optional platform fee scale for native prediction market swaps and async prediction market swaps, with 3 decimals. This should only be nonzero if the swap will collect the platform fee. The fee account must be able to collect the fee mint at fill time. Must be

= 0 and < 1000. For example, a value of 50 means 0.050.

Required range: x >= 0
feeAccount
string

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. This must be specified if the platform fee is nonzero.

positiveSlippageFeeAccount
string

Base58-encoded address of the token account that will receive the positive slippage fee. This must be a token account for the output mint, regardless of the platform fee mode. If at swap execution time this account can't receive the positive slippage fee, then the positive slippage fee transfer is skipped. If the platform fee mode is outputMint and the platform fee account is specified, then this must be unspecified (in which case the platform fee account will be used) or match the platform fee account. Otherwise, this must be specified.

positiveSlippageLimitPct
integer<int32>

Limit on the positive slippage fee in percent. The positive slippage fee is limited to the lesser of (1) the excess actual out amount above the quoted amount and (2) this percentage of the actual out amount after platform fee.

Required range: x >= 0
sponsor
string

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.

Cannot be specified alongside predictionMarketInitPayer parameter.

sponsorExec
boolean

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.

destinationTokenAccount
string

Base58-encoded address of the account that will receive the output token. This is either the address of the destination token account, or, if the output is native SOL, the address of the destination wallet. If both destinationTokenAccount and destinationWallet are unspecified, the user's associated token account for the output mint will be used if the output isn't native SOL, and the user's wallet will be used if the output is native SOL. If the output isn't native SOL, the specified account must exist before the swap executes, or else the swap will fail. Mutually exclusive with destinationWallet.

destinationWallet
string

Base58-encoded address of the wallet that will receive the output token. Mutually exclusive with destinationTokenAccount. If specified:

  1. If the swap outputs native SOL, the transaction will output native SOL to the specified wallet.
  2. If the swap outputs wrapped SOL or an SPL token, the transaction will send output to the specified wallet's associated token account for the output mint, creating the associated token account if it doesn't exist at execution time.
outputCloseAuthority
string

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 or destinationWallet.

revertWallet
string

Base58-encoded address of the wallet that will receive the revert mint if the order is an asynchronous order and it reverts.

wrapAndUnwrapSol
boolean

If false, the order will use wrapped SOL

prioritizationFeeLamports

Prioritization fee in lamports. Mutually exclusive with computeUnitPriceMicroLamports. If both prioritizationFeeLamports and computeUnitPriceMicroLamports are unspecified, the default of prioritizationFeeLamports="auto" will be used. Allowed values are:

  • an unsigned 32-bit integer which specifies the prioritization fee in lamports
  • the string value "auto", where the server determines the fee automatically
  • the string value "medium", where the server determines the fee automatically
  • the string value "high", where the server determines the fee automatically
  • the string value "veryHigh", where the server determines the fee automatically
  • the string value "disabled", where the server leaves the prioritization fee unspecified
Available options:
auto,
medium,
high,
veryHigh,
disabled
prioritizationFeeMaxLamports
integer<int32>

Maximum lamports to cap the prioritization fee determined by the server

Required range: x >= 0
computeUnitPriceMicroLamports
integer<int64>

Compute unit price in micro-lamports. Mutually exclusive with prioritizationFeeLamports.

Required range: x >= 0
dynamicComputeUnitLimit
boolean

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.

includeJitoSandwichMitigationAccount

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 account
  • false - does not include the account
  • A base58-encoded account address - uses the specified account

If unspecified, the account is not included. See https://docs.jito.wtf/lowlatencytxnsend/#sandwich-mitigation for more details.

predictionMarketInitPayer
string

Base58-encoded address of the account that will pay for market initialization if the market is uninitialized. If specified and the market is uninitialized, this account must sign the transaction, and the transaction will initialize the market if it is uninitialized at execution time. If this account differs from userPublicKey, the transaction will have two signers.

Cannot be specified alongside sponsor parameter.

outcomeAccountRentRecipient
string

Base58-encoded address of the account that will receive the rent from closing the outcome token account if it is empty after sale/redemption. If unspecified, the user's public key will be used.

skipPumpfunCashbackClaim
boolean

If true, Pump.fun cashback will not be claimed for cashback-eligible coins. When set, sell quotes include the full creator fee, and execution skips Pump.fun cashback claiming. Default is false. Cannot be used with sponsor-executed swaps (sponsorExec is true or defaulted to true).

allowBondingCurveUnderconsumption
boolean

If true, allow buys on bonding curves to succeed even when the bonding curve cannot fully consume the input (for example, when the curve is near completion). Default is false. Cannot be used with sponsor-executed swaps (sponsorExec is true or defaulted to true).

includeAddressLookupTables
boolean

If true, the response will include the address lookup tables used in the transaction, with only the entries referenced by the transaction, enabling clients to deserialize and recompile the transaction with additional instructions without fetching ALTs from RPC. Default is false.

maxAccounts
integer<int32>

Maximum allowed number of accounts that the transaction can use. Mutually exclusive with reserveAccounts.

Required range: x >= 0
maxTransactionSize
integer<int32>

Maximum allowed size of the transaction in bytes. Mutually exclusive with reserveTransactionSize.

Required range: x >= 0
reserveAccounts
integer<int32>

Number of accounts to leave unused in the transaction. The server will ensure that the transaction uses at most TRANSACTION_MAX_ACCOUNTS - reserveAccounts accounts. Mutually exclusive with maxAccounts. If you add instructions to the transaction, use this parameter to specify the number of unique accounts that you will add to the transaction. Note that you should not count accounts that are already included in the transaction.

Required range: x >= 0
reserveTransactionSize
integer<int32>

Number of bytes to leave unused in the transaction. The server will ensure that the transaction size is at most TRANSACTION_MAX_SIZE - reserveTransactionSize bytes. Mutually exclusive with maxTransactionSize. If you add instructions to the transaction, use this parameter to specify the number of bytes that your modifications will add to the transaction.

Required range: x >= 0

Response

Order response

contextSlot
integer<int64>
required

Slot at which the request was evaluated

Required range: x >= 0
executionMode
enum<string>
required

Order execution mode

Available options:
sync,
async
inAmount
string
required

Maximum input amount as a scaled integer. For example, 1 SOL is 1000000000.

inputMint
string
required

Base58-encoded input mint address

minOutAmount
string
required

Same as other_amount_threshold

otherAmountThreshold
string
required

Minimum output amount after all fees as a scaled integer. If the swap transaction doesn't produce at least this amount of the output token, the transaction will fail.

outAmount
string
required

Expected output amount after all fees as a scaled integer. For example, 1 SOL is 1000000000.

outputMint
string
required

Base58-encoded output mint address

priceImpactPct
string
required

Price impact of the swap. This is an estimate of the percentage difference between the expected price for the swap and the price for the same swap with the smallest input amount possible. For example, "0.01" means 1% price impact.

slippageBps
integer<int32>
required

Max allowed slippage % in basis points

Required range: x >= 0
addressLookupTables
object[]

Address lookup tables used in the transaction. Each entry contains the table's address and a map of index to address for each entry in the table that is used by the transaction. Specified if and only if the request included includeAddressLookupTables=true and the request included the user's public key.

computeUnitLimit
integer<int32>

Compute unit limit assigned to the transaction. Specified if and only if the request included the user's public key.

Required range: x >= 0
initPredictionMarketCost
integer<int32>

Cost in lamports to initialize a prediction market. Specified if and only if the transaction will initialize the prediction market.

Required range: x >= 0
isNativePredictionMarketOutput
boolean

True if and only if the output mint is a native prediction market outcome mint.

lastValidBlockHeight
integer<int64>

The last block height at which the blockhash assigned to the transaction is valid. Useful to determine whether the transaction has expired. Specified if and only if the request included the user's public key.

Required range: x >= 0
platformFee
object

Platform fee that was applied to the quote, if any

predictionMarketInitPayerMustSign
boolean

Whether the predictionMarketInitPayer must sign the transaction. Specified if and only if the request included predictionMarketInitPayer and the market is uninitialized.

predictionMarketSlippageBps
integer<int32>

Max allowed slippage for prediction market orders in basis points. Only specified for prediction market orders.

Required range: x >= 0
prioritizationFeeLamports
integer<int64>

Prioritization fee in lamports. Specified if and only if the request included the user's public key.

Required range: x >= 0
prioritizationType
object

Prioritization fee type for the transaction. Specified if and only if the request included the user's public key.

revertMint
string

Base58-encoded mint address of the token that will be returned to the user if the order is an asynchronous order and the order reverts after it is successfully opened. Specified if and only if the order is an asynchronous order.

routePlan
object[]

Route that the swap will take. Specified if and only if the route plan is known at order opening time. This will be specified for all synchronous orders.

transaction
string

Base64-encoded transaction. The user must sign before sending it to Solana. Specified if and only if the request included the user's public key.