Get Withdrawable Amounts (WebSocket)
Query withdrawable amounts for one or more collateral symbols through the trade WebSocket.
Endpoint
ws.send() wss://api.synthetix.io/v1/ws/tradeRequest
Request Format
{
"id": "withdrawable-1",
"method": "post",
"params": {
"action": "getWithdrawableAmounts",
"subAccountId": "1867542890123456789",
"symbols": ["USDT", "WETH"],
"expiresAfter": 1704153600,
"signature": {
"v": 28,
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Client-generated request identifier |
method | string | Yes | Must be "post" |
params.action | string | Yes | Must be "getWithdrawableAmounts" |
params.subAccountId | string | Yes | Subaccount identifier |
params.symbols | string[] | Yes | Collateral symbols to query. Must include 1-100 symbols |
params.expiresAfter | integer | No | Optional expiration timestamp |
params.signature | object | Yes | EIP-712 signature using SubAccountAction |
Response Format
Success Response
{
"id": "withdrawable-1",
"status": 200,
"result": {
"status": "success",
"response": {
"items": [
{
"symbol": "USDT",
"withdrawableAmount": "995.00",
"quantity": "1000.00",
"pendingWithdraw": "0",
"withdrawFee": "5.00"
}
],
"totalWithdrawableUsdt": "995.00"
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
items | array | Per-collateral withdrawable amounts |
items[].symbol | string | Collateral symbol |
items[].withdrawableAmount | string | Amount currently withdrawable for this collateral |
items[].quantity | string | Current collateral quantity |
items[].pendingWithdraw | string | Amount already pending withdrawal |
items[].withdrawFee | string | Withdrawal fee for this collateral |
totalWithdrawableUsdt | string | Aggregate USD-equivalent withdrawable value |
Implementation Notes
- Uses
SubAccountActionEIP-712 signing withaction: "getWithdrawableAmounts" symbolsmust be non-empty and cannot exceed 100 entries- Requests can return HTTP 400 when the account is in liquidation
| Error Code | Description | Retryable |
|---|---|---|
UNAUTHORIZED | EIP-712 signature validation failed | No |
VALIDATION_ERROR | Request validation failed | No |
MISSING_REQUIRED_FIELD | Required field is missing | No |
INVALID_FORMAT | Field format is invalid | No |
INVALID_VALUE | Invalid parameter value | No |
RATE_LIMIT_EXCEEDED | Too many requests in time window | Yes |
INSUFFICIENT_MARGIN | Not enough margin for trade | No |
ORDER_NOT_FOUND | Order does not exist | No |
OPERATION_TIMEOUT | Operation timed out | Yes |
