Skip to content

Withdraw Collateral

Withdraw collateral from your Synthetix trading account back to your wallet, subject to approval, margin requirements and risk checks.

Withdrawals are supported for any collateral type held in the subaccount — including USDT and non-USDT assets such as WETH or other supported collaterals. The withdrawal fee is denominated in the same asset being withdrawn (e.g., a WETH withdrawal incurs a fee in WETH, not USDT).

Endpoint

POST https://papi.synthetix.io/v1/trade

Request

Request Format

{
  "params": {
    "action": "withdrawCollateral",
		"subAccountId": "1867542890123456789",
    "symbol": "USDT",
    "amount": "1000.0",
    "destination": "0x742d35Cc6634C0532925a3b8D371d1c62a39b6e2"
  },
  "nonce": 1704067200000,
  "signature": {
    "v": 28,
    "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
  },
  "expiresAfter": 1704067300
}

Request Parameters

ParameterTypeRequiredDescription
paramsobjectYesAction object containing withdrawal details
params.actionstringYesMust be "withdrawCollateral"
params.subAccountIdstringYesSubaccount identifier
params.symbolstringYesCollateral asset symbol to withdraw. Accepts any supported collateral (e.g., "USDT", "WETH").
params.amountstringYesAmount to withdraw as decimal string (e.g., "1000.0")
params.destinationstringYesDestination wallet address (0x-prefixed Ethereum address)
nonceintegerYesPositive integer, incrementing nonce
signatureobjectYesEIP-712 signature object
expiresAfterintegerNoExpiration timestamp in seconds (optional)

:::warning Manager restriction Manager wallets may only withdraw to the subaccount owner's wallet address (typically the Gnosis Safe). Attempting to withdraw to any other address returns HTTP 403 with error code forbidden and message "Managers may only withdraw to the owner's wallet address". See Smart Contract Accounts (Safe) for the full manager setup. :::

Response

Success Response

{
  "status": "ok",
  "response": {
    "requestId": "5ccf215d37e3ae6d",
    "symbol": "USDT",
    "amount": "1000.0",
    "destination": "0x742d35Cc6634C0532925a3b8D371d1c62a39b6e2",
    "timestamp": 0,
    "withdrawTime": 0
  },
  "request_id": "5ccf215d37e3ae6d"
}

Response Fields

FieldTypeDescription
requestIdstringEchoes the client request_id from the response envelope for end-to-end correlation
symbolstringAsset symbol being withdrawn
amountstringAmount being withdrawn
destinationstringDestination wallet address
timestampintegerDeprecated — always returns 0 (pending removal)
withdrawTimeintegerWithdrawal processing timestamp in milliseconds — currently returns 0

Error Response

{
  "status": "error",
  "error": {
    "message": "Insufficient withdrawable balance",
    "code": "VALIDATION_ERROR"
  },
  "request_id": "5ccf215d37e3ae6d",
  "timestamp": 1735689900000
}

Validation Rules

  • nonce must be a positive integer, incrementing and unique per request
  • symbol must be a valid collateral symbol supported by the account (e.g., "USDT", "WETH"). Non-USDT collaterals are supported provided they are held in the subaccount and have a configured withdrawal fee.
  • amount must be a positive number as string
  • amount must not exceed the asset's QuantityPrecision decimal places — query POST /v1/info (getAssets) to retrieve the allowed precision and round client-side before sending
  • destination must be a valid Ethereum address (0x-prefixed)
  • subAccountId must be a valid subaccount owned by or managed by the signing account
  • The requested collateral must be present on the account — if it is not, a "collateral not found" error is returned before any balance or margin check is performed (see Error Handling)
  • Account must have sufficient withdrawable balance of the specified asset
  • Withdrawal must not violate margin requirements
  • Owners may withdraw to any valid Ethereum address
  • Managers may only withdraw to the subaccount owner's wallet address; any other destination returns HTTP 403
  • Delegate addresses cannot initiate withdrawals

EIP-712 Signature Structure

The withdrawal request fields are signed using EIP-712:

