withdraw_queued_liquidity
Kamino Lending (KLend)
What this page showsOne instruction (an action a wallet lists) of Kamino Lending (KLend): whether the code that runs it is the code an audit reviewed, why, and the recorded transactions that called it.
Verdict
Changed
The reviewed commit and the live source are both established, and the handler file or a traced related file changed between them.
Checked against the snapshot at slot 471,652,463
Instruction decoded
Established
The instruction bytes match one entry in a pinned IDL or schema, with no collision.
Live code rebuilt by POA
Established
POA rebuilt a source commit and its hash equals the on-chain executable.
Report names the handler file
Established
A published audit report's scope covers the file that implements this instruction.
Reviewed commit printed
Established
That report prints the scope and the exact commit it reviewed.
Reviewed code is the live code
Known difference
The reviewed commit and the rebuilt live commit hold the same program code.
Every link must hold before POA says Matched. A missing link is not a failure, and never an approval.
Reasons
- Program snapshot at slot 471652463: executable, RPC agree, hash 1a71bd2229fe….
- Decoded by anchor-sighash-derived 4295bbc94abfae78.
- Handler programs/klend/src/handlers/handler_withdraw_queued_liquidity.rs#L24 (handler_withdraw_queued_liquidity::process).
- Only partly reviewed per ackee-2025-fuzz (Fuzz testing only; the report says manual code review was not performed (p.11)); these reports give neither MATCHED nor CHANGED for this instruction.
- Handler file is under the printed scope of certora-2025-02-fv, offside-1.13.0-borrow-orders, offside-1.14.0-withdraw-queue.
- Live source 77e81854 established by POA's independent build.
- Live commit 77e81854 is not the reviewed commit and no recorded diff shows the crate unchanged (certora-2025-02-fv (5af6cfc: handler files changed, f3b2ce1: handler files changed); offside-1.13.0-borrow-orders (17 commits without a usable recorded diff); offside-1.14.0-withdraw-queue (10 commits without a usable recorded diff)).
- CHANGED: between certora-2025-02-fv's reviewed commit 5af6cfc and live 77e81854 the handler's traced files changed: programs/klend/src/handlers/handler_withdraw_queued_liquidity.rs (A +404 -0), programs/klend/src/lending_market/kvault_ixs.rs (A +80 -0), programs/klend/src/lending_market/lending_checks.rs (M +576 -125), programs/klend/src/lending_market/lending_operations.rs (M +2208 -822), programs/klend/src/state/lending_market.rs (M +402 -28), programs/klend/src/state/reserve.rs (M +1474 -286), programs/klend/src/state/withdraw_ticket.rs (A +177 -0), programs/klend/src/utils/accounts.rs (M +213 -0), programs/klend/src/utils/constraints.rs (M +162 -59), programs/klend/src/utils/spltoken.rs (M +61 -0), programs/klend/src/utils/token_transfer.rs (M +94 -13).
What would be needed for a stronger verdict
- A source diff from the reviewed commit to the live commit showing no change under the program crate.
Checks
- Decoded
- Yes
- Handler located
- Yes
- Handler in report-named files
- Yes
- Review scope established
- Yes
- Reviewed commit known
- Yes
- Live source rebuilt by POA
- Yes
- Live source equals reviewed
- No
- Handler changed since review
- Yes
- Program crate changed since review
- Yes
- Program immutable
- No
- Evidence fresh
- Yes
Discriminator and decoding
- Discriminator
- 4295bbc94abfae78
- Method
- Derived Anchor sighash
- IDL SHA-256
- 838837c76e4454563f206461411259c6573daddb1e269dee8cc94347ccfdc367
- Collisions
- None
Arguments
No arguments.
Accounts
Signer and writable flags from the interface definition.
| Account | Flags | Fixed address | Notes |
|---|---|---|---|
| payer | SignerWritable | The executor of the permissionless tx (not necessarily the ticket owner). | |
| lendingMarket | Read-only | The lending market. | |
| lendingMarketAuthority | Read-only | The market's authority, needed for burning the collateral (from [Self::owner_queued_collateral_vault]) and transferring the liquidity (from [Self::reserve_liquidity_supply]). | |
| reserve | Writable | The reserve. | |
| reserveLiquidityMint | Read-only | The liquidity mint, needed to invoke the transfer. | |
| reserveCollateralMint | Writable | The collateral mint, needed to burn (`mut`!) the queued collateral. | |
| reserveLiquiditySupply | Writable | The liquidity supply vault (to withdraw the liquidity from). | |
| ownerQueuedCollateralVault | Writable | The per-owner "this reserve's queued collateral" vault (from which the collateral will be burnt). | |
| userDestinationLiquidity | Writable | The token account to which the liquidity should be transferred (the one recorded in the ticket). | |
| collateralTokenProgram | Read-only | The program of [Self::reserve_collateral_mint], needed for transfer. | |
| liquidityTokenProgram | Read-only | The program of [Self::reserve_liquidity_mint], needed for transfer. | |
| withdrawTicket | Writable | The ticket's data itself. Note: in case of complete withdrawal, this account will be closed. In case of partial withdrawal, its [WithdrawTicket::queued_collateral_amount] will simply be reduced, and the ticket will maintain its position in the queue. | |
| withdrawTicketOwner | Writable | The owner of the [Self::withdraw_ticket]; needed only to return the rent of the [WithdrawTicket] account (if it is getting fully-consumed and closed here). | |
| associatedTokenProgram | Read-only | The ATA program - needed for potential destination ATA creation. | |
| systemProgram | Read-only | The System program - needed for potential destination ATA creation. | |
| progressCallbackProgram (optional) | Read-only | The progress callback program (if configured by the withdraw ticket). | |
| progressCallbackCustomAccount0 (optional) | Read-only | The first one out of maximum 2 custom accounts that may be required if the withdraw ticket defines a callback. Please note that the constraints defined here do not mention `mut`, but a specific [WithdrawTicket::progress_callback_type] may require it. | |
| progressCallbackCustomAccount1 (optional) | Read-only | The second possibly-required account (see the `progress_callback_custom_account_0` above). | |
| instructionSysvarAccount | Read-only |
Handler source
- Function
- handler_withdraw_queued_liquidity::process
- File
- programs/klend/src/handlers/handler_withdraw_queued_liquidity.rs · lines 24–210
- At commit
- 77e81854909ab7ffea3a2e898b2554d96e07daac
- Mapping
- Anchor program module
Related files
- programs/klend/src/handlers/handler_withdraw_queued_liquidity.rs (opens in a new tab)
- programs/klend/src/lending_market/lending_operations.rs (opens in a new tab)
- programs/klend/src/lending_market/lending_checks.rs (opens in a new tab)
- programs/klend/src/lending_market/kvault_ixs.rs (opens in a new tab)
- programs/klend/src/utils/token_transfer.rs (opens in a new tab)
- programs/klend/src/utils/constraints.rs (opens in a new tab)
- programs/klend/src/state/reserve.rs (opens in a new tab)
- programs/klend/src/state/lending_market.rs (opens in a new tab)
- programs/klend/src/state/withdraw_ticket.rs (opens in a new tab)
- programs/klend/src/utils/spltoken.rs (opens in a new tab)
- programs/klend/src/utils/accounts.rs (opens in a new tab)
Audit relations
How each report relates to this instruction's handler file.
Changed files since review
Files changed between the reviewed commit and the live source, as recorded.
| File | Status | Added | Removed |
|---|---|---|---|
| programs/klend/src/handlers/handler_withdraw_queued_liquidity.rs | added | 404 | 0 |
| programs/klend/src/lending_market/kvault_ixs.rs | added | 80 | 0 |
| programs/klend/src/lending_market/lending_checks.rs | modified | 610 | 151 |
| programs/klend/src/lending_market/lending_operations.rs | modified | 2,424 | 892 |
| programs/klend/src/state/lending_market.rs | modified | 407 | 29 |
| programs/klend/src/state/reserve.rs | modified | 1,592 | 314 |
| programs/klend/src/state/withdraw_ticket.rs | added | 177 | 0 |
| programs/klend/src/utils/accounts.rs | added | 230 | 0 |
| programs/klend/src/utils/constraints.rs | modified | 162 | 59 |
| programs/klend/src/utils/spltoken.rs | modified | 61 | 0 |
| programs/klend/src/utils/token_transfer.rs | modified | 120 | 11 |
Call trees
The static tree comes from the handler source. The observed tree comes from a finalized transaction. They are separate evidence and are not merged.
- Instruction
- The instruction itself, with its own verdict.
- Static
- A source file read at the handler map's pinned commit.
- Observed
- A call seen in a finalized mainnet transaction.
- Inferred
- A call read from the handler source, not observed on chain.
Static, from source at 77e8185
- Signer
- InstructionChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- StaticChanged
- InferredUnknown
- InferredUnknown
- InferredUnknown
- InferredUnknown
No curated transaction calls this instruction.
Transactions
Each curated transaction that calls this instruction, with what is known about the code that ran.
No curated transaction calls this instruction.