Parallel Multi-Hop

Advanced parallel routing with internal multi-hop chains

Parallel Multi-Hop is the most sophisticated swap type, combining batch splitting with multi-hop routing to optimize very large trades across multiple complex paths.

Structure

         ┌─[DEX A]→ TokenB ─[DEX B]→┐
         │     (Path 1: 2 hops)       │
TokenA ──┤                             ├─> TokenD
         │     (Path 2: 2 hops)       │
         └─[DEX C]→ TokenC ─[DEX D]→ ┘

Characteristics:

  • Multiple parallel routes

  • Each route has multiple hops

  • Combines Batch + Multi-Hop strategies

  • Maximum liquidity access

  • Highest complexity

When Parallel Multi-Hop is Used

The API automatically selects this type when:

Very large trade - Amount exceeds single-path capacity ✅ Multiple indirect paths - Several multi-hop routes available ✅ Rate optimization - Complex routing beats simpler approaches ✅ Sufficient gas budget - Extra gas cost justified by rate improvement

Real-World Example

Scenario: $500k TokenA → TokenD Swap

Why Parallel Multi-Hop:

Example Response

Breakdown:

  • Path 1 (60%):

    • 300k TokenA → 174 WBNB (PancakeSwapV3)

    • 174 WBNB → 285k TokenD (UniswapV2)

  • Path 2 (40%):

    • 200k TokenA → 190k USDT (UniswapV3)

    • 190k USDT → 190k TokenD (PancakeSwapV2)

  • Total: 475k TokenD

  • Gas: 450k units (~$1.50 on BSC)

Smart Contract Encoding

ParallelMultiHopParams Structure

Execution Flow

Gas Costs

Parallel Multi-Hop is the most expensive:

Configuration
BSC Gas
Ethereum Gas
Cost @ 5 gwei

2 paths × 2 hops

350k-450k

400k-550k

$1.01-$1.30

3 paths × 2 hops

500k-650k

600k-800k

$1.45-$1.88

2 paths × 3 hops

450k-600k

550k-750k

$1.30-$1.74

3 paths × 3 hops

650k-850k

800k-1100k

$1.88-$2.46

Gas Formula:

Advantages

✅ Maximum Liquidity Access

Combines liquidity from:

  • Multiple DEX protocols

  • Multiple token pairs

  • Multiple routing paths

✅ Minimal Price Impact

Large amounts split intelligently:

Swap Size
Single Path Impact
Parallel Multi-Hop Impact
Savings

$100k

2%

0.8%

$1,200

$500k

10%

3%

$35,000

$1M

25%

6%

$190,000

$5M

70%+

15%

$2,750,000+

✅ MEV Resistance

Complex routing makes front-running less profitable:

  • Multiple pools to manipulate

  • Split makes individual manipulation ineffective

  • Higher complexity = higher MEV bot cost

✅ Best Rates for Whales

For institutional-size trades:

  • Gas cost negligible vs. savings

  • Access to all available liquidity

  • Optimal route selection by algorithm

Limitations

❌ Very High Gas Cost

❌ Maximum Complexity

  • Hardest to understand

  • Most points of failure

  • Complex debugging

  • Difficult to predict output

❌ Compounding Risks

Each path has multiple failure points:

❌ High Slippage Tolerance Required

Compounding slippage across paths and hops:

Code Examples

JavaScript Implementation

Python Implementation

Best Practices

✅ Only for Large Swaps

Minimum viable swap size:

✅ Verify All Paths

✅ Higher Gas Limit

Always add buffer:

✅ Monitor Intermediate Tokens

Track bridge token prices:

When to Use

✅ Ideal For:

  • Whale trades ($500k+)

  • Institutional swaps

  • Large OTC deals

  • Treasury operations

  • When rate >> gas cost

❌ Avoid For:

  • Small swaps (<$50k)

  • Retail traders

  • High-frequency trading

  • Gas-sensitive operations

  • Simple token pairs with deep direct pools

Comparison Summary

Feature
Simple
Batch
Multi-Hop
Parallel Multi-Hop

Gas Cost

⭐⭐⭐⭐⭐

⭐⭐⭐⭐

⭐⭐⭐

⭐ Highest

Best Rate

⭐⭐⭐

⭐⭐⭐⭐

⭐⭐⭐

⭐⭐⭐⭐⭐ Best

Liquidity Access

⭐⭐

⭐⭐⭐⭐

⭐⭐⭐

⭐⭐⭐⭐⭐ Maximum

Complexity

⭐⭐⭐

⭐⭐⭐

⭐⭐⭐⭐⭐ Highest

Min Swap Size

Any

$100+

$50+

$50k+

Slippage

0.1-0.5%

0.3-0.8%

0.5-1%

1-2%

Summary

Parallel Multi-Hop is the ultimate routing strategy for:

  • ✅ Maximizing rate on very large trades

  • ✅ Accessing all available liquidity

  • ✅ Minimizing price impact for whales

  • ✅ When gas cost is negligible vs. swap size

It's overkill for:

  • ❌ Retail-sized swaps

  • ❌ Gas-sensitive use cases

  • ❌ Simple token pairs

  • ❌ When simpler routing suffices

Rule of thumb: If your swap is <$50k, you probably don't need this.

Last updated