Overview
Schedule a USDC withdrawal request. This is step 1 of the two-phase withdrawal process.
Scheduling requires only a signature (no gas). The withdrawal will be processed and become claimable after system batching.
To avoid ambiguity, we denote the smallest possible multiple of USDC (0.000001 USDC) as one uusdc,
which stands for µUSDC (micro-USDC).
Withdrawal Flow
Bison uses a two-phase withdrawal process:
- Schedule (this endpoint): User signs a message to request a withdrawal for a specific amount
- Claim (
/get-withdraw-authorization + on-chain tx): User gets authorization and executes the withdrawal on-chain
Request Body
Chain to withdraw on. One of base or bsc.
User’s Ethereum wallet address.
Amount to withdraw in µUSDC. Must be positive and not exceed deposited balance.
EIP-712 signature from the user authorizing the withdrawal request.
Unix timestamp when the signature expires. Should be set to ~10 minutes in the future.
Response
Unique identifier for the scheduled withdrawal.
Amount scheduled for withdrawal in µUSDC.
Initial withdrawal status. One of pending, fill-locked, unclaimed, or claimed.
ISO 8601 timestamp when the withdrawal was scheduled.
Withdrawal Status Flow
Withdrawals progress through these statuses:
- pending: Scheduled, waiting for system processing
- fill-locked: Being processed by the system
- unclaimed: Ready to claim on-chain
- claimed: Successfully withdrawn
Error Responses
400 - Insufficient Balance
Returned when the withdrawal amount exceeds available balance.{
"error": "Insufficient balance for withdrawal"
}
Returned when the signature is invalid or expired.{
"error": "Invalid signature"
}
Returned when scheduling fails.{
"error": "Failed to schedule withdrawal"
}
EIP-712 Signature
The signature must be generated using EIP-712 typed data with the following structure:
const domain = {
name: 'BisonScheduleWithdraw',
version: '1',
chainId: 8453, // Base mainnet
};
const types = {
ScheduleWithdraw: [
{ name: 'userAddress', type: 'address' },
{ name: 'amountUusdc', type: 'uint256' },
{ name: 'expiry', type: 'uint256' },
],
};
const message = {
userAddress: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
amountUusdc: BigInt(50_000_000), // 50 USDC
expiry: BigInt(Math.floor(Date.now() / 1000) + 600), // 10 minutes
};
Example Request
{
"chain": "base",
"userAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"amountUusdc": 50000000,
"signature": "0x1234567890abcdef...",
"expiry": 1699565430
}
Example Response
{
"withdrawId": "550e8400-e29b-41d4-a716-446655440000",
"amountUusdc": 50000000,
"status": "pending",
"scheduledAt": "2024-11-09T15:30:00.000Z"
}
Important Notes
- No gas is required to schedule a withdrawal
- Withdrawal amount is deducted from deposited balance immediately
- Multiple withdrawals can be scheduled and will be batched when claiming
- Signature expires after the specified
expiry timestamp
- Use
/pending-withdraws/{userAddress} to check withdrawal status
Available options:
base,
bsc
Withdraw scheduled successfully
Available options:
pending,
fill-locked,
unclaimed,
claimed