Cloak API

Amounts & assets

Every amount in this API is a decimal string of raw base units, never a float, never a display value.

"10000000000" in an asset with 6 decimals is 10,000 tokens. Keep amounts as strings to avoid rounding errors.

Asset IDs

Use the assetId returned by GET /tokens. Cache the token list for minutes, not hours, because supported assets and limits can change.

assetIdSymbolDecimalsMint
veilo-solSOL911111111111111111111111111111111
veilo-wsolwSOL9So11111111111111111111111111111111111111112
veilo-usdcUSDC6EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
veilo-usdtUSDT6Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
veilo-usd1USD16USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB
veilo-jupJUP6JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN

SOL and wSOL are not aliases

Native SOL uses the all-zero mint and has its own pool. Wrapped SOL is a separate pool with separate limits and a distinct assetId. Sending a user to the wrong one gives them the wrong minimum.

exact_in and exact_out

mode decides whether amount is what the sender pays or what the recipient receives.

modeWhat is pinnedUse it when
exact_inWhat the sender pays.The user chooses an amount to spend. This is the default.
exact_outWhat the recipient receives.Your app promises a specific delivered amount.

exact_out delivers the quoted amount

A 10,000.00 USDC exact_out target delivers 10,000.00 USDC after fees.exact_out is same-asset only; a private swap must use exact_in, which still delivers an exact amount.

Limits are per asset and live

Read the current minimum and maximum from GET /tokensor a limit error. Do not hard-code them. See Limits.