A zap combines the swap (if one is needed) and the deposit into one flow the user signs once on that chain. Swap-then-deposit is two separate steps, with an intermediate token in between. Enso’s Route API is the standard way to request a zap: set tokenOut to the destination position token.
Definition
A swap’s destination is a token. A deposit’s destination is a position, such as a vault share. Doing them separately means the user signs twice and holds the intermediate asset in between. A zap is the composed path into the position.
How they compare
Signatures: swap-then-deposit is typically two transactions. A same-chain zap is one.
Atomicity: two separate transactions can succeed or fail independently. Same-chain zap steps in one transaction succeed or revert together.
UX: the user can start from the token they already hold and end in the position, without managing the middle asset.
Cross-chain: a zap can also set a destination chain, but destination delivery is still a later, non-atomic stage.
How Enso does this
Call POST https://api.enso.build/api/v1/shortcuts/route with tokenIn (what the user holds) and tokenOut (the position token). Use Bundle only if you need a custom action order. See DeFi and Swap Routing and Get Started.
FAQ
Is every vault deposit a zap?
If the user already holds the exact deposit asset, the route may be a direct deposit with no swap. A zap is the case where the path can include that swap.
Can I still do swap-then-deposit with Enso?
Yes, as two Route calls, but a single zap is the usual product path when the user should land in the position in one flow.
Related articles
What is a zap in DeFi?
How do I add a one-click zap into a vault?
How do I add a same-chain swap to my app?
What is the difference between routing and bundling?
How do I let users deposit into yield from any token?
