Work with this as data
Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/dflow-swap-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
OpenAPI Specification
openapi: 3.2.0
info:
title: DFlow Aggregator admin Swap API
description: DFlow Aggregator API
license:
name: BUSL-1.1
version: 0.1.0
servers:
- url: https://quote-api.dflow.net
security:
- api_key: []
tags:
- name: swap
description: Swap API endpoints
paths:
/priority-fees:
get:
tags:
- swap
summary: Returns the latest global priority fee estimates for each priority level
operationId: priority_fees_handler
responses:
'200':
description: Priority fee estimates
content:
application/json:
schema:
$ref: '#/components/schemas/PriorityFeesResponse'
/priority-fees/stream:
get:
tags:
- swap
summary: Streams priority fee estimate updates over a WebSocket connection
operationId: priority_fee_stream_handler
responses:
'101':
description: WebSocket upgrade
/quote:
get:
tags:
- swap
summary: Returns a quote for an imperative swap
operationId: quote_handler
parameters:
- name: inputMint
in: query
description: Base58-encoded input mint address
required: true
schema:
type: string
- name: outputMint
in: query
description: Base58-encoded output mint address
required: true
schema:
type: string
- name: amount
in: query
description: Input amount as a scaled integer. For example, 1 SOL is 1000000000.
required: true
schema:
type: integer
format: int64
minimum: 0
- name: slippageBps
in: query
description: "Max allowed slippage for the swap. Allowed values are:\n- a u16 which specifies the maximum allowed slippage in basis points\n- the string value \"auto\", where the server determines the maximum allowed slippage\n automatically"
required: false
schema:
$ref: '#/components/schemas/SlippageTolerance'
- name: priceImpactTolerancePct
in: query
description: '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: false
schema:
type: integer
format: int32
minimum: 0
- name: dexes
in: query
description: Comma-separated list of DEXes to include. If not specified, all DEXes will be included.
required: false
schema:
type: string
- name: excludeDexes
in: query
description: Comma-separated list of DEXes to exclude. If not specified, all DEXes will be included.
required: false
schema:
type: string
- name: platformFeeBps
in: query
description: 'Optional platform fee in basis points. This should only be nonzero if the swap will collect
the platform fee. The swap must specify a valid fee account and that fee account must be
able to collect the fee mint at execution time.'
required: false
schema:
type: integer
format: int32
minimum: 0
- name: platformFeeMode
in: query
description: Optional platform fee mode. If not specified, the default is `outputMint`.
required: false
schema:
$ref: '#/components/schemas/PlatformFeeMode'
- name: sponsoredSwap
in: query
description: 'This should be specified as true if and only if the quote will be used for a sponsored swap.
If true, then the quote will account for any additional token 2022 transfer fees that apply
to the input and output mints for a sponsored swap.'
required: false
schema:
type: boolean
- name: sponsorExec
in: query
description: 'The execution mode that will be used for the sponsored swap. This parameter is only relevant
when `sponsoredSwap` is true. True indicates that the sponsor will be the executor of the
swap. False indicates that the user will be the executor of the swap. Default is true.'
required: false
schema:
type: boolean
- name: destinationSwap
in: query
description: 'This should be specified as true if and only if the quote will be used for a destination
token account swap. If true, then the quote will account for any additional token 2022
transfer fees that apply to the output mint for a destination token account swap.'
required: false
schema:
type: boolean
- name: onlyDirectRoutes
in: query
description: If true, only use single-leg routes
required: false
schema:
type: boolean
- name: maxRouteLength
in: query
description: 'If specified, the route will be limited to the specified number of legs. Ignored if
`only_direct_routes` is true.'
required: false
schema:
type: integer
format: int32
minimum: 0
- name: onlyJitRoutes
in: query
description: If true, only use JIT routes. Every leg in the route will use the JIT router.
required: false
schema:
type: boolean
- name: forJitoBundle
in: query
description: '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.'
required: false
schema:
type: boolean
- name: skipPumpfunCashbackClaim
in: query
description: '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).'
required: false
schema:
type: boolean
responses:
'200':
description: Imperative swap quote
content:
application/json:
schema:
$ref: '#/components/schemas/QuoteResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/QuoteBadRequestResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/QuoteInternalServerErrorResponse'
'503':
description: Service unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/QuoteServiceUnavailableResponse'
/swap:
post:
tags:
- swap
summary: Returns an imperative swap transaction for the given quote
operationId: swap_handler
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SwapRequest'
required: true
responses:
'200':
description: Imperative swap transaction
content:
application/json:
schema:
$ref: '#/components/schemas/SwapResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/SwapBadRequestResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/SwapInternalServerErrorResponse'
/swap-instructions:
post:
tags:
- swap
summary: Returns an imperative swap transaction for the given quote
operationId: swap_instructions_handler
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SwapRequest'
required: true
responses:
'200':
description: Imperative swap transaction
content:
application/json:
schema:
$ref: '#/components/schemas/SwapInstructionsResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/SwapBadRequestResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/SwapInternalServerErrorResponse'
components:
schemas:
CreateFeeAccountParams:
type: object
required:
- referralAccount
properties:
referralAccount:
type: string
description: Base58-encoded address of the referral account associated with the fee account
SingleMarketRoutePlanLeg:
type: object
required:
- venue
- marketKey
- inputMint
- outputMint
- inAmount
- outAmount
- inputMintDecimals
- outputMintDecimals
properties:
inAmount:
type: string
description: Maximum input amount for the leg as a scaled integer. For example, 1 SOL is 1000000000.
inputMint:
type: string
description: Base58-encoded input mint address
inputMintDecimals:
type: integer
format: int32
description: Decimals for the input mint
minimum: 0
marketKey:
type: string
description: Key identifying the market on the venue
outAmount:
type: string
description: Expected output amount for the leg as a scaled integer. For example, 1 SOL is 1000000000.
outputMint:
type: string
description: Base58-encoded output mint address
outputMintDecimals:
type: integer
format: int32
description: Decimals for the output mint
minimum: 0
venue:
type: string
description: Venue for the leg
QuoteResponse:
type: object
required:
- inputMint
- inAmount
- outputMint
- outAmount
- otherAmountThreshold
- minOutAmount
- slippageBps
- priceImpactPct
- routePlan
- contextSlot
properties:
contextSlot:
type: integer
format: int64
description: Slot at which the request was evaluated
minimum: 0
forJitoBundle:
type: boolean
description: True if and only if the request was for a Jito bundle
inAmount:
type: string
description: Maximum input amount as a scaled integer. For example, 1 SOL is 1000000000.
inputMint:
type: string
description: Base58-encoded input mint address
minOutAmount:
type: string
description: Same as `other_amount_threshold`
otherAmountThreshold:
type: string
description: '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:
type: string
description: Expected output amount after all fees as a scaled integer. For example, 1 SOL is 1000000000.
outTransferFee:
type: string
description: Transfer fee amount that was applied to the quote, if any
outputMint:
type: string
description: Base58-encoded output mint address
platformFee:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/PlatformFee'
description: Platform fee that was applied to the quote, if any
priceImpactPct:
type: string
description: '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.'
requestId:
type: string
description: Identifier for the request
routePlan:
type: array
items:
$ref: '#/components/schemas/RoutePlanLeg'
description: Route that the swap will take
routingSlot:
type: integer
format: int64
description: Slot of the market state used to compute the quote
minimum: 0
simulatedComputeUnits:
type: integer
format: int32
description: Compute units consumed by quote simulation
minimum: 0
skipPumpfunCashbackClaim:
type: boolean
description: True if and only if Pump.fun cashback claiming was skipped for this quote
slippageBps:
type: integer
format: int32
description: Max allowed slippage % in basis points
minimum: 0
SwapResponse:
type: object
required:
- swapTransaction
- lastValidBlockHeight
- prioritizationFeeLamports
- computeUnitLimit
properties:
computeUnitLimit:
type: integer
format: int32
description: Compute unit limit assigned to the transaction
minimum: 0
lastValidBlockHeight:
type: integer
format: int64
description: The last block height at which the transaction is valid
minimum: 0
prioritizationFeeLamports:
type: integer
format: int64
description: Prioritization fee in lamports
minimum: 0
prioritizationType:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/PrioritizationType'
description: Prioritization fee type for the transaction
swapTransaction:
type: string
description: Base64-encoded swap transaction. The user must sign before sending it to Solana.
DestinationTokenAccountParam:
oneOf:
- type: object
description: 'Use the specified owner''s associated token account for the output mint as the destination
token account. If the destination token account is uninitialized at swap execution time, the
swap will create it. This cannot be used if the output is native SOL.'
required:
- associatedTokenAccount
properties:
associatedTokenAccount:
type: object
description: 'Use the specified owner''s associated token account for the output mint as the destination
token account. If the destination token account is uninitialized at swap execution time, the
swap will create it. This cannot be used if the output is native SOL.'
required:
- owner
properties:
owner:
type: string
description: Base58-encoded address of the owner of the destination token account
- type: object
description: 'Use the specified base58-encoded address as the destination token account. The account must
already be initialized at swap execution time or else the transaction will fail.'
required:
- address
properties:
address:
type: string
description: 'Use the specified base58-encoded address as the destination token account. The account must
already be initialized at swap execution time or else the transaction will fail.'
PositiveSlippageParams:
type: object
required:
- limitPct
properties:
feeAccount:
type: string
description: '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.'
limitPct:
type: integer
format: int32
description: '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.'
minimum: 0
AccountMetaResponse:
type: object
required:
- pubkey
- isSigner
- isWritable
properties:
isSigner:
type: boolean
description: Is the account a signer?
isWritable:
type: boolean
description: Is the account writable?
pubkey:
type: string
description: Pubkey of the account
QuoteServiceUnavailableResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/QuoteServiceUnavailableCode'
msg:
type: string
example:
code: <enum<string>>
msg: <string>
RoutePlanLeg:
oneOf:
- $ref: '#/components/schemas/DynamicRoutePlanLeg'
- $ref: '#/components/schemas/SingleMarketRoutePlanLeg'
PlatformFeeMode:
type: string
enum:
- outputMint
- inputMint
SwapBadRequestCode:
type: string
enum:
- invalid_out_amount
- invalid_user_public_key
- invalid_sponsor
- sponsored_swap_cannot_create_fee_account
- invalid_platform_fee_amount
- invalid_fee_account
- invalid_positive_slippage_fee_account
- invalid_referral_account
- invalid_destination_token_account
- invalid_destination_token_account_for_native_sol
- invalid_output_close_authority
- output_close_authority_with_native_sol_output
- output_close_authority_with_destination_token_account
- both_priority_fee_params_specified
- route_is_empty
- route_too_long
- invalid_route_plan_leg
- invalid_jito_sandwich_mitigation_account
- skip_pumpfun_cashback_claim_with_sponsor_executor
SwapInternalServerErrorResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/SwapInternalServerErrorCode'
msg:
type: string
example:
code: <enum<string>>
msg: <string>
QuoteBadRequestResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/QuoteBadRequestCode'
contextSlot:
type:
- integer
- 'null'
format: int64
minimum: 0
msg:
type: string
routingSlot:
type:
- integer
- 'null'
format: int64
minimum: 0
example:
code: <enum<string>>
msg: <string>
BlockhashWithMetadata:
type: object
required:
- blockhash
- lastValidBlockHeight
properties:
blockhash:
type: string
description: Base58-encoded blockhash
lastValidBlockHeight:
type: integer
format: int64
description: The last block height at which a transaction that uses the blockhash is valid
minimum: 0
SwapInstructionsResponse:
type: object
required:
- computeBudgetInstructions
- setupInstructions
- swapInstruction
- cleanupInstructions
- otherInstructions
- addressLookupTableAddresses
- prioritizationFeeLamports
- computeUnitLimit
- blockhashWithMetadata
properties:
addressLookupTableAddresses:
type: array
items:
type: string
description: The lookup table addresses
blockhashWithMetadata:
$ref: '#/components/schemas/BlockhashWithMetadata'
description: A blockhash that can be used to construct the transaction
cleanupInstructions:
type: array
items:
$ref: '#/components/schemas/InstructionResponse'
description: Instructions that should be included after the swap instruction
computeBudgetInstructions:
type: array
items:
$ref: '#/components/schemas/InstructionResponse'
description: Instructions that determine the compute budget and prioritization fee for the transaction
computeUnitLimit:
type: integer
format: int32
description: Compute unit limit assigned to the transaction
minimum: 0
otherInstructions:
type: array
items:
$ref: '#/components/schemas/InstructionResponse'
description: 'Other instructions that should be included in the transaction. The indices of these
instructions in the transaction are not important.'
prioritizationFeeLamports:
type: integer
format: int64
description: Prioritization fee in lamports
minimum: 0
prioritizationType:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/PrioritizationType'
description: Prioritization fee type for the transaction
setupInstructions:
type: array
items:
$ref: '#/components/schemas/InstructionResponse'
description: Instructions that should be included before the swap instruction
swapInstruction:
$ref: '#/components/schemas/InstructionResponse'
description: The instruction that performs the swap
PriorityFeesResponse:
type: object
description: Global priority fee estimates (in micro-lamports per compute unit) for each priority level.
required:
- mediumMicroLamports
- highMicroLamports
- veryHighMicroLamports
properties:
highMicroLamports:
type: integer
format: int64
description: Estimated micro-lamports per compute unit for the high priority level
minimum: 0
mediumMicroLamports:
type: integer
format: int64
description: Estimated micro-lamports per compute unit for the medium priority level
minimum: 0
veryHighMicroLamports:
type: integer
format: int64
description: Estimated micro-lamports per compute unit for the very high priority level
minimum: 0
PrioritizationType:
oneOf:
- type: object
description: Prioritization fee specified via the compute budget program
required:
- computeBudget
properties:
computeBudget:
type: object
description: Prioritization fee specified via the compute budget program
required:
- microLamports
properties:
estimatedMicroLamports:
type:
- integer
- 'null'
format: int64
description: Compute unit price estimated by the server for the transaction
minimum: 0
microLamports:
type: integer
format: int64
description: Compute unit price assigned to the transaction
minimum: 0
QuoteInternalServerErrorCode:
type: string
enum:
- failed_to_compute_route
QuoteInternalServerErrorResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/QuoteInternalServerErrorCode'
contextSlot:
type:
- integer
- 'null'
format: int64
minimum: 0
msg:
type: string
routingSlot:
type:
- integer
- 'null'
format: int64
minimum: 0
example:
code: <enum<string>>
msg: <string>
PriorityLevel:
type: string
enum:
- medium
- high
- veryHigh
SwapBadRequestResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/SwapBadRequestCode'
msg:
type: string
example:
code: <enum<string>>
msg: <string>
IncludeJitoSandwichMitigationAccount:
oneOf:
- type: boolean
- type: string
SwapRequest:
type: object
required:
- userPublicKey
- quoteResponse
properties:
computeUnitPriceMicroLamports:
type: integer
format: int64
description: Compute unit price in micro-lamports. Mutually exclusive with `prioritizationFeeLamports`.
minimum: 0
createFeeAccount:
$ref: '#/components/schemas/CreateFeeAccountParams'
description: '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
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.'
destinationTokenAccount:
$ref: '#/components/schemas/DestinationTokenAccountParam'
description: "The account that will receive the output token. If not specified, the user's associated\ntoken account for the output mint will be used. Allowed values are:\n- A base58-encoded address, which specifies the address of the destination token account or,\n if the output is native SOL, the destination wallet. If the output isn't native SOL, the\n specified account must exist before the swap executes, or else the swap will fail.\n- An object which specifies the owner of the destination token account. In this case, the\n owner's associated token account for the output mint will be used as the destination token\n account. Note that this cannot be used if the output is native SOL. The object contains\n the following:\n - `associatedTokenAccount` - object\n - `owner` - base58-encoded address of the owner of the destination token account"
dynamicComputeUnitLimit:
type: boolean
description: '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.'
feeAccount:
type: string
description: '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.'
includeJitoSandwichMitigationAccount:
$ref: '#/components/schemas/IncludeJitoSandwichMitigationAccount'
description: '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.'
outputCloseAuthority:
type: string
description: '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`.'
perLegSlippage:
type: boolean
description: 'If true or unspecified, per-leg slippage checks are enabled. If false, per-leg slippage
checks are disabled.'
positiveSlippage:
$ref: '#/components/schemas/PositiveSlippageParams'
description: 'Positive slippage fee parameters. If specified, then the swap will pay some or all positive
slippage to the specified account.'
prioritizationFeeLamports:
$ref: '#/components/schemas/PrioritizationFeeLamports'
description: "Prioritization fee in lamports. Mutually exclusive with `computeUnitPriceMicroLamports`.\nIf both `computeUnitPriceMicroLamports` and `prioritizationFeeLamports` are unspecified, the\ndefault of `prioritizationFeeLamports=\"auto\"` will be used.\nAllowed values are:\n- a u32 which specifies the lamports\n- the string value \"auto\", where the server determines the fee automatically, capped at\n 0.005 SOL\n- the string value \"disabled\", where the server leaves the prioritization fee unspecified\n- an object containing the following\n - `priorityLevelWithMaxLamports` - object\n - `priorityLevel` - string, either `medium`, `high`, or `veryHigh`\n - `maxLamports` - integer, a cap on the prioritization fee\n- an object containing the following\n - `autoMultiplier` - a u32 which specifies how much to multiply the automatically\n determined fee by. The total prioritization fee will be capped at 0.005 SOL."
quoteResponse:
$ref: '#/components/schemas/QuoteResponse'
description: The response from the quote endpoint
sponsor:
type: string
description: '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.'
sponsorExec:
type: boolean
description: '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.'
userPublicKey:
type: string
description: Base58-encoded address of the swapper's wallet
wrapAndUnwrapSol:
type: boolean
description: If false, the transaction will use wrapped SOL
QuoteBadRequestCode:
type: string
enum:
- requested_input_amount_is_zero
- invalid_input_mint
- invalid_output_mint
- same_input_and_output_mint
- invalid_slippage_bps
- invalid_platform_fee_bps
- invalid_dex
- invalid_max_route_length_for_jit_route
- cannot_exclude_jit_router_for_jit_route
- route_not_found
- use_order_endpoint_for_prediction_markets
- price_impact_too_high
- invalid_price_impact_tolerance_pct
PrioritizationFeeLamports:
oneOf:
- type: object
description: A multiplier applied to the automatically-determined fee. The total is capped at 0.005 SOL.
required:
- autoMultiplier
properties:
autoMultiplier:
type: integer
format: int32
description: A multiplier applied to the automatically-determined fee. The total is capped at 0.005 SOL.
minimum: 0
- type: object
description: A variable prioritization fee determined by the server based on the specified priority level
required:
- priorityLevelWithMaxLamports
properties:
priorityLevelWithMaxLamports:
type: object
description: A variable prioritization fee determined by the server based on the specified priority level
required:
- prio
# --- truncated at 32 KB (36 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/dflow/refs/heads/main/openapi/dflow-swap-api-openapi.yml