
YakSwap is an on-chain decentralized exchange (DEX) aggregator for EVM-compatible chains that finds optimal token swap paths considering gas costs.
YakSwap is an on-chain decentralized exchange (DEX) aggregator designed for Ethereum Virtual Machine (EVM) compatible blockchains such as Avalanche, Arbitrum, and Optimism. It provides a set of smart contracts that enable users and developers to find the optimal swap path between two tokens, maximizing the net output amount by factoring in both the token exchange rates and the gas costs associated with executing the swaps. This approach helps users achieve better trade efficiency by considering the often-overlooked impact of gas fees on overall swap profitability.
The core component, YakRouter, serves as the user-facing interface for price queries and trade execution. It exposes functions like findBestPathWithGas, which returns the best token swap route with gas cost estimates, and swapNoSplit, which executes trades along a specified path. YakSwap uses adapters as modular interfaces to interact with various external liquidity sources and protocols, allowing it to aggregate liquidity across multiple DEXs. These adapters implement query and swap methods to facilitate price discovery and trade execution.
YakSwap is primarily targeted at DeFi developers and infrastructure teams looking to integrate efficient on-chain swap routing into their applications or services. It requires integration with EVM-compatible chains and can be used off-chain to query optimal paths before submitting transactions. The project is open source under GPL-3 and supports local development with tools like Hardhat for testing, deployment, and verification. While it is not audited, the community can engage via the YakDevs Telegram group for support and updates.
Developers can get started by cloning the repository, installing dependencies, setting environment variables, and running tests or deployment scripts. The modular adapter architecture allows easy extension to new liquidity sources. YakSwap’s on-chain pathfinding and gas-aware routing differentiate it from many off-chain aggregators by enabling fully on-chain price discovery and execution, which can improve transparency and composability in DeFi applications.
Token swaps on decentralized exchanges often suffer from suboptimal routing that ignores gas costs, leading to less efficient trades. Developers and users lack a fully on-chain solution that finds the best trade path considering both price and gas fees across multiple liquidity sources.
Returns the best token swap path with estimated gas costs for a given input amount and tokens.
Explore web3 competitors and apps like YakSwap.

Open Source | |
|---|---|
| Price (Monthly) | Free |
| Price (Annual) | Free |
| Messaging | N/A |
| Support | Community support via Telegram |
| Analytics |
Reliable RPC, powerful APIs, and zero hassle.
YakSwap provides comprehensive open-source resources including smart contract code, example usage scripts, deployment and testing instructions, and community support channels.
Executes token swaps along a specified path without splitting the trade, supporting fee deductions.
Standardized adapter interface to query prices and execute swaps on external DEXs.
DeFi developers embed YakSwap’s router contracts to enable users to swap tokens with optimal routing and gas cost awareness.
Frontend teams use YakSwap’s off-chain query methods to display best swap routes and prices factoring in gas fees.
Infrastructure developers add new adapters to integrate additional DEXs or liquidity protocols into YakSwap’s aggregation.
Discover trusted tools and services in the QuickNode Marketplace. Everything you need to launch faster and scale smarter.





| Composability | |||
| Cross-Chain | |||
| Customizability | |||
| Developer Support | |||
| Ease of Integration | |||
| Performance |