Skip to Content
Scalar
Trading APIs

Submit a withdrawal

Verifies the user's EIP-712 `WithdrawBalance(address signer,uint256 amount,uint128 nonce,uint256 fee)` signature against the configured ScalarProtocol domain before forwarding. The domain uses name `ScalarProtocol`, version `1`, the configured chain ID, and configured protocol address. Rejections include `insufficient_balance` and `duplicate_request`. In-memory duplicate tracking does not provide durable replay protection across service restarts.

POST
/withdrawals

Verifies the user's EIP-712 WithdrawBalance(address signer,uint256 amount,uint128 nonce,uint256 fee) signature against the configured ScalarProtocol domain before forwarding. The domain uses name ScalarProtocol, version 1, the configured chain ID, and configured protocol address. Rejections include insufficient_balance and duplicate_request. In-memory duplicate tracking does not provide durable replay protection across service restarts.

Request Body

application/json
  1. body
amount*string

Withdrawal amount encoded as a base-10 string and required to be greater than zero

fee*string

Withdrawal fee encoded as a base-10 string and required to be less than amount

nonce*string

Withdrawal nonce encoded as a base-10 uint128 string

signature*string

EIP-712 signature as 65-byte r,s,v (v 27/28) or 64-byte EIP-2098 hex

user*string

User address in hex format (0x prefix optional)

Response Body

Withdrawal accepted immediately; balance updated

application/json
  1. response

The venue accepted a withdrawal. Rejections come back as an error envelope with insufficient_balance or duplicate_request, so there is exactly one status vocabulary rather than a status string beside an HTTP code.

balance*string

Post-validation balance, micro-dollars (base-10 string)

nonce*string

Accepted withdrawal nonce encoded as a base-10 string

user*string

User address as 0x-prefixed lowercase hex

Example Request
curl -X POST 'https://testnet-api.scalar.market/withdrawals' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": "string",
  "fee": "string",
  "nonce": "string",
  "signature": "string",
  "user": "string"
}'
Example Response
{
  "balance": "string",
  "nonce": "string",
  "user": "string"
}