Complete Tutorial
Build a working swap implementation in 5 minutes →
SDK Methods
Data Fetching
getQuotes(request)- Fetch optimized swap quotes
Simple Integration
executeSwap(params)- Complete swap with automatic approvals
Advanced Integration
quoteToCalls(quote, slippage, takerAddress)- Build swap calls for custom execution
How Solvers Work
Finding the optimal trade route on Starknet is a complex challenge. With tens of thousands of liquidity pools, varying gas costs, and fragmented liquidity across AMMs, CLOBs, and market makers, identifying the absolute best price is a non-trivial mathematical problem.The Complexity Problem
The Complexity Problem
For every trade, the solver must navigate a vast search space:
- Fragmented Liquidity: Liquidity is split across multiple protocols and pools.
- Gas vs. Price: A better price might cost more in gas. The solver must calculate the net benefit.
- Multi-Hop Routing: Direct swaps aren’t always best. Sometimes routing through 2 or 3 intermediate tokens yields a higher output.
- Real-Time Constraints: Market conditions change in milliseconds.
Why Trust avnu?
Why Trust avnu?
We have spent years building and refining our solver infrastructure to handle this complexity for you.
- Comprehensive Aggregation: We integrate every significant liquidity source on Starknet.
- Advanced Optimization: Our solvers run competing strategies in parallel to find the global maximum for your trade.
- Battle-Tested: We power a significant portion of Starknet’s trading volume, ensuring reliability and execution quality.
- Zero Maintenance: You get best-in-class execution without maintaining your own indexers or routing logic.
Smart Routing Example
Smart Routing Example
Trade: 10 ETH → USDCNaive approach (single pool):
- Output: 32,450 USDC
- Price impact: 0.8%
- Splits trade across multiple pools (e.g., 60% Pool A, 40% Pool B)
- Uses multi-hop routes when beneficial
- Output: 32,612 USDC
- Price impact: 0.3%
SDK Integration
Understanding Quote Response
buyAmount: Maximum output after solver optimizationpriceImpact: Price impact (lower is better)gasFeesInUsd: Total gas cost including all hopsroutes: How the solver split your trade
Advanced Features
API Reference
REST API Documentation
Complete HTTP endpoint reference, authentication, and request/response formats