Skip to main content
An Ondo withdrawal moves USDC from the perps margin wallet to the connected wallet address. The provider plugin’s SDK signer HMAC-signs the request with the client-held API key, and the backend relays it to POST /v1/withdraw. The wallet is not prompted for the withdrawal itself. The API key needs the transfer scope. See Signing Model — The API key.

Withdrawal setup

Ondo sends a withdrawal only to an address in its address book. The SDK offers one destination: the address that logged in. Call getWithdrawFlow() to see if a setup step is outstanding.
The result depends on the account state: addWithdrawalAddress takes no params. It is a session step with signer USER. The venue issues a challenge and the user’s wallet signs it, so a wallet prompt appears. The SDK adds the address with the label LI.FI. See Signing Model.

Discover the withdrawable balance

Call getWithdrawableBalances() before you show a withdrawal form.
Ondo returns at most one row. The row has route: 'perps' and the USDC asset. The available field is the withdrawableMargin value of the venue balance. Ondo returns no row when withdrawableMargin is zero. Without a session, the read returns an empty array. The withdrawalFee field is the withdrawalFeeUSD value of the venue account. Ondo charges the fee in USD. The collateral is USDC, so the SDK reports the fee as the same number in the units of the row. An amount at or below the fee delivers nothing.

Submit a withdrawal

amount is a human-readable USDC string. The SDK reads your Ondo accountId from the stored session and adds it to the request. You do not pass it. The backend rejects any other destination, asset, or route with a validation error. The network is always Ethereum.

Withdrawal history

getActivity() returns a WITHDRAWAL item for each withdrawal that the venue did not fail or cancel. The item has no status field. It carries the amount, the asset, and the fee in USD when the venue reports one. It has an explorerLink when the venue reports a transaction. The SDK includes a withdrawal row when the venue status is WITHDRAWAL_PENDING, WITHDRAWAL_SUCCESS, complete, pending, or unknown. The SDK omits a row with status failure or cancelled, because no value left the account.

Errors

See Error Codes for the full code list.