MarginfiIdl
MarginfiIdl: { accounts: [{ name: "marginfiAccount"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "authority"; type: "publicKey" }, { name: "lendingAccount"; type: { defined: "LendingAccount" } }, { name: "padding"; type: { array: ["u64", 64] } }]; kind: "struct" } }, { name: "marginfiGroup"; type: { fields: [{ name: "admin"; type: "publicKey" }, { name: "padding0"; type: { array: ["u128", 32] } }, { name: "padding1"; type: { array: ["u128", 32] } }]; kind: "struct" } }, { name: "bank"; type: { fields: [{ name: "mint"; type: "publicKey" }, { name: "mintDecimals"; type: "u8" }, { name: "group"; type: "publicKey" }, { name: "ignore1"; type: { array: ["u8", 7] } }, { name: "assetShareValue"; type: { defined: "WrappedI80F48" } }, { name: "liabilityShareValue"; type: { defined: "WrappedI80F48" } }, { name: "liquidityVault"; type: "publicKey" }, { name: "liquidityVaultBump"; type: "u8" }, { name: "liquidityVaultAuthorityBump"; type: "u8" }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceVaultBump"; type: "u8" }, { name: "insuranceVaultAuthorityBump"; type: "u8" }, { name: "ignore2"; type: { array: ["u8", 4] } }, { name: "collectedInsuranceFeesOutstanding"; type: { defined: "WrappedI80F48" } }, { name: "feeVault"; type: "publicKey" }, { name: "feeVaultBump"; type: "u8" }, { name: "feeVaultAuthorityBump"; type: "u8" }, { name: "ignore3"; type: { array: ["u8", 6] } }, { name: "collectedGroupFeesOutstanding"; type: { defined: "WrappedI80F48" } }, { name: "totalLiabilityShares"; type: { defined: "WrappedI80F48" } }, { name: "totalAssetShares"; type: { defined: "WrappedI80F48" } }, { name: "lastUpdate"; type: "i64" }, { name: "config"; type: { defined: "BankConfig" } }, { name: "padding0"; type: { array: ["u128", 32] } }, { name: "padding1"; type: { array: ["u128", 32] } }]; kind: "struct" } }]; errors: [{ code: 6000; msg: "Math error"; name: "MathError" }, { code: 6001; msg: "Invalid bank index"; name: "BankNotFound" }, { code: 6002; msg: "Lending account balance not found"; name: "LendingAccountBalanceNotFound" }, { code: 6003; msg: "Bank deposit capacity exceeded"; name: "BankAssetCapacityExceeded" }, { code: 6004; msg: "Invalid transfer"; name: "InvalidTransfer" }, { code: 6005; msg: "Missing Pyth or Bank account"; name: "MissingPythOrBankAccount" }, { code: 6006; msg: "Missing Pyth account"; name: "MissingPythAccount" }, { code: 6007; msg: "Invalid Pyth account"; name: "InvalidOracleAccount" }, { code: 6008; msg: "Missing Bank account"; name: "MissingBankAccount" }, { code: 6009; msg: "Invalid Bank account"; name: "InvalidBankAccount" }, { code: 6010; msg: "Bad account health"; name: "BadAccountHealth" }, { code: 6011; msg: "Lending account balance slots are full"; name: "LendingAccountBalanceSlotsFull" }, { code: 6012; msg: "Bank already exists"; name: "BankAlreadyExists" }, { code: 6013; msg: "Illegal post liquidation state, account is either not unhealthy or liquidation was too big"; name: "IllegalLiquidation" }, { code: 6014; msg: "Account is not bankrupt"; name: "AccountNotBankrupt" }, { code: 6015; msg: "Account balance is not bad debt"; name: "BalanceNotBadDebt" }, { code: 6016; msg: "Invalid group config"; name: "InvalidConfig" }, { code: 6017; msg: "Stale oracle data"; name: "StaleOracle" }, { code: 6018; msg: "Bank paused"; name: "BankPaused" }, { code: 6019; msg: "Bank is ReduceOnly mode"; name: "BankReduceOnly" }, { code: 6020; msg: "Bank is missing"; name: "BankAccoutNotFound" }, { code: 6021; msg: "Operation is deposit-only"; name: "OperationDepositOnly" }, { code: 6022; msg: "Operation is withdraw-only"; name: "OperationWithdrawOnly" }, { code: 6023; msg: "Operation is borrow-only"; name: "OperationBorrowOnly" }, { code: 6024; msg: "Operation is repay-only"; name: "OperationRepayOnly" }, { code: 6025; msg: "No asset found"; name: "NoAssetFound" }, { code: 6026; msg: "No liability found"; name: "NoLiabilityFound" }, { code: 6027; msg: "Invalid oracle setup"; name: "InvalidOracleSetup" }, { code: 6028; msg: "Invalid bank utilization ratio"; name: "IllegalUtilizationRatio" }]; instructions: [{ accounts: [{ isMut: true; isSigner: true; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "marginfiGroupInitialize" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "config"; type: { defined: "GroupConfig" } }]; name: "marginfiGroupConfigure" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "bankMint" }, { isMut: true; isSigner: true; name: "bank" }, { isMut: false; isSigner: false; name: "liquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "liquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "feeVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "fee_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "feeVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "fee_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "bankConfig"; type: { defined: "BankConfig" } }]; name: "lendingPoolAddBank" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "bank" }]; args: [{ name: "bankConfigOpt"; type: { defined: "BankConfigOpt" } }]; name: "lendingPoolConfigureBank" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "liquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; docs: ["Handle bad debt of a bankrupt marginfi account for a given bank."]; name: "lendingPoolHandleBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: true; name: "feePayer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; docs: ["Initialize a marginfi account for a given group"]; name: "marginfiAccountInitialize" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "signerTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "lendingAccountDeposit" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "signerTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "repayAll"; type: { option: "bool" } }]; name: "lendingAccountRepay" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "destinationTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "withdrawAll"; type: { option: "bool" } }]; name: "lendingAccountWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "destinationTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "lendingAccountBorrow" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "assetBank" }, { isMut: true; isSigner: false; name: "liabBank" }, { isMut: true; isSigner: false; name: "liquidatorMarginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "liquidateeMarginfiAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "liab_bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "liab_bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankInsuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "liab_bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "assetAmount"; type: "u64" }]; docs: ["Liquidate a lending account balance of an unhealthy marginfi account"]; name: "lendingAccountLiquidate" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "bank" }]; args: []; name: "lendingPoolAccrueBankInterest" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: false; isSigner: false; name: "liquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "liquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "feeVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "fee_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "lendingPoolCollectBankFees" }]; name: "marginfi"; types: [{ name: "LendingAccount"; type: { fields: [{ name: "balances"; type: { array: [{ defined: "Balance" }, 16] } }, { name: "padding"; type: { array: ["u64", 8] } }]; kind: "struct" } }, { name: "Balance"; type: { fields: [{ name: "active"; type: "bool" }, { name: "bankPk"; type: "publicKey" }, { name: "ignore"; type: { array: ["u8", 7] } }, { name: "assetShares"; type: { defined: "WrappedI80F48" } }, { name: "liabilityShares"; type: { defined: "WrappedI80F48" } }, { name: "padding"; type: { array: ["u64", 4] } }]; kind: "struct" } }, { name: "GroupConfig"; type: { fields: [{ name: "admin"; type: { option: "publicKey" } }]; kind: "struct" } }, { name: "InterestRateConfig"; type: { fields: [{ name: "optimalUtilizationRate"; type: { defined: "WrappedI80F48" } }, { name: "plateauInterestRate"; type: { defined: "WrappedI80F48" } }, { name: "maxInterestRate"; type: { defined: "WrappedI80F48" } }, { name: "insuranceFeeFixedApr"; type: { defined: "WrappedI80F48" } }, { name: "insuranceIrFee"; type: { defined: "WrappedI80F48" } }, { name: "protocolFixedFeeApr"; type: { defined: "WrappedI80F48" } }, { name: "protocolIrFee"; type: { defined: "WrappedI80F48" } }, { name: "padding"; type: { array: ["u128", 8] } }]; kind: "struct" } }, { docs: ["TODO: Convert weights to (u64, u64) to avoid precision loss (maybe?)"]; name: "BankConfig"; type: { fields: [{ name: "assetWeightInit"; type: { defined: "WrappedI80F48" } }, { name: "assetWeightMaint"; type: { defined: "WrappedI80F48" } }, { name: "liabilityWeightInit"; type: { defined: "WrappedI80F48" } }, { name: "liabilityWeightMaint"; type: { defined: "WrappedI80F48" } }, { name: "maxCapacity"; type: "u64" }, { name: "interestRateConfig"; type: { defined: "InterestRateConfig" } }, { name: "operationalState"; type: { defined: "BankOperationalState" } }, { name: "oracleSetup"; type: { defined: "OracleSetup" } }, { name: "oracleKeys"; type: { array: ["publicKey", 5] } }, { name: "ignore"; type: { array: ["u8", 6] } }, { name: "padding"; type: { array: ["u128", 4] } }]; kind: "struct" } }, { name: "WrappedI80F48"; type: { fields: [{ name: "value"; type: "i128" }]; kind: "struct" } }, { name: "BankConfigOpt"; type: { fields: [{ name: "assetWeightInit"; type: { option: { defined: "WrappedI80F48" } } }, { name: "assetWeightMaint"; type: { option: { defined: "WrappedI80F48" } } }, { name: "liabilityWeightInit"; type: { option: { defined: "WrappedI80F48" } } }, { name: "liabilityWeightMaint"; type: { option: { defined: "WrappedI80F48" } } }, { name: "maxCapacity"; type: { option: "u64" } }, { name: "operationalState"; type: { option: { defined: "BankOperationalState" } } }, { name: "oracle"; type: { option: { defined: "OracleConfig" } } }, { name: "ignore"; type: { array: ["u8", 6] } }]; kind: "struct" } }, { name: "OracleConfig"; type: { fields: [{ name: "setup"; type: { defined: "OracleSetup" } }, { name: "keys"; type: { array: ["publicKey", 5] } }]; kind: "struct" } }, { name: "BalanceIncreaseType"; type: { kind: "enum"; variants: [{ name: "Any" }, { name: "RepayOnly" }, { name: "DepositOnly" }] } }, { name: "BalanceDecreaseType"; type: { kind: "enum"; variants: [{ name: "Any" }, { name: "WithdrawOnly" }, { name: "BorrowOnly" }] } }, { name: "WeightType"; type: { kind: "enum"; variants: [{ name: "Initial" }, { name: "Maintenance" }] } }, { name: "BalanceSide"; type: { kind: "enum"; variants: [{ name: "Assets" }, { name: "Liabilities" }] } }, { name: "RiskRequirementType"; type: { kind: "enum"; variants: [{ name: "Initial" }, { name: "Maintenance" }] } }, { name: "BankOperationalState"; type: { kind: "enum"; variants: [{ name: "Paused" }, { name: "Operational" }, { name: "ReduceOnly" }] } }, { name: "OracleSetup"; type: { kind: "enum"; variants: [{ name: "None" }, { name: "Pyth" }] } }, { name: "OracleKey"; type: { kind: "enum"; variants: [{ fields: ["publicKey"]; name: "Pyth" }] } }, { name: "BankVaultType"; type: { kind: "enum"; variants: [{ name: "Liquidity" }, { name: "Insurance" }, { name: "Fee" }] } }]; version: "0.1.0" }
Type declaration
accounts: [{ name: "marginfiAccount"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "authority"; type: "publicKey" }, { name: "lendingAccount"; type: { defined: "LendingAccount" } }, { name: "padding"; type: { array: ["u64", 64] } }]; kind: "struct" } }, { name: "marginfiGroup"; type: { fields: [{ name: "admin"; type: "publicKey" }, { name: "padding0"; type: { array: ["u128", 32] } }, { name: "padding1"; type: { array: ["u128", 32] } }]; kind: "struct" } }, { name: "bank"; type: { fields: [{ name: "mint"; type: "publicKey" }, { name: "mintDecimals"; type: "u8" }, { name: "group"; type: "publicKey" }, { name: "ignore1"; type: { array: ["u8", 7] } }, { name: "assetShareValue"; type: { defined: "WrappedI80F48" } }, { name: "liabilityShareValue"; type: { defined: "WrappedI80F48" } }, { name: "liquidityVault"; type: "publicKey" }, { name: "liquidityVaultBump"; type: "u8" }, { name: "liquidityVaultAuthorityBump"; type: "u8" }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceVaultBump"; type: "u8" }, { name: "insuranceVaultAuthorityBump"; type: "u8" }, { name: "ignore2"; type: { array: ["u8", 4] } }, { name: "collectedInsuranceFeesOutstanding"; type: { defined: "WrappedI80F48" } }, { name: "feeVault"; type: "publicKey" }, { name: "feeVaultBump"; type: "u8" }, { name: "feeVaultAuthorityBump"; type: "u8" }, { name: "ignore3"; type: { array: ["u8", 6] } }, { name: "collectedGroupFeesOutstanding"; type: { defined: "WrappedI80F48" } }, { name: "totalLiabilityShares"; type: { defined: "WrappedI80F48" } }, { name: "totalAssetShares"; type: { defined: "WrappedI80F48" } }, { name: "lastUpdate"; type: "i64" }, { name: "config"; type: { defined: "BankConfig" } }, { name: "padding0"; type: { array: ["u128", 32] } }, { name: "padding1"; type: { array: ["u128", 32] } }]; kind: "struct" } }]
errors: [{ code: 6000; msg: "Math error"; name: "MathError" }, { code: 6001; msg: "Invalid bank index"; name: "BankNotFound" }, { code: 6002; msg: "Lending account balance not found"; name: "LendingAccountBalanceNotFound" }, { code: 6003; msg: "Bank deposit capacity exceeded"; name: "BankAssetCapacityExceeded" }, { code: 6004; msg: "Invalid transfer"; name: "InvalidTransfer" }, { code: 6005; msg: "Missing Pyth or Bank account"; name: "MissingPythOrBankAccount" }, { code: 6006; msg: "Missing Pyth account"; name: "MissingPythAccount" }, { code: 6007; msg: "Invalid Pyth account"; name: "InvalidOracleAccount" }, { code: 6008; msg: "Missing Bank account"; name: "MissingBankAccount" }, { code: 6009; msg: "Invalid Bank account"; name: "InvalidBankAccount" }, { code: 6010; msg: "Bad account health"; name: "BadAccountHealth" }, { code: 6011; msg: "Lending account balance slots are full"; name: "LendingAccountBalanceSlotsFull" }, { code: 6012; msg: "Bank already exists"; name: "BankAlreadyExists" }, { code: 6013; msg: "Illegal post liquidation state, account is either not unhealthy or liquidation was too big"; name: "IllegalLiquidation" }, { code: 6014; msg: "Account is not bankrupt"; name: "AccountNotBankrupt" }, { code: 6015; msg: "Account balance is not bad debt"; name: "BalanceNotBadDebt" }, { code: 6016; msg: "Invalid group config"; name: "InvalidConfig" }, { code: 6017; msg: "Stale oracle data"; name: "StaleOracle" }, { code: 6018; msg: "Bank paused"; name: "BankPaused" }, { code: 6019; msg: "Bank is ReduceOnly mode"; name: "BankReduceOnly" }, { code: 6020; msg: "Bank is missing"; name: "BankAccoutNotFound" }, { code: 6021; msg: "Operation is deposit-only"; name: "OperationDepositOnly" }, { code: 6022; msg: "Operation is withdraw-only"; name: "OperationWithdrawOnly" }, { code: 6023; msg: "Operation is borrow-only"; name: "OperationBorrowOnly" }, { code: 6024; msg: "Operation is repay-only"; name: "OperationRepayOnly" }, { code: 6025; msg: "No asset found"; name: "NoAssetFound" }, { code: 6026; msg: "No liability found"; name: "NoLiabilityFound" }, { code: 6027; msg: "Invalid oracle setup"; name: "InvalidOracleSetup" }, { code: 6028; msg: "Invalid bank utilization ratio"; name: "IllegalUtilizationRatio" }]
instructions: [{ accounts: [{ isMut: true; isSigner: true; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "marginfiGroupInitialize" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "config"; type: { defined: "GroupConfig" } }]; name: "marginfiGroupConfigure" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "bankMint" }, { isMut: true; isSigner: true; name: "bank" }, { isMut: false; isSigner: false; name: "liquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "liquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "feeVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "fee_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "feeVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "fee_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "bankConfig"; type: { defined: "BankConfig" } }]; name: "lendingPoolAddBank" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "bank" }]; args: [{ name: "bankConfigOpt"; type: { defined: "BankConfigOpt" } }]; name: "lendingPoolConfigureBank" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "liquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; docs: ["Handle bad debt of a bankrupt marginfi account for a given bank."]; name: "lendingPoolHandleBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: true; name: "feePayer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; docs: ["Initialize a marginfi account for a given group"]; name: "marginfiAccountInitialize" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "signerTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "lendingAccountDeposit" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "signerTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "repayAll"; type: { option: "bool" } }]; name: "lendingAccountRepay" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "destinationTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "withdrawAll"; type: { option: "bool" } }]; name: "lendingAccountWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: true; isSigner: false; name: "destinationTokenAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "lendingAccountBorrow" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "assetBank" }, { isMut: true; isSigner: false; name: "liabBank" }, { isMut: true; isSigner: false; name: "liquidatorMarginfiAccount" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "liquidateeMarginfiAccount" }, { isMut: true; isSigner: false; name: "bankLiquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "liab_bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankLiquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "liab_bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "bankInsuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "liab_bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "assetAmount"; type: "u64" }]; docs: ["Liquidate a lending account balance of an unhealthy marginfi account"]; name: "lendingAccountLiquidate" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "bank" }]; args: []; name: "lendingPoolAccrueBankInterest" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "bank" }, { isMut: false; isSigner: false; name: "liquidityVaultAuthority"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault_auth" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "liquidityVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "liquidity_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "insurance_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "feeVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "fee_vault" }, { kind: "account"; path: "bank"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "lendingPoolCollectBankFees" }]
name: "marginfi"
types: [{ name: "LendingAccount"; type: { fields: [{ name: "balances"; type: { array: [{ defined: "Balance" }, 16] } }, { name: "padding"; type: { array: ["u64", 8] } }]; kind: "struct" } }, { name: "Balance"; type: { fields: [{ name: "active"; type: "bool" }, { name: "bankPk"; type: "publicKey" }, { name: "ignore"; type: { array: ["u8", 7] } }, { name: "assetShares"; type: { defined: "WrappedI80F48" } }, { name: "liabilityShares"; type: { defined: "WrappedI80F48" } }, { name: "padding"; type: { array: ["u64", 4] } }]; kind: "struct" } }, { name: "GroupConfig"; type: { fields: [{ name: "admin"; type: { option: "publicKey" } }]; kind: "struct" } }, { name: "InterestRateConfig"; type: { fields: [{ name: "optimalUtilizationRate"; type: { defined: "WrappedI80F48" } }, { name: "plateauInterestRate"; type: { defined: "WrappedI80F48" } }, { name: "maxInterestRate"; type: { defined: "WrappedI80F48" } }, { name: "insuranceFeeFixedApr"; type: { defined: "WrappedI80F48" } }, { name: "insuranceIrFee"; type: { defined: "WrappedI80F48" } }, { name: "protocolFixedFeeApr"; type: { defined: "WrappedI80F48" } }, { name: "protocolIrFee"; type: { defined: "WrappedI80F48" } }, { name: "padding"; type: { array: ["u128", 8] } }]; kind: "struct" } }, { docs: ["TODO: Convert weights to (u64, u64) to avoid precision loss (maybe?)"]; name: "BankConfig"; type: { fields: [{ name: "assetWeightInit"; type: { defined: "WrappedI80F48" } }, { name: "assetWeightMaint"; type: { defined: "WrappedI80F48" } }, { name: "liabilityWeightInit"; type: { defined: "WrappedI80F48" } }, { name: "liabilityWeightMaint"; type: { defined: "WrappedI80F48" } }, { name: "maxCapacity"; type: "u64" }, { name: "interestRateConfig"; type: { defined: "InterestRateConfig" } }, { name: "operationalState"; type: { defined: "BankOperationalState" } }, { name: "oracleSetup"; type: { defined: "OracleSetup" } }, { name: "oracleKeys"; type: { array: ["publicKey", 5] } }, { name: "ignore"; type: { array: ["u8", 6] } }, { name: "padding"; type: { array: ["u128", 4] } }]; kind: "struct" } }, { name: "WrappedI80F48"; type: { fields: [{ name: "value"; type: "i128" }]; kind: "struct" } }, { name: "BankConfigOpt"; type: { fields: [{ name: "assetWeightInit"; type: { option: { defined: "WrappedI80F48" } } }, { name: "assetWeightMaint"; type: { option: { defined: "WrappedI80F48" } } }, { name: "liabilityWeightInit"; type: { option: { defined: "WrappedI80F48" } } }, { name: "liabilityWeightMaint"; type: { option: { defined: "WrappedI80F48" } } }, { name: "maxCapacity"; type: { option: "u64" } }, { name: "operationalState"; type: { option: { defined: "BankOperationalState" } } }, { name: "oracle"; type: { option: { defined: "OracleConfig" } } }, { name: "ignore"; type: { array: ["u8", 6] } }]; kind: "struct" } }, { name: "OracleConfig"; type: { fields: [{ name: "setup"; type: { defined: "OracleSetup" } }, { name: "keys"; type: { array: ["publicKey", 5] } }]; kind: "struct" } }, { name: "BalanceIncreaseType"; type: { kind: "enum"; variants: [{ name: "Any" }, { name: "RepayOnly" }, { name: "DepositOnly" }] } }, { name: "BalanceDecreaseType"; type: { kind: "enum"; variants: [{ name: "Any" }, { name: "WithdrawOnly" }, { name: "BorrowOnly" }] } }, { name: "WeightType"; type: { kind: "enum"; variants: [{ name: "Initial" }, { name: "Maintenance" }] } }, { name: "BalanceSide"; type: { kind: "enum"; variants: [{ name: "Assets" }, { name: "Liabilities" }] } }, { name: "RiskRequirementType"; type: { kind: "enum"; variants: [{ name: "Initial" }, { name: "Maintenance" }] } }, { name: "BankOperationalState"; type: { kind: "enum"; variants: [{ name: "Paused" }, { name: "Operational" }, { name: "ReduceOnly" }] } }, { name: "OracleSetup"; type: { kind: "enum"; variants: [{ name: "None" }, { name: "Pyth" }] } }, { name: "OracleKey"; type: { kind: "enum"; variants: [{ fields: ["publicKey"]; name: "Pyth" }] } }, { name: "BankVaultType"; type: { kind: "enum"; variants: [{ name: "Liquidity" }, { name: "Insurance" }, { name: "Fee" }] } }]
version: "0.1.0"
Supported config environments.