Execute Batch Swap
Slippage is an important concept in trading that can have a significant impact on your trading outcomes. It refers to the difference between the expected price of a trade and the actual price at which the trade is executed. Slippage can occur in various market conditions and for several reasons, and itβs crucial for traders to be aware of its potential effects.Fibrous uses slippage settings to prevent you from losing money; there is no need to increase your slippage when you spot an arbitrage opportunity.Fibrous is still in alpha version. Please make sure you have adjusted your slippage properly.
Basic Setup
First, letβs set up the router and get the token information:Usage on Backend
For backend implementations on Starknet:Important Notes
- All swaps in a batch must succeed for the transaction to be successful
- Make sure to have sufficient balance for all tokens being swapped
- Approve all tokens before executing the batch swap
- Consider gas costs for multiple swaps in a single transaction
- Monitor the transaction status for all swaps in the batch
- Handle errors appropriately for each swap in the batch