Swaps
Swaps in FanX
Swaps are the most fundamental way users interact with the FanX protocol. A swap allows a user to trade one token they own for another directly within the system—whether it's an ERC-20 token or a native token like CHZ on the Chiliz Chain. The process is entirely permissionless: users select the tokens, specify amounts, and initiate the swap without intermediaries.
Price Impact in FanX
In traditional order-book trading, large orders can consume existing limit orders at sequential price levels, resulting in slippage over multiple prices. In FanX, which operates as an Automated Market Maker (AMM), price impact works differently: the swap is executed against a liquidity pool, and the execution price shifts continuously as the pool’s ratio of tokens changes during the trade. The final price ends up somewhere between the starting and ending price of the swap.
The level of price impact depends on how much liquidity is available at the relevant price range: more liquidity means lower price impact, while thin liquidity leads to higher impact. FanX interfaces often quote an estimated price impact in real time, allowing users to make informed decisions before confirming a swap.
Slippage Considerations
Slippage refers to price changes that can occur between when a swap is submitted and when it's actually executed. In FanX—especially on blockchain networks where transaction ordering depends on gas fees—pending swaps may experience varying execution prices due to network conditions.
To manage this, traders can set a slippage tolerance—a permissible range around the expected price (e.g., 0.5% or 1%). If execution falls within this range, the swap goes through; if not, it's automatically canceled. This protects users from unintended trades executed at unfavorable rates.
Built-in Safety Checks
FanX includes robust safeguards to protect users during swaps:
Deadline enforcement: If a transaction remains pending beyond a predefined time limit, it's canceled to avoid unexpected outcomes from prolonged delays.
Minimum output enforcement: If the actual output amount is below the user’s expectation as defined by their slippage tolerance, the swap is aborted. This helps avoid scenarios where the final price deviates significantly from the projected one.
Why Swaps Matter in FanX
Swaps in FanX empower users to access and exchange liquidity in a seamless, direct manner. Whether you're a casual user swapping for a token or a liquidity provider monitoring pool activity, understanding how price impact, slippage, and safety mechanisms work is crucial for optimal and secure execution.
Last updated