srcToken = position.address); the destination is any token on any chain (destToken / destChainId). NFT-based LP positions (Uniswap V3 and similar) are identified by positionDetails.nftId. Pick a chain below; the tabs stay in sync across Setup, Steps, and End-to-end.
EVM withdrawals authorize the position token through Permit2 (no EIP-2612). Solana withdrawals carry no approval step, you sign and send the built transactions directly.
Setup
- EVM
- Solana
Exit a Uniswap V3 position on Base back into USDC.
Protocol IDs (
provider) come from getZapProviders, scoped per chain by getZapChains.Steps
- EVM
- Solana
1
Find the position
List the account’s open positions for a protocol, then pick the one to exit. Each position carries its
address, chainId, amount, and optional nftDetails.Withdraw the full balance with
position.amount, or pass any smaller amount for a partial exit.2
Quote
Build the exit route. The source token is the position; the destination is whatever token and chain you want back. Read-only.
3
Approve
Authorize the position token through Permit2, approving once on-chain only if the allowance is short.
4
Build & execute
Sign the Permit2
PermitSingle, attach permitData, build the route, and execute.5
Status
Poll to a terminal state. Zap status is uppercase:
PENDING, COMPLETED, FAILED, or REFUNDED.Cross-chain withdrawals (
destChainId different from the position’s chain) run exit-then-bridge and settle slower. status.steps shows each leg.End-to-end
- EVM
- Solana
API usage
The zap API lives onhttps://zap.dzap.io/v1. List positions and check status with GET; quote and build are POST. The position address is the srcToken, and NFT LPs add positionDetails.
Notes
- NFT LP positions: pass
positionDetails.nftId. Fungible LP/vault tokens omit it. - Native destination (ETH, SOL): the router unwraps to the native asset, nothing extra to configure.
- Partial exit: pass any amount up to
position.amount. - Cross-chain: set
destChainIdto receive the token on another chain; expect bridge latency.