GLAMIDL Reference

MarginFi Integration Staging

Integration adapter for MarginFi. Lets a GLAM vault initialize MarginFi accounts, deposit or withdraw collateral, borrow or repay liquidity, close accounts, and use Kamino-backed collateral under GLAM authorization. This staging deployment exposes additional or pre-release functionality for review.

Accounts owned or controlled

AccountOwner / authorityPurpose
Integration authority PDAMarginFi Integration StagingProgram-derived authority used for integration-level signing during MarginFi CPI calls.
MarginFi accountsMarginFiVault-controlled lending accounts that can be initialized, funded, borrowed against, repaid, closed, and priced through GLAM.

Protocols

MarginFi Integration Staging groups its instructions into the following protocols. Each protocol corresponds to a delegate-permission set on the GLAM state's integration ACL.

ProtocolDescriptionInstructions
MarginFiInitialize and close vault-owned MarginFi accounts, and deposit, withdraw, borrow, or repay liquidity.7
Kamino collateralMove Kamino-backed collateral into and out of a MarginFi account under GLAM policy checks.2

Instructions

9 total
InstructionDescription
kamino_depositDeposits Kamino-backed collateral into a MarginFi account.
kamino_withdrawWithdraws Kamino-backed collateral from a MarginFi account.
lending_account_borrowBorrows liquidity from MarginFi into the GLAM vault.
lending_account_depositDeposits liquidity from the GLAM vault into a MarginFi account.
lending_account_repayRepays borrowed liquidity from the GLAM vault to a MarginFi account.
lending_account_withdrawWithdraws liquidity from a MarginFi account to the GLAM vault.
marginfi_account_closeCloses an empty MarginFi account PDA owned by the GLAM vault.
marginfi_account_initialize_pdaInitializes a MarginFi account PDA owned by the GLAM vault.
set_marginfi_policySets the MarginFi policy for group, bank, and borrow-token allowlists.