Skip to main content
GET
/
order
Returns a quote and optionally a transaction
curl --request GET \
  --url https://quote-api.dflow.net/order
{
  "contextSlot": 1,
  "executionMode": "sync",
  "inAmount": "<string>",
  "inputMint": "<string>",
  "minOutAmount": "<string>",
  "otherAmountThreshold": "<string>",
  "outAmount": "<string>",
  "outputMint": "<string>",
  "priceImpactPct": "<string>",
  "slippageBps": 1,
  "computeUnitLimit": 1,
  "lastValidBlockHeight": 1,
  "platformFee": "<unknown>",
  "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>"
}

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

allowSyncExec
boolean

If true, allow synchronous execution. Default is true.

allowAsyncExec
boolean

If true, allow asynchronous execution. Default is true.

restrictRevertMint
boolean

If true, the revert mint for orders that use asynchronous execution will be the input mint. 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 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 between >= 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.

referralAccount
string

Base58-encoded address of the referral account associated with the fee account. If 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 the open 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.

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.

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

preserveInputAta
boolean

If true, the transaction will never attempt to close the input token account

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
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
boolean

If true, the transaction will include a Jito sandwich mitigation account. The account will be included in the SetComputeUnitLimit instruction. See https://docs.jito.wtf/lowlatencytxnsend/#sandwich-mitigation for more details.

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
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
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

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.

  • Option 1
  • Option 2
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.