Get Withdrawable Amounts
Query withdrawable amounts for one or more collateral symbols on the authenticated subaccount.
Endpoint
POST https://papi.synthetix.io/v1/tradeRequest
Request Format
{
"params": {
"action": "getWithdrawableAmounts",
"subAccountId": "1867542890123456789",
"symbols": ["USDT", "WETH"]
},
"expiresAfter": 1704153600,
"signature": {
"v": 28,
"r": "0x19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef",
"s": "0xabcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Request parameters wrapper |
params.action | string | Yes | Must be "getWithdrawableAmounts" |
params.subAccountId | string | Yes | SubAccount ID to query |
params.symbols | string[] | Yes | Collateral symbols to query. Must include 1-100 symbols |
| Parameter | Type | Required | Description |
|---|---|---|---|
nonce | uint64 | Yes* | Positive integer nonce (must be incrementing and unique per request) |
signature | object | Yes | EIP-712 signature object |
expiresAfter | uint64 | No | Unix milliseconds expiration timestamp (5x rate limit on stale cancels) |
:::info Common Parameters
These are top-level request parameters. The subAccountId parameter is specified within the params object (see each endpoint's parameter table).
:::
:::info SubAccountAction Endpoints
Endpoints using SubAccountAction signing (getPositions, getOpenOrders, getOrderHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates, getWithdrawableAmounts) do not require the nonce parameter. Only signature and optional expiresAfter are needed.
:::
Response
Success Response
{
"status": "ok",
"response": {
"items": [
{
"symbol": "USDT",
"withdrawableAmount": "995.00",
"quantity": "1000.00",
"pendingWithdraw": "0",
"withdrawFee": "5.00"
}
],
"totalWithdrawableUsdt": "995.00"
},
"request_id": "5ccf215d37e3ae6d"
}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 |
Error Response
{
"status": "error",
"error": {
"code": "VALIDATION_ERROR",
"message": "At least one symbol is required"
},
"request_id": "5ccf215d37e3ae6d"
}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
Signing
All trading methods are signed using EIP-712. Each successful trading request will contain:
- A piece of structured data that includes the sender address
- A signature of the hash of that structured data, signed by the sender
For detailed information on EIP-712 signing, see EIP-712 Signing.
Nonce Management
The nonce system prevents replay attacks and ensures order uniqueness:
- Use any positive integer as nonce
- Each nonce must be greater than the previous one (incrementing)
Date.now()is a convenient option, not a requirement- If nonce conflicts occur, increment by 1 and retry
:::note SubAccountAction Exception
SubAccountAction endpoints (getPositions, getOpenOrders, getOrderHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates, getWithdrawableAmounts) do not require a nonce. Only the signature and optional expiresAfter parameters are needed.
:::
| 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 |
