Skip to content
Mermaid templates

DEX Swap Path

Token-A → token-B swap via a router with optimal multi-hop pool path.

Template previewMermaid
Rendering…

Make it your own.

sequenceDiagram
participant U as User wallet
participant R as Router
participant P1 as Pool A-WETH
participant P2 as Pool WETH-B

U->>R: swapExactTokensForTokens(A, B, minOut, path=[A,WETH,B])
R->>U: pull token A (transferFrom)
R->>P1: swap A → WETH
P1-->>R: WETH amount
R->>P2: swap WETH → B
P2-->>R: B amount
R->>U: transfer B to user
Note over R,P2: Slippage protection: revert if B < minOut