Create DEX Swap Transaction with Approval
| Time | Status | User Agent | |
|---|---|---|---|
| Make a request to see history. |
URL Expired
The URL for this request expired after 30 days.
The request body for a /defi/v1/dex/swap-with-approval
Parameters
dexId
- type: string
- enum: The unique ID to specify the decentralized exchange (DEX) within a particular blockchain. Find more here.
path
- type: array of strings
- required: true
- description: Array of token addresses to swap, in order of the swap.
amountIn
- type: string
- required: true
- description: Amount of token to be swapped.
amountOutMin
- type: string
- description: Minimum amount accepted as the result of the swap.
to
- type: string
- required: true
- description: Address of the recipient of the token.
deadline
- type: string
- required: true
- description: Deadline for the transaction to be executed (UNIX Timestamp).
from
- type: string
- required: true
- description: Address of the sender of the token.
gas
- type: string
- description: Maximum gas to be approved for the transaction.
gasPriority
- type: string
- description: Specifies the priority level for gas fees (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.
slippage
- type: string
- description: Percentage of total swap value allowed for slippage. Default is 1 (0 <= slippage <= 100).
enableFee
- type: boolean
- description: Flag to include a basis points fee transaction alongside the main transaction when set to true.
batchOption
- type: string
- enum: The batch option to be used for the transaction.
- Allowed:
EIP-5792,EIP-7702
batcherContract
- type: string
- description: 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.
poolFees
- type: string
- description: Different pool based on the fees. By default, it will take the pool with maximum amountOut.
Success Response
`` 200 Successful response
Example Request (cURL)
curl --request POST \
--url https://svc.blockdaemon.com/defi/v1/dex/swap-with-approval \
--header 'accept: application/json' \
--header 'content-type: application/json'
Response
{
"status": "success",
"data": {
// Example Response Data
}
}