# Delayed withdrawals

> Markdown export of the Gearbox Protocol documentation page for agents and retrieval systems.

Canonical page: https://docs.gearbox.finance/developers/delayed-withdrawals
Source file: content/developers/delayed-withdrawals.mdx
Section router: https://docs.gearbox.finance/developers/llms.txt
Section full export: https://docs.gearbox.finance/developers/llms-full.txt

After initiating a delayed withdrawal or leverage decrease, monitor settlement
and complete the operation once the proceeds are claimable. For route selection
and the request transaction, see [Withdraw](https://docs.gearbox.finance/developers/manage-position#withdraw)
or [Adjust leverage](https://docs.gearbox.finance/developers/manage-position#adjust-leverage).

Use the connected `sdk` and the leveraged `position` selected in
[Manage](https://docs.gearbox.finance/developers/manage-position#find-your-leveraged-positions).

## Monitor maturity

```typescript
const withdrawals = await sdk.positions.getCurrentWithdrawals({
  chainId: position.chainId,
  creditAccount: position.creditAccount,
  creditManager: position.creditManager,
});
```

| Field | Type | Meaning |
| --- | --- | --- |
| `data.pending` | `PositionPendingWithdrawal[]` | Requests still waiting for settlement |
| `data.pending[].claimableAt` | `Timestamp` | Expected claimable time, in Unix seconds; reread status before claiming |
| `data.pending[].expectedOutputs` | `WithdrawalOutputAmount[]` | Estimated settlement outputs |
| `data.claimable` | `PositionClaimableWithdrawal[]` | Matured withdrawals available to claim now |
| `data.claimable[].outputs` | `WithdrawalOutputAmount[]` | Outputs of the claim; `isDelayed: true` means that output still needs a later claim |
| `data.claimable[].withdrawalPhantomToken` | `TokenAmount` | Withdrawal representation and amount burned by the claim |
| `data.claimable[].claimCall` | `TxCall` | Encoded claim call used by the SDK during finalization |
| `meta.chains` | Per-chain metadata | Source, block, timestamp, and read status |

Both pending and claimable entries include `sourceToken`, the asset submitted
for redemption. They may also include `redeemer`, the request's contract, and
`intent`, the recorded operation to complete after settlement.

Reread this method to follow progress. Check response metadata before treating
empty arrays as a completed withdrawal. Use a fresh `data.claimable` entry,
rather than assuming a request has matured because its timestamp has passed.

While settlement is pending, the request has not repaid the debt. Interest
continues to accrue, so keep [monitoring the leveraged position's HF](https://docs.gearbox.finance/developers/monitor-position).

## Claim and complete the operation

`finalize` prepares the claim together with the remaining steps, such as
repaying debt and transferring the requested withdrawal to the wallet.

```typescript
const claimableIndex = 0; // Select the matured request to complete
const claimable = withdrawals.data.claimable[claimableIndex];
const sim = await sdk.opportunities.prepare.finalize(position, {
  claimable,
  slippage,
});
if (!sim.ok) throw sim.error;
```

| Field | Type | Meaning |
| --- | --- | --- |
| `claimable` | `PositionClaimableWithdrawal` | Fresh matured withdrawal selected above |
| `slippage` **Optional** | `number` | Swap slippage in basis points; defaults to 0 |
| `quotaReserve` **Optional** | `number` | Extra quota buffer in basis points; defaults to 0 |
| `intent` **Optional** | `ResumableIntent` | Operation to resume; defaults to the intent recorded in the withdrawal |

Continue with `position`, `sim`, and `owner` in
[Build, preview, and check](https://docs.gearbox.finance/developers/build-preview-check#update-a-leveraged-position).
Refresh the leveraged position and its withdrawals after confirmation.

## When an explicit intent is needed

An intent records what should happen after the claim: for example, repay debt
to decrease leverage, or repay debt and withdraw tokens to a recipient.
The SDK normally reads it from the withdrawal automatically.

Older withdrawal compressors do not report it. For those requests, pass
`intent` from the saved initiation result's
`delayed.record` into `finalize`. Keep that record associated with the confirmed
request so it can be used after restarting the script.

## Redeemers and liquidation

Supported redemption gateways use redeemer contracts to hold a request and
receive settlement proceeds. Their mechanics are described in
[What a redeemer is](https://docs.gearbox.finance/developers/delayed-redemptions#what-a-redeemer-is) and
[Protocol-specific redeemers](https://docs.gearbox.finance/developers/delayed-redemptions#protocol-specific-redeemers).
If liquidation transfers the redeemer to a liquidator, follow the
[liquidator claim flow](https://docs.gearbox.finance/developers/delayed-redemptions#list-current-withdrawals).

## Source

- [SDK withdrawal structures](https://github.com/Gearbox-protocol/sdk/blob/076de9c284c536c76eb3f93bc8284759acea539b/src/model/withdrawals.ts)
- [Preparation and finalization contracts](https://github.com/Gearbox-protocol/sdk/blob/076de9c284c536c76eb3f93bc8284759acea539b/src/sdk/prepare/types.ts)
