Execute
Execute a swap through Fibrous Finance liquidity pools
https://api.fibrous.finance/base
Execute a token swap using the optimal route previously found through the route endpoint. This endpoint handles the actual transaction execution and ensures the swap is performed with the best possible outcome.
Request Body Parameters
The route object returned from the /base/route
endpoint.
This contains all necessary information about the swap path and expected outcomes.
Maximum acceptable slippage in percentage (0.1 to 100).
Example: 0.5
for 0.5% slippage tolerance
Unix timestamp (in seconds) after which the transaction will revert. Defaults to 20 minutes from the current time if not specified.
The address that will receive the output tokens. If not specified, tokens will be sent to the transaction sender.
Response
Indicates if the execution request was successful.
The hash of the executed transaction.
The executed route details.
Execution details.
Error Responses
Route Expired
Slippage Exceeded
Insufficient Balance
Invalid Deadline
Best Practices
-
Route Freshness
- Always use a fresh route from the
/base/route
endpoint - Routes can become stale due to market movements
- Implement retry logic with fresh routes if execution fails
- Always use a fresh route from the
-
Slippage Management
- Set appropriate slippage tolerance based on:
- Token pair volatility
- Trade size
- Market conditions
- Higher values increase success rate but may result in worse prices
- Lower values ensure better prices but may cause more failed transactions
- Set appropriate slippage tolerance based on:
-
Deadline Setting
- Set reasonable deadlines to prevent stale transactions
- Consider network congestion when setting deadlines
- Default of 20 minutes is suitable for most cases
-
Gas Optimization
- Monitor
gasUsed
in responses to optimize future transactions - Consider using direct routes for major pairs
- Bundle multiple swaps if possible
- Monitor
See Also
- Route Endpoint - Find the optimal route for your swap
- Calldata Endpoint - Get raw transaction data
- Gas Estimation - Understanding gas costs