Aggregate DEX Swap

Aggregates swap quotes from all DEXs supporting a specified token pair. It allows users to customize their query to prioritize either the best output or the lowest gas costs. The response provides detailed transaction data including DEX identifiers, output amounts, swap routing parameters (such as call data), gas estimates, and a reference, enabling traders to compare and select the most efficient swap route for their needs.

Compute Unit Value: 115 (Fixed)

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

The request body for a /defi/v1/dex/swaps

string
enum

The unique ID to direct queries or transactions to the correct blockchain. Find more here.

path
array of strings
required

Comma-separated values of token pair.

path*
string
required

Amount of token.

string

The abbreviated chain name for queries or transactions.

string
required

Address of the sender of the token.

string

Maximum gas to be approved for the transaction.

string
required

Address of the recipient of the token.

string

Different pool based on the fees. By default, it will take the pool with maximum amountOut.

string

Comma-separated values of dexes to exclude.

boolean

If true, sorts prepared transactions by net value (amountsOut minus gas) in descending order. If multiple sort parameters are true, bestNetPrice takes precedence.

boolean

If true, sorts prepared transactions by amountsOut in descending order. If multiple sort parameters are true, bestNetPrice takes precedence.

boolean

If true, sorts prepared transactions by gas cost in ascending order. If multiple sort parameters are true, bestNetPrice takes precedence.

string

Specifies the priority level for gas fees (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.

string

Minimum amount to be received.

string

Percentage of total swap value allowed for slippage. Default is 1 (0 <= slippage <= 100).

boolean

Flag to include a basis points fee transaction alongside the main transaction when set to true.

string
enum

The batch option to be used for the transaction.

Allowed:
string

The EOA address of the batcher that will be used to execute the transaction when using EIP-7702 batching. If not provided, the default batcher contract for the chain will be used.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json