Smart Contract Architecture
- Factory Contract: Deploys new swap pools with immutable curve parameters.
- Proxy Pattern: Used for gas-efficient deployment. Each pool is a proxy instance with its own parameters and state.
- Main Swap Contract: Handles swaps, enforces curve invariants, and supports flash swaps132.
- Gas Costs: Approximately 350,000–650,000 gas per swap (about 2x Uniswap v3), but still acceptable, especially on Layer 2 solutions132.
- Precision: Uses direct fraction-based pricing, supporting tokens with 6–18 decimals132.
- JavaScript SDK and utilities: Simplify integration and parameter calculation.
- Open Source: All code is available in the EulerSwap GitHub repository