Why One Swap Can Need Many Legs
You want to swap a token on one chain for a different token on another chain. It feels like one action. Behind the scenes it is often three or four.
The usual steps
- Swap the token you hold into an asset that can travel well between chains.
- Move that asset to the destination chain.
- Swap it into the token you actually want.
- Deliver it to your address.
Each step has its own price, its own fees and its own time limit.
Where it goes wrong
Done by hand, the steps drift apart. A quote expires while the previous step is still landing. A price moves between step one and step three. A step fails and the funds sit somewhere in the middle.
How an engine handles it
A routing engine plans all the legs together. It checks that each leg's time window covers the one before it, re-quotes a later leg with the amount that actually arrived, and keeps a clear refund path if something fails. When no direct route is reliable, it can suggest the steps plainly: swap X to Y, then Y to Z.
What stays with you
Every leg is signed from your own wallet. The engine prepares the transactions; you approve them.