# Integrate withdrawals Withdrawal requests, settlement, and claims are separate actions. Build your interface around the specific route and receipt state. The [lender liquidity explanation](../../product/credit-vaults/liquidity.md) covers user timing; this guide covers the integration decisions. ## 1. Select the request route | Situation | Request | Token handling | | ------------------------------------------------ | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | Direct requests open for the selected tranche | Vault `requestWithdraw(trancheAmount,tranche)` | Burns caller tranche tokens; no tranche-token allowance to the vault. Zero input means all caller shares. | | Running epoch with a configured withdrawal queue | Queue `requestWithdraw(trancheAmount)` | Transfers caller tranche tokens to the queue; approve that queue for the actual tranche amount. Zero does not mean all. | | Hard default awaiting recovery finalization | Read receipt and recovery state; simulate only supported actions | Do not infer a payable amount from a positive pre-finalization tranche price. | | Healthy closure or finalized default | Check the terminal request/claim path | Another ordinary epoch is not required for the supported terminal exit path. | Read the canonical tranche address, share balance, `allowAAWithdrawRequest` or `allowBBWithdrawRequest`, `isEpochRunning`, `defaulted`, strategy `defaultRecoveryFinalized`, and wallet eligibility. Share inputs use 18 decimals. `maxWithdrawable(caller,tranche)` estimates a normal full-balance request; simulate the selected request for its execution estimate. Management fees, rounding, APR-zero settlement, losses, and default recovery can affect the amount eventually received. See [valuation](../../product/credit-vaults/valuation.md), [fees](../../product/credit-vaults/fees.md), and the [contract reference](../reference/contracts.md). The vault selects instant mode automatically when supported and the configured APR-change condition is met. A user does not select instant mode by calling a different request method. New instant requests and instant claims use different gates; the word “instant” does not mean immediate cash. ## 2. Submit and persist the request Simulate from the actual caller. Send a new direct request only if the simulated call quotes a positive underlying amount, including for a terminal exit. A positive share amount can round to zero underlying and burn the shares without creating a receipt. An existing zero-payout receipt still uses its applicable claim method to clear the entry. After sending the selected transaction, wait for its receipt. Store the chain, vault, tranche, caller, route, queue if applicable, request epoch, transaction hash, and raw amounts. Confirm share burning or queue custody and the matching on-chain request record before showing the request as accepted. A positive direct request moves value out of active tranche NAV into strategy receipt accounting. A queued submission first transfers shares to the queue; the queue operator must later submit the aggregate vault request. Display these as different states. For a smart-contract integrator that aggregates users, reconcile internal user balances with the single caller's on-chain receipt and claim existing receipts before creating a later aggregate request where required. ## 3. Follow settlement and claim

Scroll sideways for detail, or use the full diagram link below.

Queued withdrawal calls and actors. Standard configured withdrawal queue. The queue owner or strategy manager processes the aggregate request and later collects its eligible vault claim. Only then does the lender claim from the queue. The vault forwards claim accounting to the strategy. The diagram uses the normal claim method; instant mode has separate conditional gates. A completed zero-value settlement is recorded by isEpochWithdrawZero(epoch) and can be cleared without payment. API CLAIMABLE labels are indexed observations; check state and simulate from the actual caller. Unprocessed cancellation, default and recovery rules remain in the guide. Queued withdrawal calls and actors. Standard configured withdrawal queue. The queue owner or strategy manager processes the aggregate request and later collects its eligible vault claim. Only then does the lender claim from the queue. The vault forwards claim accounting to the strategy. The diagram uses the normal claim method; instant mode has separate conditional gates. A completed zero-value settlement is recorded by isEpochWithdrawZero(epoch) and can be cleared without payment. API CLAIMABLE labels are indexed observations; check state and simulate from the actual caller. Unprocessed cancellation, default and recovery rules remain in the guide.
Standard configured withdrawal queue. The queue owner or strategy manager processes the aggregate request and later collects its eligible vault claim. Only then does the lender claim from the queue. The vault forwards claim accounting to the strategy. The diagram uses the normal claim method; instant mode has separate conditional gates. A completed zero-value settlement is recorded by isEpochWithdrawZero(epoch) and can be cleared without payment. API CLAIMABLE labels are indexed observations; check state and simulate from the actual caller. Unprocessed cancellation, default and recovery rules remain in the guide. Open full diagram and source scope.
| Route | Intervening steps | User claim | | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | | Direct normal | The relevant next epoch settles and funding/accounting conditions are met, or a terminal exit is available. An additional request can postpone a combined normal receipt's eligibility. | Vault `claimWithdrawRequest()` | | Direct instant | The instant gate opens and the request is funded, or the applicable finalized-recovery rules permit settlement. | Vault `claimInstantWithdrawRequest()` | | Queued withdrawal | Operator processes request, vault settles/funds it, then operator collects underlying into the queue. | Queue `claimWithdrawRequest(epoch)` | After healthy closure, an eligible normal terminal request can be claimed without waiting for another epoch. After finalized hard default, clear older receipts before creating a new positive-value terminal receipt. It uses the already recovered tranche price and is recorded in `postDefaultRequests(user)`. Claim that reserve-backed amount without applying the recovery multiplier again. Read the strategy receipt ledgers, APR-zero data and terminal requests when reconciling an exit. See the [detailed loss and recovery guide](../integrators/smart-contract.md#losses-and-default-recovery). A standard queue withdrawal targets the next strategy epoch. Once the strategy reaches that epoch, the queue owner or strategy manager must first collect any eligible prior aggregate claim that sets `pendingClaims()`, then process the current bucket while direct requests are enabled. If an unprocessed bucket is skipped, use `deleteWithdrawRequest(originalEpoch)` to recover the shares and resubmit when a route opens. For a queue claim, verify the caller's `userWithdrawalsEpochs(caller, epoch)`, then require `epochPendingClaims(epoch) == 0` and either a positive `epochWithdrawPrice(epoch)` or `isEpochWithdrawZero(epoch) == true`. Simulate from that caller. A zero-value settlement can be claimed to clear the entry without a payout. ## 4. Reconcile the outcome API request labels are indexed observations and can lag. Confirm claimability by simulation, and confirm completion with the mined transaction, cleared request state, and actual underlying received. Keep claims available beyond a single UI epoch label when the contract permits them. If a call fails, decode the revert using the verified ABI and refresh state before suggesting the next action. Use the [Web3 walkthrough](../integrators/web3.md#managing-requests) for transaction fragments and the [integration checklist](integration-checklist.md) before release.