WithdrawCollateral Type Definition

const WithdrawCollateralTypes = {
  WithdrawCollateral: [
    { name: "subAccountId", type: "uint256" },
    { name: "symbol", type: "string" },
    { name: "amount", type: "string" },
    { name: "destination", type: "address" },
    { name: "nonce", type: "uint256" },
    { name: "expiresAfter", type: "uint256" }
  ]
}

Example Typed Data for WithdrawCollateral

{
  "types": {
    "EIP712Domain": [
      { "name": "name", "type": "string" },
      { "name": "version", "type": "string" },
      { "name": "chainId", "type": "uint256" },
      { "name": "verifyingContract", "type": "address" }
    ],
    "WithdrawCollateral": [
      { "name": "subAccountId", "type": "uint256" },
      { "name": "symbol", "type": "string" },
      { "name": "amount", "type": "string" },
      { "name": "destination", "type": "address" },
      { "name": "nonce", "type": "uint256" },
      { "name": "expiresAfter", "type": "uint256" }
    ]
  },
  "primaryType": "WithdrawCollateral",
  "domain": {
    "name": "Synthetix",
    "version": "1",
    "chainId": 1,
    "verifyingContract": "0x0000000000000000000000000000000000000000"
  },
  "message": {
    "subAccountId": "1867542890123456789",
    "symbol": "USDT",
    "amount": "1000.0",
    "destination": "0x742d35Cc6634C0532925a3b8D371d1c62a39b6e2",
    "nonce": 1704067200000,
    "expiresAfter": 1704067300
  }
}

Important Notes:

  • The amount field is a string type and should match the decimal representation from the request (e.g., "1000.0")
  • The expiresAfter field should match the request value, or be set to 0 when not provided (representing no expiration)
  • The nonce field is included in the EIP-712 message and matches the top-level request field
  • Withdrawals must be signed by the subaccount owner or a wallet-level manager; delegated signers cannot initiate withdrawals
  • For testnet, use chainId: 11155111 (Ethereum Sepolia). See Environments for complete configuration details

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, getFeeRate, getSnaxpotEpochTickets) do not require a nonce. Only the signature and optional expiresAfter parameters are needed. :::

Error Handling

Common error scenarios:

Error CodeDescriptionRetryable
UNAUTHORIZEDEIP-712 signature validation failedNo
VALIDATION_ERRORRequest validation failedNo
MISSING_REQUIRED_FIELDRequired field is missingNo
INVALID_FORMATField format is invalidNo
INVALID_VALUEInvalid parameter valueNo
RATE_LIMIT_EXCEEDEDToo many requests in time windowYes
INSUFFICIENT_MARGINNot enough margin for tradeNo
ORDER_NOT_FOUNDOrder does not existNo
OPERATION_TIMEOUTOperation timed outYes
ErrorDescription
collateral not found: {asset}The requested collateral is not present in the subaccount. This check occurs before any balance or margin evaluation.
Insufficient withdrawable balanceAccount lacks required funds for the specified asset
Margin requirement violationWithdrawal would violate margin rules
Invalid asset symbolAsset type not supported as collateral
Account health check failedWithdrawal would make account unhealthy
Delegate signature not allowedMust be signed by account owner or manager
Managers may only withdraw to the owner's wallet address (HTTP 403, code forbidden)Manager destination does not match the subaccount owner's wallet address
Minimum withdrawal amountAmount below minimum threshold
withdrawal quantity for {asset} does not conform to quantity tick size (allowed precision: {n} decimal places)amount has more decimal places than the asset's QuantityPrecision; round client-side using POST /v1/info (getAssets)
withdrawal amount must be positive for {asset}amount is zero or rounds to zero
withdrawals are not supported for {asset}Asset does not have a configured withdrawal fee and cannot be withdrawn

:::note Error Precedence The missing-collateral check (collateral not found: {asset}) is evaluated before the withdrawable-amount and margin checks. If a request specifies a collateral symbol that is not present on the account, this error is returned immediately without computing the withdrawable balance. :::

Related