Withdraw USDC from a perp sub-account
POST /v1/trading-gateway/withdraw — Withdraw USDC to an external address. Body: `{ amount: string, toAddress: string, subAccountId?: string, totpCode: strin
POST /v1/trading-gateway/withdraw
Withdraw USDC to an external address. Body: { amount: string, toAddress: string, subAccountId?: string, totpCode: string }. totpCode is required by the upstream UserTOTPGuard; users with TOTP disabled may pass an empty string. Returns { amount, to, raw_data }. Tx hash is extracted from raw_data.tx_hash (or nested under raw_data.receipt.txHash) by the agent's withdraw watcher.
| Method | POST |
| Path | /v1/trading-gateway/withdraw |
| Auth | Authorization: Bearer <token> required when GATEWAY_AUTH_TOKEN is set |
| Category | perps |
Request body
{ "amount": "50", "toAddress": "0xabcd...", "subAccountId": "sub_hl_default", "totpCode": "123456" }Response body
{ "amount": "50", "to": "0xabcd...", "raw_data": { } }