💱How Swaps Work on BrewDEX

Swapping tokens on BrewDEX is fast, efficient, and fully non-custodial. Designed to deliver the best execution price with minimal slippage, BrewDEX’s trading engine aggregates liquidity from multiple sources and routes transactions intelligently across chains.

Whether you’re a retail trader or an automated strategy, BrewDEX is optimized for performance, transparency, and capital efficiency.

⚙️ Swap Engine Overview

The SwapEngine module is the heart of BrewDEX’s trading infrastructure. It supports:

  • On-chain token swaps within a single chain (e.g., BNB → USDT on BSC)

  • Cross-chain token swaps using bridge-backed asset routing (e.g., ETH on Ethereum → BNB on BSC)

  • Multi-hop routing (e.g., BRE → WETH → USDC)

BrewDEX uses a modular swap router that plugs into multiple Automated Market Makers (AMMs) and liquidity sources.

🧭 Routing Logic

To deliver optimal pricing, BrewDEX's router evaluates:

  • Token pair availability across AMMs

  • Real-time liquidity depth

  • Estimated gas cost per route

  • Slippage estimates

  • Aggregated price impact

If multiple routes are available (e.g., direct pool vs. multi-hop), the system auto-selects the best outcome.

Routing is powered by BrewDEX's internal smart contract logic and may extend to external aggregators in the future (e.g., 0x, 1inch plugin support).

📉 Slippage Control

Slippage refers to the difference between the expected and actual execution price of a trade.

On BrewDEX, users can:

  • Set their maximum slippage tolerance (e.g., 0.5%, 1%, 3%)

  • Enable "auto slippage" for volatile tokens

  • See price impact before confirming any swap

Slippage protection is enforced at the smart contract level. If the trade exceeds your defined slippage limit, it is automatically reverted.

💧 Liquidity Flow

BrewDEX aggregates liquidity from multiple sources:

  • Native AMMs on each chain (e.g., PancakeSwap, Uniswap, Sushi)

  • Internal liquidity pools (BRE-based pairs)

  • Cross-chain liquidity bridges, powered by LayerZero and Axelar

Liquidity routing respects bridge delays and wrap/unwrap logic when swapping across networks.

🔀 Supported Swap Types

Swap Type
Description

Direct Swap

Single hop within one chain

Multi-hop Swap

Routed through multiple intermediary tokens

Cross-Chain Swap

Swap + bridge operation in one unified transaction

Token-to-Native

Swap to native gas tokens (e.g., BNB, ETH)

All swaps are executed atomically, meaning either the entire trade succeeds, or none of it does—ensuring fund safety.

📲 User Experience

Swapping tokens on BrewDEX:

  1. Connect wallet → Choose token pair

  2. Input amount to swap

  3. Adjust slippage (optional)

  4. Review estimated output and price impact

  5. Confirm → Sign the transaction

  6. Transaction processed → Token received

For cross-chain swaps, the system will provide a step-by-step progress tracker with confirmation statuses.

🧪 Advanced Features (Coming Soon)

  • Limit orders (on-chain)

  • Gasless swap (meta-transactions)

  • Custom liquidity routing for dApps via API

  • Swap mining rewards via BRE staking multiplier

Last updated