Cloak API
Private swap
Send one asset and have the recipient receive another. Same endpoints, same flow. You change one field.
Set destinationAssetId to a different swappable asset and Cloak adds a conversion between the deposit and the payout. Quoted duration is longer than a send because of the extra on-chain leg; both swap states still report EXCHANGING, so your status handling needs no new case.
Supported pairs
veilo-usdc, veilo-usdt, veilo-usd1 and veilo-jup swap in any combination. veilo-sol and veilo-wsol do not. Their swap transaction exceeds Solana's size limit.
A rejected pair will not start working
What changes in the request
| Field | Description | |
|---|---|---|
| destinationAssetIdstring | required | Different from sourceAssetId. This one field is what makes the order a swap. |
| modestring | optional | Must be exact_in. exact_out returns QUOTE_FAILED on a cross-asset order. |
| slippageBpsinteger | optional | How far below the quoted route price the swap commits its floor. Default 100, capped at 500. |
amountOut is still exact, not a minimum: the swap commits a floor on-chain and the vault keeps any surplus. So slippageBps is not delivery uncertainty; it trades rate against completion rate. Wider completes more often and delivers less, tighter the reverse. A swap that fails before converting refunds in the source asset.
Fees and refunds
The payout spends the post-conversion note, so fee, feeBreakdown and amountOut are all in the destination token. A swap adds a fourth component, poolSwapFee, charged by the destination pool and neither ours nor yours.
exact_in · veilo-usdc → veilo-usdt · feeBps 50 · slippageBps 100
The minimum is $10, the same as a send, but that is the smallest swap that can complete, not a cheap one. All-in cost runs about 15% at $10, 4% at $100 and 2% at $1,000. Show the quote, never a rate card.
A refund can return the destination asset
