Liquidity Pools
Liquidity pools are the core of GO Swap. Each pool contains two tokens and enables trades between them using an automated pricing algorithm.
How Pools Work
Pools follow the constant product formula:
x × y = k
Where:
- x = reserve of token A
- y = reserve of token B
- k = constant liquidity invariant
Example:
If a pool has 1000 tokens A and 10 tokens B:
- k = 1000 × 10 = 10,000
- If someone buys 1 token B, they need to provide enough token A to maintain k
- This automatically adjusts the price based on supply and demand
Price Discovery
Prices adjust automatically based on trades:
- Buy pressure → Price increases
- Sell pressure → Price decreases
- No orders needed → Prices are algorithmic
The current price is determined by the ratio of reserves:
Price of A in terms of B = Reserve(B) / Reserve(A)
Providing Liquidity
Users can deposit token pairs into pools and receive LP tokens representing their share of the pool.
Benefits
✅ Earn swap fees - Collect a portion of all trades
✅ Liquidity mining rewards (future)
✅ Support market depth - Enable larger trades with less slippage
✅ Flexible redemption - Remove liquidity anytime
How to Add Liquidity
- Choose a token pair (e.g., GO/BNB)
- Deposit equal value of both tokens
- Receive LP tokens proportional to your contribution
- LP tokens represent your share of the pool
How to Remove Liquidity
- Return your LP tokens to the pool
- Receive your proportional share of both tokens
- Your share includes accumulated trading fees
Impermanent Loss
When providing liquidity, be aware of impermanent loss:
- Occurs when token prices diverge from deposit ratio
- Loss is "impermanent" because it can reverse if prices revert
- Mitigated by trading fees earned over time
Example:
If you deposit 1 ETH + 2000 USDC, and ETH price doubles, your position will rebalance automatically. You'll have less ETH and more USDC than if you just held the tokens.
Trading Fees
Each swap incurs a small fee (typically 0.3%) that goes to liquidity providers:
- 0.25% to liquidity providers
- 0.05% to protocol treasury (configurable)
Fees are automatically added to the pool, increasing the value of LP tokens over time.
Pool Creation
Any user can create a new liquidity pool for any token pair:
- Select two tokens not yet paired
- Provide initial liquidity
- Set the initial price ratio
- Receive LP tokens for the new pool
Once created, others can add/remove liquidity or trade against the pool.