Skip to main content
POST

Overview

V2 Available: This endpoint maps to /{network}/v2/calldata in V2, with integrator support and metadata. See Calldata V2 and the V2 Migration Guide.
The Execute endpoint generates the necessary transaction data to execute a token swap using a previously obtained route. This endpoint is available across all supported networks.

Supported Networks

Request Body Parameters

RouteResponse
required
The route object returned from the /route endpoint. This contains all necessary information about the swap path and expected outcomes.
number
default:"0.5"
required
Maximum acceptable slippage in percentage (0.1 to 100).Example: 0.5 for 0.5% slippage tolerance
string
required
The destination address to receive the output tokens.
number
Unix timestamp (in seconds) after which the transaction will revert.Defaults to 20 minutes from the current time if not specified.

Response

object
The executed route details
object[]
Swap parameters for every hop in the route
string
The encoded transaction calldata ready for execution
string
Fibrous Router contract address to send the transaction to
string
The amount of native token to send with the transaction (for native token swaps)

Example Request

Best Practices

  1. Route Freshness
    • Always use a fresh route from the /route endpoint
    • Routes can become stale due to market movements
    • Implement retry logic with fresh routes if execution fails
  2. Slippage Management
    • Set appropriate slippage tolerance based on:
      • Token pair volatility
      • Available liquidity
      • Market conditions
    • Higher values increase success rate but may result in worse prices
    • Lower values ensure better prices but may cause more failed transactions
  3. Deadline Setting
    • Set reasonable deadlines to prevent stale transactions
    • Consider network congestion when setting deadlines
    • Default of 20 minutes is suitable for most cases
  4. Gas Optimization
    • Monitor gas costs in responses to optimize future transactions
    • Consider using direct routes for major pairs
    • Batch multiple swaps when possible

Error Responses

Status Code: 400
Solution: Fetch a new route and retry the execution.
Status Code: 400
Solution: Reduce the swap amount or try again later.
Status Code: 400
Solution: Adjust slippage to be within the valid range.

Network-Specific Notes

  • Use standard EVM transaction format
  • Native token swaps require sending value with transaction
  • Approve token spending before swap if not native token
  • Gas estimation included in response

Complete Swap Flow