withdraw_strategy
Withdraw principal from a direct lender strategy.
Required conditions
- The vault integration ACL must enable this integration before the instruction is accepted; that enablement is defined on the GLAM state account.
- If the signer is not the owner, the delegate ACL on the GLAM state must contain the exact protocol permission required by this instruction; registering a delegate alone is insufficient.
- Instruction-specific destination accounts must satisfy the external protocol's own account model; GLAM validates the accounts it needs for authorization and policy enforcement, then passes the remaining protocol accounts through CPI.
- The instruction metadata names
WithdrawStrategyas the delegate permission for this instruction. strategymust be tracked in the vault's registered-position registry.
Accounts
Uses the standard Big Seven account pattern, plus the instruction-specific accounts below.
| Account | Role | Description |
|---|---|---|
| bs_auth | signer | Fixed program or sysvar account. |
| strategy | writable | External strategy account. |
| market_information | read-only | Loopscale market information account for the strategy, collateral, or principal asset. |
| principal_mint | read-only | Token mint account. |
| lender_ta | writable | Lender token account used by Loopscale strategy deposit and withdrawal flows. |
| strategy_ta | writable | External strategy account. |
| associated_token_program | read-only | Standard Solana program account. |
| token_program | read-only | Token program (SPL Token or Token-2022) used by the strategy's principal mint during withdraw. |
| event_authority | read-only | Anchor event authority PDA used when the invoked program emits events. |
Arguments
| Argument | Type | Notes |
|---|---|---|
| amount | u64 | Principal amount to withdraw from the Loopscale strategy. |
| withdraw_all | bool | If true, withdraw the full available strategy balance instead of an exact amount. |
Policy & permissions
- Enable the Loopscale integration program on the vault integration ACL before Loopscale position actions.
- Delegate permission:
WithdrawStrategy.
Cross-instruction constraints
- The Loopscale strategy must be tracked in the vault's registered positions when required by policy.