🛣️What is routing

Ever wondered how Madhouse consistently finds you the best rates? Here's how our routing engine does its magic—without the technical jargon.

When you initiate a swap, Madhouse's routing engine:

  1. Checks all available liquidity sources (DEXs, liquidity pools, etc.) on Monad to find the most favorable routes.

  2. Calculates multiple possible routes to optimize your swap based on token availability, price impact, and transaction costs (gas).

  3. Splits your order if beneficial, meaning your swap could involve multiple exchanges to ensure the best overall outcome.

  4. Executes your swap in a single, smooth transaction handled entirely by our smart contracts. If at any point conditions change (prices shift significantly), your transaction safely reverts—no funds lost.

Example: Imagine you want to swap 1,000 MON tokens for USDC, but there’s no direct MON/USDC pool. Madhouse can automatically set up a multi-hop path—first swapping MON for ETH, then swapping ETH for USDC—by sourcing liquidity from multiple DEXs to give you the best possible rate.

For example, your transaction will start with 1000 MON going through the MON/ETH pool on DEX A and the resulting ETH routed to a ETH/USDC pool on DEX B. By coordinating multiple hops across different protocols, Madhouse ensures you end up with more USDC than you would using just a single route.

Last updated