Skip to main content
POST
/
get-withdraw-authorization
{
  "uuid": "<string>",
  "signature": "<string>",
  "expiresAt": 123,
  "maxWithdrawAmount": 123
}

Overview

Generate a signed authorization to withdraw USDC from the vault. The authorization is valid for 30 seconds and can only be used once.

Request Body

chain
string
required
Chain to execute the withdrawal on. Currently only base is supported.
userAddress
string
required
User’s Ethereum wallet address (checksummed or lowercase).

Response

uuid
string
Unique authorization identifier used to prevent replay attacks.
signature
string
EIP-712 signature for the withdrawal authorization that must be submitted to the vault contract.
expiresAt
number
Unix timestamp when the authorization expires (30 seconds from creation).
maxWithdrawAmount
number
Maximum amount the user can withdraw in µUSDC. This equals the user’s current deposited balance.

Error Responses

400 - No Balance
Returned when the user has no deposited balance to withdraw.
{
  "error": "No deposited balance to withdraw"
}
500 - Server Error
Returned when authorization generation fails.
{
  "error": "Withdraw authorization failed"
}

Example Request

{
  "chain": "base",
  "userAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
}

Example Response

{
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "signature": "0x1234567890abcdef...",
  "expiresAt": 1699564830,
  "maxWithdrawAmount": 1000000
}

Usage Flow

  1. Check Balance: Ensure user has deposited USDC balance
  2. Get Authorization: Call this endpoint to get withdrawal signature
  3. Execute Withdrawal: Call withdrawUSDC on the vault contract with the authorization:
    • uuid: Unique authorization ID
    • usdcAmount: Amount to withdraw (≤ maxWithdrawAmount)
    • expiry: Expiration timestamp
    • signature: EIP-712 signature

Important Notes

  • Authorization expires in 30 seconds
  • Each authorization can only be used once (replay protection)
  • User must have sufficient deposited balance
  • Withdraw amount in contract call must not exceed maxWithdrawAmount
  • After withdrawal, the user’s deposited balance is updated via EVM webhook

Body

application/json
chain
enum<string>
required

Chain to execute the action on; one of: base, bsc

Available options:
base,
bsc
Example:

"base"

userAddress
string
required

User wallet address

Example:

"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"

amountUusdc
number
required

Amount to withdraw in µUSDC (micro-USDC, 6 decimals)

Required range: x > 0
Example:

1000000

Response

Withdraw authorization generated successfully

uuid
string
required

Unique authorization ID

signature
string
required

EIP-712 signature for the authorization

expiresAt
number
required

Unix timestamp when authorization expires

maxWithdrawAmount
number
required

Maximum amount user can withdraw in µUSDC