Skip to main content
POST
Initiate withdrawal

Authorizations

X-Monaco-Signature
string
header
required

Ed25519 session-key request signing. Every authenticated request carries three headers: X-Monaco-PublicKey (64-char lowercase-hex session public key), X-Monaco-Timestamp (Unix milliseconds, within 30s of server time), and X-Monaco-Signature (hex ed25519 signature). The signature is over METHOD\npath?query\ntimestamp_ms\nSHA256_hex(body), where the body hash is the SHA-256 of the empty byte string when there is no body. Obtain the session keypair from POST /api/v1/auth/challenge followed by POST /api/v1/auth/verify.

Body

application/json
assetId
string<uuid> | null

UUID of the asset to withdraw

Example:

"123e4567-e89b-12d3-a456-426614174000"

amount
string | null

Raw token amount in the smallest unit (e.g. wei) as a stringified positive integer

Example:

"1000000000000000000"

destination
string | null

On-chain address that will receive the withdrawal (EVM, 42 chars including 0x)

Example:

"0x742d35cc6634c0532925a3b8d4060f31e2c3d8b5"

source
string | null

Source ledger to withdraw from: "spot" (default) debits spot balance; "margin" directly debits withdrawable collateral from the parent margin account

Example:

"spot"

Response

OK

withdrawalIndex
string | null

Allocated withdrawal index — matches executeWithdrawal.index on-chain

Example:

"42"

vaultAddress
string | null

0x-prefixed lowercase address of the vault contract the calldata is submitted to

Example:

"0x5fbdb2315678afecb367f032d93f642f64180aa3"

calldata
string | null

0x-prefixed ABI-encoded executeWithdrawal(...) calldata; submit as tx.data to the vault. Empty on InitiateWithdrawal (the merkle proof is not available until the withdrawal root is confirmed on-chain) — fetch it from GetWithdrawal once ready