DocumentationOpen App
On this pageMonitor maturity

Delayed withdrawals

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 or Adjust leverage.

Use the connected sdk and the leveraged position selected in Manage.

Monitor maturity

TypeScript
const withdrawals = await sdk.positions.getCurrentWithdrawals({ chainId: position.chainId, creditAccount: position.creditAccount, creditManager: position.creditManager, });
FieldTypeMeaning
data.pendingPositionPendingWithdrawal[]Requests still waiting for settlement
data.pending[].claimableAtTimestampExpected claimable time, in Unix seconds; reread status before claiming
data.pending[].expectedOutputsWithdrawalOutputAmount[]Estimated settlement outputs
data.claimablePositionClaimableWithdrawal[]Matured withdrawals available to claim now
data.claimable[].outputsWithdrawalOutputAmount[]Outputs of the claim; isDelayed: true means that output still needs a later claim
data.claimable[].withdrawalPhantomTokenTokenAmountWithdrawal representation and amount burned by the claim
data.claimable[].claimCallTxCallEncoded claim call used by the SDK during finalization
meta.chainsPer-chain metadataSource, 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.

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;
FieldTypeMeaning
claimablePositionClaimableWithdrawalFresh matured withdrawal selected above
slippage OptionalnumberSwap slippage in basis points; defaults to 0
quotaReserve OptionalnumberExtra quota buffer in basis points; defaults to 0
intent OptionalResumableIntentOperation to resume; defaults to the intent recorded in the withdrawal

Continue with position, sim, and owner in Build, preview, and check. 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 and Protocol-specific redeemers. If liquidation transfers the redeemer to a liquidator, follow the liquidator claim flow.

Source