Brokex Docs
Docs/USER GUIDE/Understanding the Withdrawal Queue

Understanding the Withdrawal Queue

How strict FIFO ordering and partial fills protect LPs.

Strict FIFO Withdrawal Queue (BrokexVault.processWithdrawals)MAX_FIFO_BATCH = 50 · Ring-Fenced Reserves
Head #0 · LP Aidle ≥ assetsOwed100% Settled → BurnedqueueHead++Head #1 · LP Bidle < assetsOwedPartial Fill → Loop BreakssharesRemaining decrementedQueued #2 · LP CWaits strictly behind #1Instant withdraw() revertsQueueNotEmpty()Blacklist FallbackIf USDC transfer() failsclaimableUsdc[owner] += amtclaimWithdrawal() pull
  1. Strict Priority: queueHead is always settled before any later request.
  2. Ring-Fenced Liquidity: Queued withdrawal reserves (queuedWithdrawalAssets()) cannot be borrowed by new LONG positions.
  3. Partial Fills: If idle < assetsOwed at queueHead, the head receives a partial payout and the loop stops until more USDC is repaid.
  4. Blacklist Fallback: If a direct USDC transfer fails, funds are credited to claimableUsdc[owner] for manual claimWithdrawal().