borrow_principal
Borrow principal against a locked loan.
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.
- Borrowing must satisfy both the vault-level borrowable asset list and the integration-specific borrow allowlist where one is configured.
- The instruction metadata names
BorrowPrincipalas the delegate permission for this instruction. principal_mintmust be present in the Loopscale borrow allowlist.market_informationmust be present in the Loopscale markets allowlist.
Accounts
| Account | Role | Description |
|---|---|---|
| glam_state | writable | GLAM state account that stores vault configuration, integration ACLs, delegate permissions, policies, assets, mint linkage, and pricing records. |
| glam_vault | writable | Vault PDA associated with the GLAM state and used as the vault authority. |
| glam_signer | signer, writable | Calling authority or fee payer. |
| integration_authority | read-only | Program-derived authority used by the integration for downstream invocation. |
| cpi_program | read-only | Downstream program invoked by this instruction. |
| glam_protocol_program | read-only | GLAM Protocol program account used for authorization or CPI. |
| system_program | read-only | Solana System Program. |
| bs_auth | signer | bs auth account read by Loopscale Integration Staging's borrow principal instruction. |
| loan | writable | Loopscale loan account. |
| strategy | writable | Loopscale strategy account. |
| market_information | writable | Loopscale market information account for the strategy, collateral, or principal asset. |
| principal_mint | read-only | Token mint account used or validated by this instruction. |
| borrower_ta | writable | Token account read or written by this instruction. |
| strategy_ta | writable | Token account read or written by this instruction. |
| associated_token_program | read-only | Associated Token Account program. |
| token_program | read-only | Token program account. |
| event_authority | read-only | Event authority or downstream event account. |
Arguments
| Argument | Type | Notes |
|---|---|---|
| params | BorrowPrincipalParams |
Policy & permissions
- Enable the Loopscale integration program on the vault integration ACL before Loopscale position actions.
- Delegate permission:
BorrowPrincipal. - Borrowing must satisfy the vault-level borrowable asset list and any integration-specific borrow allowlist.
TypeScript SDK usage
const borrowPrincipalIx =
await glamClient.loopscale.txBuilder.borrowPrincipalIx(
{ amount, assetIndexGuidance, duration, expectedLoanValues, skipSolUnwrap },
{ loan, strategy, marketInformation, principalMint, remainingAccounts },
);Cross-instruction constraints
- The Loopscale loan must exist; locking and unlocking determine when principal and collateral movements are valid.