FuelSwap is a Lightning-Fast DEX powered by Fuel. It allows users to swap tokens, provide liquidity, and earn fees.
- Router Contract (
crypto-router
) - Go to Router Contract - Factory Contract (
crypto-factory
) - Go to Factory Contract - Pair Contract (
crypto-pair
) - Go to Pair Contract
- Token swaps
- Liquidity provision
- Automated market making
- Fee collection
The Router contract is the main entry point for users to interact with FuelSwap. It handles:
- Adding and removing liquidity
- Token swaps (exact input and exact output)
- Quote calculations
- Path-based multi-hop swaps
The Factory contract is responsible for:
- Creating new trading pairs
- Managing the list of all trading pairs
- Setting and updating fee parameters
The Pair contract implements the core AMM (Automated Market Maker) logic:
- Minting and burning liquidity tokens
- Executing swaps
- Maintaining reserves and price accumulators
- Implementing the constant product formula (x * y = k)
add_liquidity
: Add liquidity to a trading pairremove_liquidity
: Remove liquidity from a trading pairswap_exact_input
: Swap a fixed input amount for a minimum output amountswap_exact_output
: Swap a maximum input amount for a fixed output amount
create_pair
: Create a new trading pairget_pair
: Retrieve the asset ID for a trading pairall_pairs_length
: Get the total number of trading pairs
mint
: Mint liquidity tokens when adding liquidityburn
: Burn liquidity tokens when removing liquidityswap
: Execute a token swapget_reserves
: Retrieve the current reserves of a trading pair
FuelSwap implements several security measures:
- Reentrancy protection
- Overflow checks
- Deadline checks for transactions
- Minimum liquidity requirements
© 2025 0x77. All rights reserved.