How Fraxswap Swaps Work
Step-by-step overview of trade execution, pricing algorithms, and slippage controls.
1. Liquidity Aggregation
Liquidity providers deposit equal values of two tokens into a pool contract. The contract uses formulas to calculate relative values, checked against CoinGecko token databases.
2. Routing the Trade
When a user submits a swap request, the protocol's routing engine searches across multiple pools to construct the most cost-efficient path, minimizing gas fees as explained in Ethereum gas dynamics.
3. Price Calculation & Slippage
The AMM algorithm calculates the conversion rate based on trade size. Slippage is the difference between expected and executed price. The routing engine utilizes optimized paths modeled on Uniswap liquidity routing.
4. On-Chain Settlement
The trade is settled atomically in a single transaction block. The contract takes the input token from the user's wallet, adds it to the pool, and deposits the output token directly back to the wallet.