latestOpenAPI 3.0.32026-08-10336178.7 KB

6b7d8bd51050

Withdraw

Get Withdraw Quote

Returns a withdrawal quote including the fee and a message for the user to sign in their wallet. Use this same endpoint for Ethereum, Solana, and Cardano; there are no Cardano-only public withdrawal quote endpoints.

In the Builder Codes flow, call this endpoint with the API wallet credentials created by /auth/builder/verify-signature. It works the same as the standard API wallet flow: the API wallet authenticates the builder integration for the connected user account, but the returned message_to_sign must still be signed by the user's blockchain wallet.

Important: This endpoint does NOT accept a recipient_address. The backend automatically uses the account's registered wallet address (from the connect flow). This prevents API wallet holders from redirecting withdrawals.

The recipient_address, usd_value, and fee are locked into a server-signed quote stored in Redis. The quote is single-use.

Message format by blockchain

  • Ethereum: message_to_sign is human-readable UTF-8 text for the EVM wallet to sign.
  • Solana: message_to_sign is human-readable UTF-8 text for the Solana wallet to sign as raw message bytes.
  • Cardano: message_to_sign is hex-encoded UTF-8 text. Pass the returned hex string as the CIP-30 signData payload. For UI display, you may hex-decode it, but the signature must cover the returned payload.

Cardano funding transaction

Cardano quote responses may include tx_cbor and validator_address. When tx_cbor is present, the wallet must sign that CBOR transaction and send the resulting signed_tx_cbor in the confirm step.

Authentication

Requires API wallet authentication via headers.

post/v2/withdraw/quote

Request body

mode'balance' | 'collateral'

Withdrawal mode. Omit or use balance for USD-value withdrawals from the user's trading balance. Use collateral for raw collateral withdrawals with asset_symbol and asset_amount.

usd_valuestring

USD amount to withdraw. Required for balance mode. String to preserve precision.

blockchain'ethereum' | 'solana' | 'cardano' required

Blockchain to withdraw to.

assetstring

Balance-mode withdrawal asset (e.g. ADA, USDM, USDC). Optional — defaults to the chain's native asset if empty.

asset_symbolstring

Collateral-mode raw asset symbol, e.g. LP_SUNDAE_USDCx_USDM. Required when mode is collateral.

asset_amountstring

Collateral-mode raw amount in the asset's smallest unit. Required when mode is collateral.

Response

Withdraw quote created

withdraw_idstring

Unique identifier for this withdrawal. Use this in the confirm step.

feestring

Withdrawal fee in USD. String to preserve precision.

message_to_signstring

Message payload for the user to sign in their wallet. Ethereum and Solana return human-readable UTF-8 text. Cardano returns hex-encoded UTF-8 text for CIP-30 signData; clients may hex-decode it for display, but the wallet signature must cover the returned payload. The message contains the wallet address, chain, amount, fee, timestamp, and withdraw ID.

tx_cborstring

Cardano only. Unsigned funding transaction CBOR hex. When present, the wallet must sign this transaction and submit the signed CBOR as signed_tx_cbor in the confirm step.

validator_addressstring

Cardano only. Validator address selected when tx_cbor was built. This is returned for visibility and is bound into the stored quote; clients do not send it back.