Swap Routing
Blizzard's frontend includes a client-side router that routes trades across liquidity pools. This enables users to swap two assets even if a desired asset pair does not exist in one pool, or to find a better exchange rate if existing pool pairs don't offer a favorable amount out.
Conceptual Example Case
Consider a slimmed-down version of Blizzard that only has two pools:
- Pool 1: USDC, USDT
- Pool 2: USDC, DAI
If a user wants to swap from USDT to DAI, there's no one pool they can swap through. To make this USDT to DAI exchange happen, the user will first swap through Pool 1 for USDC, then swap the amount out through Pool 2 for DAI. In effect, this provides an equivalent to directly swapping USDT for DAI.