DerpDex.com
  • ðŸĪŠDerpDEX Overview
    • ðŸĪ”Vision, Why & Gap
  • 🔗Official Links
  • 🚀Roadmap & Launch Plan
  • 🧑‍ðŸĪâ€ðŸ§‘Derp DAO
  • Tokenomics
    • ðŸĪ‘DERP
    • 🔐xDERP
      • Vesting
      • Conversion
      • Earnings sharing
    • ðŸ§ŪToken Distribution
      • Release schedule
      • DERP reserved wallets
    • 🎊Airdrops!
  • Protocol
    • ⚒ïļAMM
      • 😍Concentrated Liquidity (CLAMM)
      • ðŸĪĐv2: DMM
    • 🔄Swap
      • Smart Routing
    • ðŸ’đLiquidity Provider
      • Concentrated Liquidity
    • ðŸŒąFees
      • Stablecoins
      • Other cryptocurrencies
    • 🌉Bridge
    • ðŸĪAggregator
    • 🛠ïļInscription Bridge
  • CAMPAIGN
    • 🎆Genesis Launch
  • Getting Started
    • Getting Started
    • Bridge
      • zkSync Era
      • Base
      • opBNB
      • DERP Token Bridge
    • Add Liquidity
    • Withdraw Liquidity
    • Swap
    • Inscription Bridge
  • CONTRACTS
    • Contracts
    • Contract Addresses
    • ðŸ›ĄïļAudits
  • Products
    • Genesis Pools
      • How it works?
      • Rewards
      • Genesis campaign
      • Terminology
    • Zap-to-Earn
    • Launchpad
    • 🧑‍ðŸŒūYield Farming
      • Yield Booster
      • How to Farm?
      • FAQ
    • ⭐Staking
      • How to Stake or Redeem?
  • Resources
    • ❓FAQ
    • ðŸĪPartnership
    • ðŸĪ“Meme-token launch
    • 📗zkSync Gas Fee Guide
    • 🌉DERP Bridge via OTC
Powered by GitBook
On this page
  1. Protocol
  2. Swap

Smart Routing

PreviousSwapNextLiquidity Provider

Last updated 1 year ago

Smart routing is a crucial mechanism being used by DerpDEX to optimise the process of swapping tokens for users. It involves dynamically determining the most efficient path for executing a trade across multiple liquidity sources while minimising slippage and maximising trading outcomes. When a user initiate a token swap, DerpDEX checks if the token pool is available and there is sufficient liquidity to the pool. If the liquidity for the token pool is available, the swap analysis like price impact, fee and slippage to the user.

If no liquidity is found for the tokens, the combined multiple pools will be used to execute swap. Swap through multiple route won't affect the trade and routing is done by DerpDEX in the background. Instead by using router contract, DerpDEX will find the most efficient path using all the existing pools.

The smart routing optimises trading routes, splits orders if necessary, and considers gas costs. If no liquidity found, we will use 1inch DEX aggregator to find the routes from other protocols (DEX) on ZkSync Era at the end. This ensures that DerpDEX will work as expected even if it runs lows on liquidity.

Below is the flow stating how tokens are swapped from more than one pool to provide the required token to the user.

🔄
With CLAMM smart-router