From c79291d7095cd859f006a0fe058412b01e110940 Mon Sep 17 00:00:00 2001 From: LixvYang <2690688423@qq.com> Date: Sat, 20 Sep 2025 23:06:09 +0800 Subject: [PATCH] feat: [add marginfi idl] --- marginfi/marginfi.json | 7330 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 7330 insertions(+) create mode 100644 marginfi/marginfi.json diff --git a/marginfi/marginfi.json b/marginfi/marginfi.json new file mode 100644 index 0000000..10c26bd --- /dev/null +++ b/marginfi/marginfi.json @@ -0,0 +1,7330 @@ +{ + "address": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "metadata": { + "name": "marginfi", + "version": "0.1.4", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "config_group_fee", + "docs": [ + "(global fee admin only) Enable or disable program fees for any group. Does not require the", + "group admin to sign: the global fee state admin can turn program fees on or off for any", + "group" + ], + "discriminator": [ + 231, + 205, + 66, + 242, + 220, + 87, + 145, + 38 + ], + "accounts": [ + { + "name": "marginfi_group", + "writable": true + }, + { + "name": "global_fee_admin", + "docs": [ + "`global_fee_admin` of the FeeState" + ], + "signer": true, + "relations": [ + "fee_state" + ] + }, + { + "name": "fee_state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + } + ], + "args": [ + { + "name": "enable_program_fee", + "type": "bool" + } + ] + }, + { + "name": "edit_global_fee_state", + "docs": [ + "(global fee admin only) Adjust fees, admin, or the destination wallet" + ], + "discriminator": [ + 52, + 62, + 35, + 129, + 93, + 69, + 165, + 202 + ], + "accounts": [ + { + "name": "global_fee_admin", + "docs": [ + "Admin of the global FeeState" + ], + "writable": true, + "signer": true, + "relations": [ + "fee_state" + ] + }, + { + "name": "fee_state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + } + ], + "args": [ + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "fee_wallet", + "type": "pubkey" + }, + { + "name": "bank_init_flat_sol_fee", + "type": "u32" + }, + { + "name": "program_fee_fixed", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "program_fee_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + } + ] + }, + { + "name": "edit_staked_settings", + "discriminator": [ + 11, + 108, + 215, + 87, + 240, + 9, + 66, + 241 + ], + "accounts": [ + { + "name": "marginfi_group", + "relations": [ + "staked_settings" + ] + }, + { + "name": "admin", + "signer": true, + "relations": [ + "marginfi_group" + ] + }, + { + "name": "staked_settings", + "writable": true + } + ], + "args": [ + { + "name": "settings", + "type": { + "defined": { + "name": "StakedSettingsEditConfig" + } + } + } + ] + }, + { + "name": "init_global_fee_state", + "docs": [ + "(Runs once per program) Configures the fee state account, where the global admin sets fees", + "that are assessed to the protocol" + ], + "discriminator": [ + 82, + 48, + 247, + 59, + 220, + 109, + 231, + 44 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "Pays the init fee" + ], + "writable": true, + "signer": true + }, + { + "name": "fee_state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "fee_wallet", + "type": "pubkey" + }, + { + "name": "bank_init_flat_sol_fee", + "type": "u32" + }, + { + "name": "program_fee_fixed", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "program_fee_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + } + ] + }, + { + "name": "init_staked_settings", + "docs": [ + "(group admin only) Init the Staked Settings account, which is used to create staked", + "collateral banks, and must run before any staked collateral bank can be created with", + "`add_pool_permissionless`. Running this ix effectively opts the group into the staked", + "collateral feature." + ], + "discriminator": [ + 52, + 35, + 149, + 44, + 69, + 86, + 69, + 80 + ], + "accounts": [ + { + "name": "marginfi_group" + }, + { + "name": "admin", + "signer": true, + "relations": [ + "marginfi_group" + ] + }, + { + "name": "fee_payer", + "docs": [ + "Pays the init fee" + ], + "writable": true, + "signer": true + }, + { + "name": "staked_settings", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, + 116, + 97, + 107, + 101, + 100, + 95, + 115, + 101, + 116, + 116, + 105, + 110, + 103, + 115 + ] + }, + { + "kind": "account", + "path": "marginfi_group" + } + ] + } + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "settings", + "type": { + "defined": { + "name": "StakedSettingsConfig" + } + } + } + ] + }, + { + "name": "lending_account_borrow", + "discriminator": [ + 4, + 126, + 116, + 53, + 48, + 5, + 212, + 31 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "marginfi_account", + "bank" + ] + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "destination_token_account", + "writable": true + }, + { + "name": "bank_liquidity_vault_authority", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "liquidity_vault", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "lending_account_close_balance", + "discriminator": [ + 245, + 54, + 41, + 4, + 243, + 202, + 31, + 17 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "marginfi_account", + "bank" + ] + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "bank", + "writable": true + } + ], + "args": [] + }, + { + "name": "lending_account_deposit", + "discriminator": [ + 171, + 94, + 235, + 103, + 82, + 64, + 212, + 140 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "marginfi_account", + "bank" + ] + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "signer_token_account", + "writable": true + }, + { + "name": "liquidity_vault", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "deposit_up_to_limit", + "type": { + "option": "bool" + } + } + ] + }, + { + "name": "lending_account_end_flashloan", + "discriminator": [ + 105, + 124, + 201, + 106, + 153, + 2, + 8, + 156 + ], + "accounts": [ + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + } + ], + "args": [] + }, + { + "name": "lending_account_liquidate", + "docs": [ + "Liquidate a lending account balance of an unhealthy marginfi account" + ], + "discriminator": [ + 214, + 169, + 151, + 213, + 251, + 167, + 86, + 219 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "asset_bank", + "liab_bank", + "liquidator_marginfi_account", + "liquidatee_marginfi_account" + ] + }, + { + "name": "asset_bank", + "writable": true + }, + { + "name": "liab_bank", + "writable": true + }, + { + "name": "liquidator_marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "liquidator_marginfi_account" + ] + }, + { + "name": "liquidatee_marginfi_account", + "writable": true + }, + { + "name": "bank_liquidity_vault_authority", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "liab_bank" + } + ] + } + }, + { + "name": "bank_liquidity_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "liab_bank" + } + ] + } + }, + { + "name": "bank_insurance_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "liab_bank" + } + ] + } + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "asset_amount", + "type": "u64" + } + ] + }, + { + "name": "lending_account_pulse_health", + "docs": [ + "(Permissionless) Refresh the internal risk engine health cache. Useful for liquidators and", + "other consumers that want to see the internal risk state of a user account. This cache is", + "read-only and serves no purpose except being populated by this ix.", + "* remaining accounts expected in the same order as borrow, etc. I.e., for each balance the", + "user has, pass bank and oracle: " + ], + "discriminator": [ + 186, + 52, + 117, + 97, + 34, + 74, + 39, + 253 + ], + "accounts": [ + { + "name": "marginfi_account", + "writable": true + } + ], + "args": [] + }, + { + "name": "lending_account_repay", + "discriminator": [ + 79, + 209, + 172, + 177, + 222, + 51, + 173, + 151 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "marginfi_account", + "bank" + ] + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "signer_token_account", + "writable": true + }, + { + "name": "liquidity_vault", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "repay_all", + "type": { + "option": "bool" + } + } + ] + }, + { + "name": "lending_account_settle_emissions", + "discriminator": [ + 161, + 58, + 136, + 174, + 242, + 223, + 156, + 176 + ], + "accounts": [ + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "bank", + "writable": true + } + ], + "args": [] + }, + { + "name": "lending_account_sort_balances", + "docs": [ + "(Permissionless) Sorts the lending account balances in descending order and removes the \"gaps\"", + "(i.e. inactive balances in between the active ones), if any.", + "This is necessary to ensure any legacy marginfi accounts are compliant with the", + "\"gapless and sorted\" requirements we now have." + ], + "discriminator": [ + 187, + 194, + 110, + 84, + 82, + 170, + 204, + 9 + ], + "accounts": [ + { + "name": "marginfi_account", + "writable": true + } + ], + "args": [] + }, + { + "name": "lending_account_start_flashloan", + "discriminator": [ + 14, + 131, + 33, + 220, + 81, + 186, + 180, + 107 + ], + "accounts": [ + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "ixs_sysvar", + "address": "Sysvar1nstructions1111111111111111111111111" + } + ], + "args": [ + { + "name": "end_index", + "type": "u64" + } + ] + }, + { + "name": "lending_account_withdraw", + "discriminator": [ + 36, + 72, + 74, + 19, + 210, + 210, + 192, + 192 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "marginfi_account", + "bank" + ] + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "destination_token_account", + "writable": true + }, + { + "name": "bank_liquidity_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "liquidity_vault", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "withdraw_all", + "type": { + "option": "bool" + } + } + ] + }, + { + "name": "lending_account_withdraw_emissions", + "discriminator": [ + 234, + 22, + 84, + 214, + 118, + 176, + 140, + 170 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "marginfi_account", + "bank" + ] + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "emissions_mint", + "relations": [ + "bank" + ] + }, + { + "name": "emissions_auth", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 101, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + }, + { + "kind": "account", + "path": "bank" + }, + { + "kind": "account", + "path": "emissions_mint" + } + ] + } + }, + { + "name": "emissions_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 101, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116, + 95, + 115, + 101, + 101, + 100 + ] + }, + { + "kind": "account", + "path": "bank" + }, + { + "kind": "account", + "path": "emissions_mint" + } + ] + } + }, + { + "name": "destination_account", + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [] + }, + { + "name": "lending_account_withdraw_emissions_permissionless", + "discriminator": [ + 4, + 174, + 124, + 203, + 44, + 49, + 145, + 150 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "marginfi_account", + "bank" + ] + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "bank", + "writable": true + }, + { + "name": "emissions_mint", + "relations": [ + "bank" + ] + }, + { + "name": "emissions_auth", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 101, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + }, + { + "kind": "account", + "path": "bank" + }, + { + "kind": "account", + "path": "emissions_mint" + } + ] + } + }, + { + "name": "emissions_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 101, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116, + 95, + 115, + 101, + 101, + 100 + ] + }, + { + "kind": "account", + "path": "bank" + }, + { + "kind": "account", + "path": "emissions_mint" + } + ] + } + }, + { + "name": "destination_account", + "docs": [ + "registered on `marginfi_account`" + ], + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [] + }, + { + "name": "lending_pool_accrue_bank_interest", + "discriminator": [ + 108, + 201, + 30, + 87, + 47, + 65, + 97, + 188 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "bank", + "writable": true + } + ], + "args": [] + }, + { + "name": "lending_pool_add_bank", + "discriminator": [ + 215, + 68, + 72, + 78, + 208, + 218, + 103, + 182 + ], + "accounts": [ + { + "name": "marginfi_group", + "writable": true + }, + { + "name": "admin", + "writable": true, + "signer": true, + "relations": [ + "marginfi_group" + ] + }, + { + "name": "fee_payer", + "docs": [ + "Pays to init accounts and pays `fee_state.bank_init_flat_sol_fee` lamports to the protocol" + ], + "writable": true, + "signer": true + }, + { + "name": "fee_state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + }, + { + "name": "global_fee_wallet", + "writable": true, + "relations": [ + "fee_state" + ] + }, + { + "name": "bank_mint" + }, + { + "name": "bank", + "writable": true, + "signer": true + }, + { + "name": "liquidity_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "liquidity_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "bank_config", + "type": { + "defined": { + "name": "BankConfigCompact" + } + } + } + ] + }, + { + "name": "lending_pool_add_bank_permissionless", + "discriminator": [ + 127, + 187, + 121, + 34, + 187, + 167, + 238, + 102 + ], + "accounts": [ + { + "name": "marginfi_group", + "writable": true, + "relations": [ + "staked_settings" + ] + }, + { + "name": "staked_settings" + }, + { + "name": "fee_payer", + "writable": true, + "signer": true + }, + { + "name": "bank_mint", + "docs": [ + "Mint of the spl-single-pool LST (a PDA derived from `stake_pool`)", + "", + "because the sol_pool and stake_pool will not derive to a valid PDA which is also owned by", + "the staking program and spl-single-pool program." + ] + }, + { + "name": "sol_pool" + }, + { + "name": "stake_pool", + "docs": [ + "this key.", + "", + "If derives the same `bank_mint`, then this must be the correct stake pool for that mint, and", + "we can subsequently use it to validate the `sol_pool`" + ] + }, + { + "name": "bank", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "marginfi_group" + }, + { + "kind": "account", + "path": "bank_mint" + }, + { + "kind": "arg", + "path": "bank_seed" + } + ] + } + }, + { + "name": "liquidity_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "liquidity_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "bank_seed", + "type": "u64" + } + ] + }, + { + "name": "lending_pool_add_bank_with_seed", + "docs": [ + "A copy of lending_pool_add_bank with an additional bank seed.", + "This seed is used to create a PDA for the bank's signature.", + "lending_pool_add_bank is preserved for backwards compatibility." + ], + "discriminator": [ + 76, + 211, + 213, + 171, + 117, + 78, + 158, + 76 + ], + "accounts": [ + { + "name": "marginfi_group", + "writable": true + }, + { + "name": "admin", + "writable": true, + "signer": true, + "relations": [ + "marginfi_group" + ] + }, + { + "name": "fee_payer", + "docs": [ + "Pays to init accounts and pays `fee_state.bank_init_flat_sol_fee` lamports to the protocol" + ], + "writable": true, + "signer": true + }, + { + "name": "fee_state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + }, + { + "name": "global_fee_wallet", + "writable": true, + "relations": [ + "fee_state" + ] + }, + { + "name": "bank_mint" + }, + { + "name": "bank", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "marginfi_group" + }, + { + "kind": "account", + "path": "bank_mint" + }, + { + "kind": "arg", + "path": "bank_seed" + } + ] + } + }, + { + "name": "liquidity_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "liquidity_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "bank_config", + "type": { + "defined": { + "name": "BankConfigCompact" + } + } + }, + { + "name": "bank_seed", + "type": "u64" + } + ] + }, + { + "name": "lending_pool_close_bank", + "discriminator": [ + 22, + 115, + 7, + 130, + 227, + 85, + 0, + 47 + ], + "accounts": [ + { + "name": "group", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "admin", + "writable": true, + "signer": true, + "relations": [ + "group" + ] + } + ], + "args": [] + }, + { + "name": "lending_pool_collect_bank_fees", + "discriminator": [ + 201, + 5, + 215, + 116, + 230, + 92, + 75, + 150 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "liquidity_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "liquidity_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + }, + { + "name": "fee_ata", + "docs": [ + "(validated in handler). Must already exist, may require initializing the ATA if it does not", + "already exist prior to this ix." + ], + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [] + }, + { + "name": "lending_pool_configure_bank", + "docs": [ + "(admin only)" + ], + "discriminator": [ + 121, + 173, + 156, + 40, + 93, + 148, + 56, + 237 + ], + "accounts": [ + { + "name": "group", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "bank", + "writable": true + } + ], + "args": [ + { + "name": "bank_config_opt", + "type": { + "defined": { + "name": "BankConfigOpt" + } + } + } + ] + }, + { + "name": "lending_pool_configure_bank_emode", + "docs": [ + "(emode_admin only)" + ], + "discriminator": [ + 17, + 175, + 91, + 57, + 239, + 86, + 49, + 71 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "emode_admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "bank", + "writable": true + } + ], + "args": [ + { + "name": "emode_tag", + "type": "u16" + }, + { + "name": "entries", + "type": { + "array": [ + { + "defined": { + "name": "EmodeEntry" + } + }, + 10 + ] + } + } + ] + }, + { + "name": "lending_pool_configure_bank_interest_only", + "docs": [ + "(delegate_curve_admin only)" + ], + "discriminator": [ + 245, + 107, + 83, + 38, + 103, + 219, + 163, + 241 + ], + "accounts": [ + { + "name": "group", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "delegate_curve_admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "bank", + "writable": true + } + ], + "args": [ + { + "name": "interest_rate_config", + "type": { + "defined": { + "name": "InterestRateConfigOpt" + } + } + } + ] + }, + { + "name": "lending_pool_configure_bank_limits_only", + "docs": [ + "(delegate_limits_admin only)" + ], + "discriminator": [ + 157, + 196, + 221, + 200, + 202, + 62, + 84, + 21 + ], + "accounts": [ + { + "name": "group", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "delegate_limit_admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "bank", + "writable": true + } + ], + "args": [ + { + "name": "deposit_limit", + "type": { + "option": "u64" + } + }, + { + "name": "borrow_limit", + "type": { + "option": "u64" + } + }, + { + "name": "total_asset_value_init_limit", + "type": { + "option": "u64" + } + } + ] + }, + { + "name": "lending_pool_configure_bank_oracle", + "docs": [ + "(admin only)" + ], + "discriminator": [ + 209, + 82, + 255, + 171, + 124, + 21, + 71, + 81 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "bank", + "writable": true + } + ], + "args": [ + { + "name": "setup", + "type": "u8" + }, + { + "name": "oracle", + "type": "pubkey" + } + ] + }, + { + "name": "lending_pool_handle_bankruptcy", + "docs": [ + "Handle bad debt of a bankrupt marginfi account for a given bank." + ], + "discriminator": [ + 162, + 11, + 56, + 139, + 90, + 128, + 70, + 173 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank", + "marginfi_account" + ] + }, + { + "name": "signer", + "docs": [ + "PERMISSIONLESS_BAD_DEBT_SETTLEMENT_FLAG is not set" + ], + "signer": true + }, + { + "name": "bank", + "writable": true + }, + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "liquidity_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 105, + 113, + 117, + 105, + 100, + 105, + 116, + 121, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "token_program" + } + ], + "args": [] + }, + { + "name": "lending_pool_setup_emissions", + "docs": [ + "(delegate_emissions_admin only)" + ], + "discriminator": [ + 206, + 97, + 120, + 172, + 113, + 204, + 169, + 70 + ], + "accounts": [ + { + "name": "group", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "delegate_emissions_admin", + "writable": true, + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "emissions_mint" + }, + { + "name": "emissions_auth", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 101, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + }, + { + "kind": "account", + "path": "bank" + }, + { + "kind": "account", + "path": "emissions_mint" + } + ] + } + }, + { + "name": "emissions_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 101, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116, + 95, + 115, + 101, + 101, + 100 + ] + }, + { + "kind": "account", + "path": "bank" + }, + { + "kind": "account", + "path": "emissions_mint" + } + ] + } + }, + { + "name": "emissions_funding_account", + "docs": [ + "NOTE: This is a TokenAccount, spl transfer will validate it.", + "" + ], + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "flags", + "type": "u64" + }, + { + "name": "rate", + "type": "u64" + }, + { + "name": "total_emissions", + "type": "u64" + } + ] + }, + { + "name": "lending_pool_update_emissions_parameters", + "docs": [ + "(delegate_emissions_admin only)" + ], + "discriminator": [ + 55, + 213, + 224, + 168, + 153, + 53, + 197, + 40 + ], + "accounts": [ + { + "name": "group", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "delegate_emissions_admin", + "writable": true, + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "emissions_mint" + }, + { + "name": "emissions_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 101, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116, + 95, + 115, + 101, + 101, + 100 + ] + }, + { + "kind": "account", + "path": "bank" + }, + { + "kind": "account", + "path": "emissions_mint" + } + ] + } + }, + { + "name": "emissions_funding_account", + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "emissions_flags", + "type": { + "option": "u64" + } + }, + { + "name": "emissions_rate", + "type": { + "option": "u64" + } + }, + { + "name": "additional_emissions", + "type": { + "option": "u64" + } + } + ] + }, + { + "name": "lending_pool_update_fees_destination_account", + "discriminator": [ + 102, + 4, + 121, + 243, + 237, + 110, + 95, + 13 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "destination_account", + "docs": [ + "Bank fees will be sent to this account which must be an ATA of the bank's mint." + ] + } + ], + "args": [] + }, + { + "name": "lending_pool_withdraw_fees", + "discriminator": [ + 92, + 140, + 215, + 254, + 170, + 0, + 83, + 174 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "bank" + }, + { + "name": "admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "fee_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "dst_token_account", + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "lending_pool_withdraw_fees_permissionless", + "discriminator": [ + 57, + 245, + 1, + 208, + 130, + 18, + 145, + 113 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "bank" + }, + { + "name": "fee_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fee_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "fees_destination_account", + "writable": true, + "relations": [ + "bank" + ] + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "lending_pool_withdraw_insurance", + "discriminator": [ + 108, + 60, + 60, + 246, + 104, + 79, + 159, + 243 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "bank" + }, + { + "name": "admin", + "signer": true, + "relations": [ + "group" + ] + }, + { + "name": "insurance_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "insurance_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 105, + 110, + 115, + 117, + 114, + 97, + 110, + 99, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104 + ] + }, + { + "kind": "account", + "path": "bank" + } + ] + } + }, + { + "name": "dst_token_account", + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "marginfi_account_close", + "discriminator": [ + 186, + 221, + 93, + 34, + 50, + 97, + 194, + 241 + ], + "accounts": [ + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "fee_payer", + "writable": true, + "signer": true + } + ], + "args": [] + }, + { + "name": "marginfi_account_initialize", + "docs": [ + "Initialize a marginfi account for a given group" + ], + "discriminator": [ + 43, + 78, + 61, + 255, + 148, + 52, + 249, + 154 + ], + "accounts": [ + { + "name": "marginfi_group" + }, + { + "name": "marginfi_account", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "fee_payer", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "marginfi_account_update_emissions_destination_account", + "discriminator": [ + 73, + 185, + 162, + 201, + 111, + 24, + 116, + 185 + ], + "accounts": [ + { + "name": "marginfi_account", + "writable": true + }, + { + "name": "authority", + "signer": true, + "relations": [ + "marginfi_account" + ] + }, + { + "name": "destination_account", + "docs": [ + "User's earned emissions will be sent to the canonical ATA of this wallet.", + "" + ] + } + ], + "args": [] + }, + { + "name": "marginfi_group_configure", + "discriminator": [ + 62, + 199, + 81, + 78, + 33, + 13, + 236, + 61 + ], + "accounts": [ + { + "name": "marginfi_group", + "writable": true + }, + { + "name": "admin", + "signer": true, + "relations": [ + "marginfi_group" + ] + } + ], + "args": [ + { + "name": "new_admin", + "type": "pubkey" + }, + { + "name": "new_emode_admin", + "type": "pubkey" + }, + { + "name": "new_curve_admin", + "type": "pubkey" + }, + { + "name": "new_limit_admin", + "type": "pubkey" + }, + { + "name": "new_emissions_admin", + "type": "pubkey" + }, + { + "name": "is_arena_group", + "type": "bool" + } + ] + }, + { + "name": "marginfi_group_initialize", + "discriminator": [ + 255, + 67, + 67, + 26, + 94, + 31, + 34, + 20 + ], + "accounts": [ + { + "name": "marginfi_group", + "writable": true, + "signer": true + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "fee_state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "is_arena_group", + "type": "bool" + } + ] + }, + { + "name": "migrate_pyth_push_oracle", + "discriminator": [ + 139, + 58, + 192, + 167, + 217, + 110, + 247, + 152 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "bank" + ] + }, + { + "name": "bank", + "writable": true + }, + { + "name": "oracle", + "docs": [ + "Must use the Pyth Sponsored shard ID (0) or mrgn's (3301)", + "" + ] + } + ], + "args": [] + }, + { + "name": "propagate_fee_state", + "docs": [ + "(Permissionless) Force any group to adopt the current FeeState settings" + ], + "discriminator": [ + 64, + 3, + 166, + 194, + 129, + 21, + 101, + 155 + ], + "accounts": [ + { + "name": "fee_state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 115, + 116, + 97, + 116, + 101 + ] + } + ] + } + }, + { + "name": "marginfi_group", + "docs": [ + "Any group, this ix is permisionless and can propogate the fee to any group" + ], + "writable": true + } + ], + "args": [] + }, + { + "name": "propagate_staked_settings", + "discriminator": [ + 210, + 30, + 152, + 69, + 130, + 99, + 222, + 170 + ], + "accounts": [ + { + "name": "marginfi_group", + "relations": [ + "staked_settings" + ] + }, + { + "name": "staked_settings" + }, + { + "name": "bank", + "writable": true + } + ], + "args": [] + }, + { + "name": "transfer_to_new_account", + "discriminator": [ + 28, + 79, + 129, + 231, + 169, + 69, + 69, + 65 + ], + "accounts": [ + { + "name": "group", + "relations": [ + "old_marginfi_account" + ] + }, + { + "name": "old_marginfi_account", + "writable": true + }, + { + "name": "new_marginfi_account", + "writable": true, + "signer": true + }, + { + "name": "authority", + "writable": true, + "signer": true, + "relations": [ + "old_marginfi_account" + ] + }, + { + "name": "new_authority" + }, + { + "name": "global_fee_wallet", + "writable": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "Bank", + "discriminator": [ + 142, + 49, + 166, + 242, + 50, + 66, + 97, + 188 + ] + }, + { + "name": "FeeState", + "discriminator": [ + 63, + 224, + 16, + 85, + 193, + 36, + 235, + 220 + ] + }, + { + "name": "MarginfiAccount", + "discriminator": [ + 67, + 178, + 130, + 109, + 126, + 114, + 28, + 42 + ] + }, + { + "name": "MarginfiGroup", + "discriminator": [ + 182, + 23, + 173, + 240, + 151, + 206, + 182, + 67 + ] + }, + { + "name": "StakedSettings", + "discriminator": [ + 157, + 140, + 6, + 77, + 89, + 173, + 173, + 125 + ] + } + ], + "events": [ + { + "name": "EditStakedSettingsEvent", + "discriminator": [ + 29, + 58, + 155, + 191, + 75, + 220, + 145, + 206 + ] + }, + { + "name": "HealthPulseEvent", + "discriminator": [ + 183, + 159, + 218, + 110, + 61, + 220, + 65, + 1 + ] + }, + { + "name": "LendingAccountBorrowEvent", + "discriminator": [ + 223, + 96, + 81, + 10, + 156, + 99, + 26, + 59 + ] + }, + { + "name": "LendingAccountDepositEvent", + "discriminator": [ + 161, + 54, + 237, + 217, + 105, + 248, + 122, + 151 + ] + }, + { + "name": "LendingAccountLiquidateEvent", + "discriminator": [ + 166, + 160, + 249, + 154, + 183, + 39, + 23, + 242 + ] + }, + { + "name": "LendingAccountRepayEvent", + "discriminator": [ + 16, + 220, + 55, + 111, + 7, + 80, + 16, + 25 + ] + }, + { + "name": "LendingAccountWithdrawEvent", + "discriminator": [ + 3, + 220, + 148, + 243, + 33, + 249, + 54, + 88 + ] + }, + { + "name": "LendingPoolBankAccrueInterestEvent", + "discriminator": [ + 104, + 117, + 187, + 156, + 111, + 154, + 106, + 186 + ] + }, + { + "name": "LendingPoolBankCollectFeesEvent", + "discriminator": [ + 101, + 119, + 97, + 250, + 169, + 175, + 156, + 253 + ] + }, + { + "name": "LendingPoolBankConfigureEvent", + "discriminator": [ + 246, + 35, + 233, + 110, + 93, + 152, + 235, + 40 + ] + }, + { + "name": "LendingPoolBankConfigureFrozenEvent", + "discriminator": [ + 24, + 10, + 55, + 18, + 49, + 150, + 157, + 179 + ] + }, + { + "name": "LendingPoolBankConfigureOracleEvent", + "discriminator": [ + 119, + 140, + 110, + 253, + 150, + 64, + 210, + 62 + ] + }, + { + "name": "LendingPoolBankCreateEvent", + "discriminator": [ + 236, + 220, + 201, + 63, + 239, + 126, + 136, + 249 + ] + }, + { + "name": "LendingPoolBankHandleBankruptcyEvent", + "discriminator": [ + 166, + 77, + 41, + 140, + 36, + 94, + 10, + 57 + ] + }, + { + "name": "MarginfiAccountCreateEvent", + "discriminator": [ + 183, + 5, + 117, + 104, + 122, + 199, + 68, + 51 + ] + }, + { + "name": "MarginfiAccountTransferToNewAccount", + "discriminator": [ + 59, + 105, + 171, + 110, + 223, + 136, + 80, + 89 + ] + }, + { + "name": "MarginfiGroupConfigureEvent", + "discriminator": [ + 241, + 104, + 172, + 167, + 41, + 195, + 199, + 170 + ] + }, + { + "name": "MarginfiGroupCreateEvent", + "discriminator": [ + 233, + 125, + 61, + 14, + 98, + 240, + 136, + 253 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "InternalLogicError", + "msg": "Internal Marginfi logic error" + }, + { + "code": 6001, + "name": "BankNotFound", + "msg": "Invalid bank index" + }, + { + "code": 6002, + "name": "LendingAccountBalanceNotFound", + "msg": "Lending account balance not found" + }, + { + "code": 6003, + "name": "BankAssetCapacityExceeded", + "msg": "Bank deposit capacity exceeded" + }, + { + "code": 6004, + "name": "InvalidTransfer", + "msg": "Invalid transfer" + }, + { + "code": 6005, + "name": "MissingPythOrBankAccount", + "msg": "Missing Oracle, Bank, LST mint, or Sol Pool" + }, + { + "code": 6006, + "name": "MissingPythAccount", + "msg": "Missing Pyth account" + }, + { + "code": 6007, + "name": "MissingBankAccount", + "msg": "Missing Bank account" + }, + { + "code": 6008, + "name": "InvalidBankAccount", + "msg": "Invalid Bank account" + }, + { + "code": 6009, + "name": "RiskEngineInitRejected", + "msg": "RiskEngine rejected due to either bad health or stale oracles" + }, + { + "code": 6010, + "name": "LendingAccountBalanceSlotsFull", + "msg": "Lending account balance slots are full" + }, + { + "code": 6011, + "name": "BankAlreadyExists", + "msg": "Bank already exists" + }, + { + "code": 6012, + "name": "ZeroLiquidationAmount", + "msg": "Amount to liquidate must be positive" + }, + { + "code": 6013, + "name": "AccountNotBankrupt", + "msg": "Account is not bankrupt" + }, + { + "code": 6014, + "name": "BalanceNotBadDebt", + "msg": "Account balance is not bad debt" + }, + { + "code": 6015, + "name": "InvalidConfig", + "msg": "Invalid group config" + }, + { + "code": 6016, + "name": "BankPaused", + "msg": "Bank paused" + }, + { + "code": 6017, + "name": "BankReduceOnly", + "msg": "Bank is ReduceOnly mode" + }, + { + "code": 6018, + "name": "BankAccountNotFound", + "msg": "Bank is missing" + }, + { + "code": 6019, + "name": "OperationDepositOnly", + "msg": "Operation is deposit-only" + }, + { + "code": 6020, + "name": "OperationWithdrawOnly", + "msg": "Operation is withdraw-only" + }, + { + "code": 6021, + "name": "OperationBorrowOnly", + "msg": "Operation is borrow-only" + }, + { + "code": 6022, + "name": "OperationRepayOnly", + "msg": "Operation is repay-only" + }, + { + "code": 6023, + "name": "NoAssetFound", + "msg": "No asset found" + }, + { + "code": 6024, + "name": "NoLiabilityFound", + "msg": "No liability found" + }, + { + "code": 6025, + "name": "InvalidOracleSetup", + "msg": "Invalid oracle setup" + }, + { + "code": 6026, + "name": "IllegalUtilizationRatio", + "msg": "Invalid bank utilization ratio" + }, + { + "code": 6027, + "name": "BankLiabilityCapacityExceeded", + "msg": "Bank borrow cap exceeded" + }, + { + "code": 6028, + "name": "InvalidPrice", + "msg": "Invalid Price" + }, + { + "code": 6029, + "name": "IsolatedAccountIllegalState", + "msg": "Account can have only one liability when account is under isolated risk" + }, + { + "code": 6030, + "name": "EmissionsAlreadySetup", + "msg": "Emissions already setup" + }, + { + "code": 6031, + "name": "OracleNotSetup", + "msg": "Oracle is not set" + }, + { + "code": 6032, + "name": "InvalidSwitchboardDecimalConversion", + "msg": "Invalid switchboard decimal conversion" + }, + { + "code": 6033, + "name": "CannotCloseOutstandingEmissions", + "msg": "Cannot close balance because of outstanding emissions" + }, + { + "code": 6034, + "name": "EmissionsUpdateError", + "msg": "Update emissions error" + }, + { + "code": 6035, + "name": "AccountDisabled", + "msg": "Account disabled" + }, + { + "code": 6036, + "name": "AccountTempActiveBalanceLimitExceeded", + "msg": "Account can't temporarily open 3 balances, please close a balance first" + }, + { + "code": 6037, + "name": "AccountInFlashloan", + "msg": "Illegal action during flashloan" + }, + { + "code": 6038, + "name": "IllegalFlashloan", + "msg": "Illegal flashloan" + }, + { + "code": 6039, + "name": "IllegalFlag", + "msg": "Illegal flag" + }, + { + "code": 6040, + "name": "IllegalBalanceState", + "msg": "Illegal balance state" + }, + { + "code": 6041, + "name": "IllegalAccountAuthorityTransfer", + "msg": "Illegal account authority transfer" + }, + { + "code": 6042, + "name": "Unauthorized", + "msg": "Unauthorized" + }, + { + "code": 6043, + "name": "IllegalAction", + "msg": "Invalid account authority" + }, + { + "code": 6044, + "name": "T22MintRequired", + "msg": "Token22 Banks require mint account as first remaining account" + }, + { + "code": 6045, + "name": "InvalidFeeAta", + "msg": "Invalid ATA for global fee account" + }, + { + "code": 6046, + "name": "AddedStakedPoolManually", + "msg": "Use add pool permissionless instead" + }, + { + "code": 6047, + "name": "AssetTagMismatch", + "msg": "Staked SOL accounts can only deposit staked assets and borrow SOL" + }, + { + "code": 6048, + "name": "StakePoolValidationFailed", + "msg": "Stake pool validation failed: check the stake pool, mint, or sol pool" + }, + { + "code": 6049, + "name": "SwitchboardStalePrice", + "msg": "Switchboard oracle: stale price" + }, + { + "code": 6050, + "name": "PythPushStalePrice", + "msg": "Pyth Push oracle: stale price" + }, + { + "code": 6051, + "name": "WrongNumberOfOracleAccounts", + "msg": "Oracle error: wrong number of accounts" + }, + { + "code": 6052, + "name": "WrongOracleAccountKeys", + "msg": "Oracle error: wrong account keys" + }, + { + "code": 6053, + "name": "PythPushWrongAccountOwner", + "msg": "Pyth Push oracle: wrong account owner" + }, + { + "code": 6054, + "name": "StakedPythPushWrongAccountOwner", + "msg": "Staked Pyth Push oracle: wrong account owner" + }, + { + "code": 6055, + "name": "PythPushMismatchedFeedId", + "msg": "Pyth Push oracle: mismatched feed id" + }, + { + "code": 6056, + "name": "PythPushInsufficientVerificationLevel", + "msg": "Pyth Push oracle: insufficient verification level" + }, + { + "code": 6057, + "name": "PythPushFeedIdMustBe32Bytes", + "msg": "Pyth Push oracle: feed id must be 32 Bytes" + }, + { + "code": 6058, + "name": "PythPushFeedIdNonHexCharacter", + "msg": "Pyth Push oracle: feed id contains non-hex characters" + }, + { + "code": 6059, + "name": "SwitchboardWrongAccountOwner", + "msg": "Switchboard oracle: wrong account owner" + }, + { + "code": 6060, + "name": "PythPushInvalidAccount", + "msg": "Pyth Push oracle: invalid account" + }, + { + "code": 6061, + "name": "SwitchboardInvalidAccount", + "msg": "Switchboard oracle: invalid account" + }, + { + "code": 6062, + "name": "MathError", + "msg": "Math error" + }, + { + "code": 6063, + "name": "InvalidEmissionsDestinationAccount", + "msg": "Invalid emissions destination account" + }, + { + "code": 6064, + "name": "SameAssetAndLiabilityBanks", + "msg": "Asset and liability bank cannot be the same" + }, + { + "code": 6065, + "name": "OverliquidationAttempt", + "msg": "Trying to withdraw more assets than available" + }, + { + "code": 6066, + "name": "NoLiabilitiesInLiabilityBank", + "msg": "Liability bank has no liabilities" + }, + { + "code": 6067, + "name": "AssetsInLiabilityBank", + "msg": "Liability bank has assets" + }, + { + "code": 6068, + "name": "HealthyAccount", + "msg": "Account is healthy and cannot be liquidated" + }, + { + "code": 6069, + "name": "ExhaustedLiability", + "msg": "Liability payoff too severe, exhausted liability" + }, + { + "code": 6070, + "name": "TooSeverePayoff", + "msg": "Liability payoff too severe, liability balance has assets" + }, + { + "code": 6071, + "name": "TooSevereLiquidation", + "msg": "Liquidation too severe, account above maintenance requirement" + }, + { + "code": 6072, + "name": "WorseHealthPostLiquidation", + "msg": "Liquidation would worsen account health" + }, + { + "code": 6073, + "name": "ArenaBankLimit", + "msg": "Arena groups can only support two banks" + }, + { + "code": 6074, + "name": "ArenaSettingCannotChange", + "msg": "Arena groups cannot return to non-arena status" + }, + { + "code": 6075, + "name": "BadEmodeConfig", + "msg": "The Emode config was invalid" + }, + { + "code": 6076, + "name": "PythPushInvalidWindowSize", + "msg": "TWAP window size does not match expected duration" + }, + { + "code": 6077, + "name": "InvalidFeesDestinationAccount", + "msg": "Invalid fees destination account" + }, + { + "code": 6078, + "name": "ZeroAssetPrice", + "msg": "Zero asset price" + }, + { + "code": 6079, + "name": "ZeroLiabilityPrice", + "msg": "Zero liability price" + }, + { + "code": 6080, + "name": "OracleMaxConfidenceExceeded", + "msg": "Oracle max confidence exceeded: try again later" + }, + { + "code": 6081, + "name": "BankCannotClose", + "msg": "Banks cannot close when they have open positions or emissions outstanding" + } + ], + "types": [ + { + "name": "AccountEventHeader", + "type": { + "kind": "struct", + "fields": [ + { + "name": "signer", + "type": { + "option": "pubkey" + } + }, + { + "name": "marginfi_account", + "type": "pubkey" + }, + { + "name": "marginfi_account_authority", + "type": "pubkey" + }, + { + "name": "marginfi_group", + "type": "pubkey" + } + ] + } + }, + { + "name": "Balance", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "active", + "type": "u8" + }, + { + "name": "bank_pk", + "type": "pubkey" + }, + { + "name": "bank_asset_tag", + "docs": [ + "Inherited from the bank when the position is first created and CANNOT BE CHANGED after that.", + "Note that all balances created before the addition of this feature use `ASSET_TAG_DEFAULT`" + ], + "type": "u8" + }, + { + "name": "_pad0", + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "asset_shares", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_shares", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "emissions_outstanding", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "last_update", + "type": "u64" + }, + { + "name": "_padding", + "type": { + "array": [ + "u64", + 1 + ] + } + } + ] + } + }, + { + "name": "Bank", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "mint_decimals", + "type": "u8" + }, + { + "name": "group", + "type": "pubkey" + }, + { + "name": "_pad0", + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "asset_share_value", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_share_value", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liquidity_vault", + "type": "pubkey" + }, + { + "name": "liquidity_vault_bump", + "type": "u8" + }, + { + "name": "liquidity_vault_authority_bump", + "type": "u8" + }, + { + "name": "insurance_vault", + "type": "pubkey" + }, + { + "name": "insurance_vault_bump", + "type": "u8" + }, + { + "name": "insurance_vault_authority_bump", + "type": "u8" + }, + { + "name": "_pad1", + "type": { + "array": [ + "u8", + 4 + ] + } + }, + { + "name": "collected_insurance_fees_outstanding", + "docs": [ + "Fees collected and pending withdraw for the `insurance_vault`" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "fee_vault", + "type": "pubkey" + }, + { + "name": "fee_vault_bump", + "type": "u8" + }, + { + "name": "fee_vault_authority_bump", + "type": "u8" + }, + { + "name": "_pad2", + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "collected_group_fees_outstanding", + "docs": [ + "Fees collected and pending withdraw for the `fee_vault`" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "total_liability_shares", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "total_asset_shares", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "last_update", + "type": "i64" + }, + { + "name": "config", + "type": { + "defined": { + "name": "BankConfig" + } + } + }, + { + "name": "flags", + "docs": [ + "Bank Config Flags", + "", + "- EMISSIONS_FLAG_BORROW_ACTIVE: 1", + "- EMISSIONS_FLAG_LENDING_ACTIVE: 2", + "- PERMISSIONLESS_BAD_DEBT_SETTLEMENT: 4", + "- FREEZE_SETTINGS: 8 - banks with this flag enabled can only update deposit/borrow caps", + "- CLOSE_ENABLED_FLAG - banks with this flag were created after 0.1.4 and can be closed.", + "Banks without this flag can never be closed.", + "" + ], + "type": "u64" + }, + { + "name": "emissions_rate", + "docs": [ + "Emissions APR. Number of emitted tokens (emissions_mint) per 1e(bank.mint_decimal) tokens", + "(bank mint) (native amount) per 1 YEAR." + ], + "type": "u64" + }, + { + "name": "emissions_remaining", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "emissions_mint", + "type": "pubkey" + }, + { + "name": "collected_program_fees_outstanding", + "docs": [ + "Fees collected and pending withdraw for the `FeeState.global_fee_wallet`'s canonical ATA for `mint`" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "emode", + "docs": [ + "Controls this bank's emode configuration, which enables some banks to treat the assets of", + "certain other banks more preferentially as collateral." + ], + "type": { + "defined": { + "name": "EmodeSettings" + } + } + }, + { + "name": "fees_destination_account", + "docs": [ + "Set with `update_fees_destination_account`. This should be an ATA for the bank's mint. If", + "pubkey default, the bank doesn't support this feature, and the fees must be collected", + "manually (withdraw_fees)." + ], + "type": "pubkey" + }, + { + "name": "cache", + "type": { + "defined": { + "name": "BankCache" + } + } + }, + { + "name": "lending_position_count", + "docs": [ + "Number of user lending positions currently open in this bank", + "* For banks created prior to 0.1.4, this is the number of positions opened/closed after", + "0.1.4 goes live, and may be negative.", + "* For banks created in 0.1.4 or later, this is the number of positions open in total, and", + "the bank may safely be closed if this is zero. Will never go negative." + ], + "type": "i32" + }, + { + "name": "borrowing_position_count", + "docs": [ + "Number of user borrowing positions currently open in this bank", + "* For banks created prior to 0.1.4, this is the number of positions opened/closed after", + "0.1.4 goes live, and may be negative.", + "* For banks created in 0.1.4 or later, this is the number of positions open in total, and", + "the bank may safely be closed if this is zero. Will never go negative." + ], + "type": "i32" + }, + { + "name": "_padding_0", + "type": { + "array": [ + "u8", + 16 + ] + } + }, + { + "name": "_padding_1", + "type": { + "array": [ + { + "array": [ + "u64", + 2 + ] + }, + 19 + ] + } + } + ] + } + }, + { + "name": "BankCache", + "docs": [ + "A read-only cache of the bank's key metrics, e.g. spot interest/fee rates." + ], + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "base_rate", + "docs": [ + "Actual (spot) interest/fee rates of the bank, based on utilization", + "* APR (annual percentage rate) values", + "* From 0-1000%, as u32, e.g. u32::MAX = 1000%, u:32::MAX/2 = 500%, etc" + ], + "type": "u32" + }, + { + "name": "lending_rate", + "docs": [ + "Equivalent to `base_rate` * utilization", + "* From 0-1000%, as u32, e.g. u32::MAX = 1000%, u:32::MAX/2 = 500%, etc" + ], + "type": "u32" + }, + { + "name": "borrowing_rate", + "docs": [ + "Equivalent to `base_rate` * (1 + ir_fees) + fixed_fees", + "* From 0-1000%, as u32, e.g. u32::MAX = 1000%, u:32::MAX/2 = 500%, etc" + ], + "type": "u32" + }, + { + "name": "interest_accumulated_for", + "docs": [ + "* in seconds" + ], + "type": "u32" + }, + { + "name": "accumulated_since_last_update", + "docs": [ + "equivalent to (share value increase in the last `interest_accumulated_for` seconds *", + "shares), i.e. the delta in `asset_share_value`, in token.", + "* Note: if the tx that triggered this cache update increased or decreased the net shares,", + "this value still reports using the PRE-CHANGE share amount, since interest is always", + "earned on that amount.", + "* in token, in native decimals, as I80F48" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "_reserved0", + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } + }, + { + "name": "BankConfig", + "docs": [ + "TODO: Convert weights to (u64, u64) to avoid precision loss (maybe?)" + ], + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "asset_weight_init", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "asset_weight_maint", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_weight_init", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_weight_maint", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "deposit_limit", + "type": "u64" + }, + { + "name": "interest_rate_config", + "type": { + "defined": { + "name": "InterestRateConfig" + } + } + }, + { + "name": "operational_state", + "type": { + "defined": { + "name": "BankOperationalState" + } + } + }, + { + "name": "oracle_setup", + "type": { + "defined": { + "name": "OracleSetup" + } + } + }, + { + "name": "oracle_keys", + "type": { + "array": [ + "pubkey", + 5 + ] + } + }, + { + "name": "_pad0", + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "borrow_limit", + "type": "u64" + }, + { + "name": "risk_tier", + "type": { + "defined": { + "name": "RiskTier" + } + } + }, + { + "name": "asset_tag", + "docs": [ + "Determines what kinds of assets users of this bank can interact with.", + "Options:", + "* ASSET_TAG_DEFAULT (0) - A regular asset that can be comingled with any other regular asset", + "or with `ASSET_TAG_SOL`", + "* ASSET_TAG_SOL (1) - Accounts with a SOL position can comingle with **either**", + "`ASSET_TAG_DEFAULT` or `ASSET_TAG_STAKED` positions, but not both", + "* ASSET_TAG_STAKED (2) - Staked SOL assets. Accounts with a STAKED position can only deposit", + "other STAKED assets or SOL (`ASSET_TAG_SOL`) and can only borrow SOL" + ], + "type": "u8" + }, + { + "name": "config_flags", + "docs": [ + "Flags for various config options", + "* 1 - Always set if bank created in 0.1.4 or later, or if migrated to the new pyth", + "oracle setup from a prior version. Not set in 0.1.3 or earlier banks using pyth that have", + "not yet migrated. Does nothing for banks that use switchboard.", + "* 2, 4, 8, 16, etc - reserved for future use." + ], + "type": "u8" + }, + { + "name": "_pad1", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "total_asset_value_init_limit", + "docs": [ + "USD denominated limit for calculating asset value for initialization margin requirements.", + "Example, if total SOL deposits are equal to $1M and the limit it set to $500K,", + "then SOL assets will be discounted by 50%.", + "", + "In other words the max value of liabilities that can be backed by the asset is $500K.", + "This is useful for limiting the damage of orcale attacks.", + "", + "Value is UI USD value, for example value 100 -> $100" + ], + "type": "u64" + }, + { + "name": "oracle_max_age", + "docs": [ + "Time window in seconds for the oracle price feed to be considered live." + ], + "type": "u16" + }, + { + "name": "_padding0", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "oracle_max_confidence", + "docs": [ + "From 0-100%, if the confidence exceeds this value, the oracle is considered invalid. Note:", + "the confidence adjustment is capped at 5% regardless of this value.", + "* 0 falls back to using the default 10% instead, i.e., U32_MAX_DIV_10", + "* A %, as u32, e.g. 100% = u32::MAX, 50% = u32::MAX/2, etc." + ], + "type": "u32" + }, + { + "name": "_padding1", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "BankConfigCompact", + "docs": [ + "TODO: Convert weights to (u64, u64) to avoid precision loss (maybe?)" + ], + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "asset_weight_init", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "asset_weight_maint", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_weight_init", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_weight_maint", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "deposit_limit", + "type": "u64" + }, + { + "name": "interest_rate_config", + "type": { + "defined": { + "name": "InterestRateConfigCompact" + } + } + }, + { + "name": "operational_state", + "type": { + "defined": { + "name": "BankOperationalState" + } + } + }, + { + "name": "borrow_limit", + "type": "u64" + }, + { + "name": "risk_tier", + "type": { + "defined": { + "name": "RiskTier" + } + } + }, + { + "name": "asset_tag", + "docs": [ + "Determines what kinds of assets users of this bank can interact with.", + "Options:", + "* ASSET_TAG_DEFAULT (0) - A regular asset that can be comingled with any other regular asset", + "or with `ASSET_TAG_SOL`", + "* ASSET_TAG_SOL (1) - Accounts with a SOL position can comingle with **either**", + "`ASSET_TAG_DEFAULT` or `ASSET_TAG_STAKED` positions, but not both", + "* ASSET_TAG_STAKED (2) - Staked SOL assets. Accounts with a STAKED position can only deposit", + "other STAKED assets or SOL (`ASSET_TAG_SOL`) and can only borrow SOL" + ], + "type": "u8" + }, + { + "name": "config_flags", + "docs": [ + "Flags for various config options", + "* 1 - Always set if bank created in 0.1.4 or later, or if migrated to the new oracle", + "setup from a prior version. Not set in 0.1.3 or earlier banks that have not yet migrated.", + "* 2, 4, 8, 16, etc - reserved for future use." + ], + "type": "u8" + }, + { + "name": "_pad0", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "total_asset_value_init_limit", + "docs": [ + "USD denominated limit for calculating asset value for initialization margin requirements.", + "Example, if total SOL deposits are equal to $1M and the limit it set to $500K,", + "then SOL assets will be discounted by 50%.", + "", + "In other words the max value of liabilities that can be backed by the asset is $500K.", + "This is useful for limiting the damage of orcale attacks.", + "", + "Value is UI USD value, for example value 100 -> $100" + ], + "type": "u64" + }, + { + "name": "oracle_max_age", + "docs": [ + "Time window in seconds for the oracle price feed to be considered live." + ], + "type": "u16" + }, + { + "name": "oracle_max_confidence", + "docs": [ + "From 0-100%, if the confidence exceeds this value, the oracle is considered invalid. Note:", + "the confidence adjustment is capped at 5% regardless of this value.", + "* 0% = use the default (10%)", + "* A %, as u32, e.g. 100% = u32::MAX, 50% = u32::MAX/2, etc." + ], + "type": "u32" + } + ] + } + }, + { + "name": "BankConfigOpt", + "type": { + "kind": "struct", + "fields": [ + { + "name": "asset_weight_init", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "asset_weight_maint", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "liability_weight_init", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "liability_weight_maint", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "deposit_limit", + "type": { + "option": "u64" + } + }, + { + "name": "borrow_limit", + "type": { + "option": "u64" + } + }, + { + "name": "operational_state", + "type": { + "option": { + "defined": { + "name": "BankOperationalState" + } + } + } + }, + { + "name": "interest_rate_config", + "type": { + "option": { + "defined": { + "name": "InterestRateConfigOpt" + } + } + } + }, + { + "name": "risk_tier", + "type": { + "option": { + "defined": { + "name": "RiskTier" + } + } + } + }, + { + "name": "asset_tag", + "type": { + "option": "u8" + } + }, + { + "name": "total_asset_value_init_limit", + "type": { + "option": "u64" + } + }, + { + "name": "oracle_max_confidence", + "type": { + "option": "u32" + } + }, + { + "name": "oracle_max_age", + "type": { + "option": "u16" + } + }, + { + "name": "permissionless_bad_debt_settlement", + "type": { + "option": "bool" + } + }, + { + "name": "freeze_settings", + "type": { + "option": "bool" + } + } + ] + } + }, + { + "name": "BankOperationalState", + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "Paused" + }, + { + "name": "Operational" + }, + { + "name": "ReduceOnly" + } + ] + } + }, + { + "name": "EditStakedSettingsEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "group", + "type": "pubkey" + }, + { + "name": "settings", + "type": { + "defined": { + "name": "StakedSettingsEditConfig" + } + } + } + ] + } + }, + { + "name": "EmodeConfig", + "docs": [ + "An emode configuration. Each bank has one such configuration, but this may also be the", + "intersection of many configurations (see `reconcile_emode_configs`). For example, the risk", + "engine creates such an intersection from all the emode config of all banks the user is borrowing", + "from." + ], + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "entries", + "type": { + "array": [ + { + "defined": { + "name": "EmodeEntry" + } + }, + 10 + ] + } + } + ] + } + }, + { + "name": "EmodeEntry", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "collateral_bank_emode_tag", + "docs": [ + "emode_tag of the bank(s) whose collateral you wish to treat preferentially." + ], + "type": "u16" + }, + { + "name": "flags", + "docs": [ + "* APPLIES_TO_ISOLATED (1) - (NOT YET IMPLEMENTED) if set, isolated banks with this tag", + "also benefit. If not set, isolated banks continue to offer zero collateral, even if they", + "use this tag.", + "* 2, 4, 8, 16, 32, etc - reserved for future use" + ], + "type": "u8" + }, + { + "name": "pad0", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "asset_weight_init", + "docs": [ + "Note: If set below the collateral bank's weight, does nothing." + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "asset_weight_maint", + "docs": [ + "Note: If set below the collateral bank's weight, does nothing." + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + } + ] + } + }, + { + "name": "EmodeSettings", + "docs": [ + "Controls the bank's e-mode configuration, allowing certain collateral sources to be treated more", + "favorably as collateral when used to borrow from this bank." + ], + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "emode_tag", + "docs": [ + "This bank's NON-unique id that other banks will use to determine what emode rate to use when", + "this bank is offered as collateral.", + "", + "For example, all stablecoin banks might share the same emode_tag, and in their entries, each", + "such stablecoin bank will recognize that collateral sources with this \"stable\" tag get", + "preferential weights. When a new stablecoin is added that is considered riskier, it may get", + "a new, less favorable emode tag, and eventually get upgraded to the same one as the other", + "stables", + "", + "* 0 is in an invalid tag and will do nothing." + ], + "type": "u16" + }, + { + "name": "pad0", + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "timestamp", + "docs": [ + "Unix timestamp from the system clock when emode state was last updated" + ], + "type": "i64" + }, + { + "name": "flags", + "docs": [ + "* EMODE_ON (1) - If set, at least one entry is configured. Never update this flag manually,", + "it should always be equivalent to `EmodeConfig.has_entries`", + "* 2, 4, 8, etc, Reserved for future use" + ], + "type": "u64" + }, + { + "name": "emode_config", + "type": { + "defined": { + "name": "EmodeConfig" + } + } + } + ] + } + }, + { + "name": "FeeState", + "docs": [ + "Unique per-program. The Program Owner uses this account to administrate fees collected by the protocol" + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "key", + "docs": [ + "The fee state's own key. A PDA derived from just `b\"feestate\"`" + ], + "type": "pubkey" + }, + { + "name": "global_fee_admin", + "docs": [ + "Can modify fees" + ], + "type": "pubkey" + }, + { + "name": "global_fee_wallet", + "docs": [ + "The base wallet for all protocol fees. All SOL fees go to this wallet. All non-SOL fees go", + "to the canonical ATA of this wallet for that asset." + ], + "type": "pubkey" + }, + { + "name": "placeholder0", + "type": "u64" + }, + { + "name": "bank_init_flat_sol_fee", + "docs": [ + "Flat fee assessed when a new bank is initialized, in lamports.", + "* In SOL, in native decimals." + ], + "type": "u32" + }, + { + "name": "bump_seed", + "type": "u8" + }, + { + "name": "_padding0", + "type": { + "array": [ + "u8", + 4 + ] + } + }, + { + "name": "_padding1", + "type": { + "array": [ + "u8", + 15 + ] + } + }, + { + "name": "program_fee_fixed", + "docs": [ + "Fee collected by the program owner from all groups" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "program_fee_rate", + "docs": [ + "Fee collected by the program owner from all groups" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "_reserved0", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "_reserved1", + "type": { + "array": [ + "u8", + 64 + ] + } + } + ] + } + }, + { + "name": "FeeStateCache", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "global_fee_wallet", + "type": "pubkey" + }, + { + "name": "program_fee_fixed", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "program_fee_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "last_update", + "type": "i64" + } + ] + } + }, + { + "name": "GroupEventHeader", + "type": { + "kind": "struct", + "fields": [ + { + "name": "signer", + "type": { + "option": "pubkey" + } + }, + { + "name": "marginfi_group", + "type": "pubkey" + } + ] + } + }, + { + "name": "HealthCache", + "docs": [ + "A read-only cache of the internal risk engine's information. Only valid in borrow/withdraw if", + "the tx does not fail. To see the state in any context, e.g. to figure out if the risk engine is", + "failing due to some bad price information, use `pulse_health`." + ], + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "asset_value", + "docs": [ + "Internal risk engine asset value, using initial weight (e.g. what is used for borrowing", + "purposes), with all confidence adjustments, and other discounts on price.", + "* Uses EMA price", + "* In dollars" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_value", + "docs": [ + "Internal risk engine liability value, using initial weight (e.g. what is used for borrowing", + "purposes), with all confidence adjustments, and other discounts on price.", + "* Uses EMA price", + "* In dollars" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "asset_value_maint", + "docs": [ + "Internal risk engine asset value, using maintenance weight (e.g. what is used for", + "liquidation purposes), with all confidence adjustments.", + "* Zero if the risk engine failed to load", + "* Uses SPOT price", + "* In dollars" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_value_maint", + "docs": [ + "Internal risk engine liability value, using maintenance weight (e.g. what is used for", + "liquidation purposes), with all confidence adjustments.", + "* Zero if the risk engine failed to load", + "* Uses SPOT price", + "* In dollars" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "asset_value_equity", + "docs": [ + "The \"true\" value of assets without any confidence or weight adjustments. Internally, used", + "only for bankruptcies.", + "* Zero if the risk engine failed to load", + "* Uses EMA price", + "* In dollars" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "liability_value_equity", + "docs": [ + "The \"true\" value of liabilities without any confidence or weight adjustments.", + "Internally, used only for bankruptcies.", + "* Zero if the risk engine failed to load", + "* Uses EMA price", + "* In dollars" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "timestamp", + "docs": [ + "Unix timestamp from the system clock when this cache was last updated" + ], + "type": "i64" + }, + { + "name": "flags", + "docs": [ + "The flags that indicate the state of the health cache. This is a u64 bitfield, where each", + "bit represents a flag.", + "", + "* HEALTHY = 1 - If set, the account cannot be liquidated. If 0, the account is unhealthy and", + "can be liquidated.", + "* ENGINE STATUS = 2 - If set, the engine did not error during the last health pulse. If 0,", + "the engine would have errored and this cache is likely invalid. `RiskEngineInitRejected`", + "is ignored and will allow the flag to be set anyways.", + "* ORACLE OK = 4 - If set, the engine did not error due to an oracle issue. If 0, engine was", + "passed a bad bank or oracle account, or an oracle was stale. Check the order in which", + "accounts were passed and ensure each balance has the correct banks/oracles, and that", + "oracle cranks ran recently enough. Check `internal_err` and `err_index` for more details", + "in some circumstances. Invalid if generated after borrow/withdraw (these instructions will", + "ignore oracle issues if health is still satisfactory with some balance zeroed out).", + "* 8, 16, 32, 64, 128, etc - reserved for future use" + ], + "type": "u32" + }, + { + "name": "mrgn_err", + "docs": [ + "If the engine errored, look here for the error code. If the engine returns ok, you may also", + "check here to see if the risk engine rejected this tx (3009)." + ], + "type": "u32" + }, + { + "name": "prices", + "docs": [ + "Each price corresponds to that index of Balances in the LendingAccount. Useful for debugging", + "or liquidator consumption, to determine how a user's position is priced internally.", + "* An f64 stored as bytes" + ], + "type": { + "array": [ + { + "array": [ + "u8", + 8 + ] + }, + 16 + ] + } + }, + { + "name": "internal_err", + "docs": [ + "Errors in asset oracles are ignored (with prices treated as zero). If you see a zero price", + "and the `ORACLE_OK` flag is not set, check here to see what error was ignored internally." + ], + "type": "u32" + }, + { + "name": "err_index", + "docs": [ + "Index in `balances` where `internal_err` appeared" + ], + "type": "u8" + }, + { + "name": "program_version", + "docs": [ + "Since 0.1.3, the version will be encoded here. See PROGRAM_VERSION." + ], + "type": "u8" + }, + { + "name": "pad0", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "internal_liq_err", + "type": "u32" + }, + { + "name": "internal_bankruptcy_err", + "type": "u32" + }, + { + "name": "reserved0", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "reserved1", + "type": { + "array": [ + "u8", + 16 + ] + } + } + ] + } + }, + { + "name": "HealthPulseEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "account", + "type": "pubkey" + }, + { + "name": "health_cache", + "type": { + "defined": { + "name": "HealthCache" + } + } + } + ] + } + }, + { + "name": "InterestRateConfig", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "optimal_utilization_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "plateau_interest_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "max_interest_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "insurance_fee_fixed_apr", + "docs": [ + "Goes to insurance, funds `collected_insurance_fees_outstanding`" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "insurance_ir_fee", + "docs": [ + "Goes to insurance, funds `collected_insurance_fees_outstanding`" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "protocol_fixed_fee_apr", + "docs": [ + "Earned by the group, goes to `collected_group_fees_outstanding`" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "protocol_ir_fee", + "docs": [ + "Earned by the group, goes to `collected_group_fees_outstanding`" + ], + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "protocol_origination_fee", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "_padding0", + "type": { + "array": [ + "u8", + 16 + ] + } + }, + { + "name": "_padding1", + "type": { + "array": [ + { + "array": [ + "u8", + 32 + ] + }, + 3 + ] + } + } + ] + } + }, + { + "name": "InterestRateConfigCompact", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "optimal_utilization_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "plateau_interest_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "max_interest_rate", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "insurance_fee_fixed_apr", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "insurance_ir_fee", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "protocol_fixed_fee_apr", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "protocol_ir_fee", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "protocol_origination_fee", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + } + ] + } + }, + { + "name": "InterestRateConfigOpt", + "type": { + "kind": "struct", + "fields": [ + { + "name": "optimal_utilization_rate", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "plateau_interest_rate", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "max_interest_rate", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "insurance_fee_fixed_apr", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "insurance_ir_fee", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "protocol_fixed_fee_apr", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "protocol_ir_fee", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "protocol_origination_fee", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + } + ] + } + }, + { + "name": "LendingAccount", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "balances", + "type": { + "array": [ + { + "defined": { + "name": "Balance" + } + }, + 16 + ] + } + }, + { + "name": "_padding", + "type": { + "array": [ + "u64", + 8 + ] + } + } + ] + } + }, + { + "name": "LendingAccountBorrowEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "LendingAccountDepositEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "LendingAccountLiquidateEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + }, + { + "name": "liquidatee_marginfi_account", + "type": "pubkey" + }, + { + "name": "liquidatee_marginfi_account_authority", + "type": "pubkey" + }, + { + "name": "asset_bank", + "type": "pubkey" + }, + { + "name": "asset_mint", + "type": "pubkey" + }, + { + "name": "liability_bank", + "type": "pubkey" + }, + { + "name": "liability_mint", + "type": "pubkey" + }, + { + "name": "liquidatee_pre_health", + "type": "f64" + }, + { + "name": "liquidatee_post_health", + "type": "f64" + }, + { + "name": "pre_balances", + "type": { + "defined": { + "name": "LiquidationBalances" + } + } + }, + { + "name": "post_balances", + "type": { + "defined": { + "name": "LiquidationBalances" + } + } + } + ] + } + }, + { + "name": "LendingAccountRepayEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "close_balance", + "type": "bool" + } + ] + } + }, + { + "name": "LendingAccountWithdrawEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "close_balance", + "type": "bool" + } + ] + } + }, + { + "name": "LendingPoolBankAccrueInterestEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "delta", + "type": "u64" + }, + { + "name": "fees_collected", + "type": "f64" + }, + { + "name": "insurance_collected", + "type": "f64" + } + ] + } + }, + { + "name": "LendingPoolBankCollectFeesEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "group_fees_collected", + "type": "f64" + }, + { + "name": "group_fees_outstanding", + "type": "f64" + }, + { + "name": "insurance_fees_collected", + "type": "f64" + }, + { + "name": "insurance_fees_outstanding", + "type": "f64" + } + ] + } + }, + { + "name": "LendingPoolBankConfigureEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "config", + "type": { + "defined": { + "name": "BankConfigOpt" + } + } + } + ] + } + }, + { + "name": "LendingPoolBankConfigureFrozenEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "deposit_limit", + "type": "u64" + }, + { + "name": "borrow_limit", + "type": "u64" + } + ] + } + }, + { + "name": "LendingPoolBankConfigureOracleEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "oracle_setup", + "type": "u8" + }, + { + "name": "oracle", + "type": "pubkey" + } + ] + } + }, + { + "name": "LendingPoolBankCreateEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "LendingPoolBankHandleBankruptcyEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + }, + { + "name": "bank", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bad_debt", + "type": "f64" + }, + { + "name": "covered_amount", + "type": "f64" + }, + { + "name": "socialized_amount", + "type": "f64" + } + ] + } + }, + { + "name": "LiquidationBalances", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liquidatee_asset_balance", + "type": "f64" + }, + { + "name": "liquidatee_liability_balance", + "type": "f64" + }, + { + "name": "liquidator_asset_balance", + "type": "f64" + }, + { + "name": "liquidator_liability_balance", + "type": "f64" + } + ] + } + }, + { + "name": "MarginfiAccount", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "group", + "type": "pubkey" + }, + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "lending_account", + "type": { + "defined": { + "name": "LendingAccount" + } + } + }, + { + "name": "account_flags", + "docs": [ + "The flags that indicate the state of the account. This is u64 bitfield, where each bit", + "represents a flag.", + "", + "Flags:MarginfiAccount", + "- 1: `ACCOUNT_DISABLED` - Indicates that the account is disabled and no further actions can", + "be taken on it.", + "- 2: `ACCOUNT_IN_FLASHLOAN` - Only set when an account is within a flash loan, e.g. when", + "start_flashloan is called, then unset when the flashloan ends.", + "- 4: `ACCOUNT_FLAG_DEPRECATED` - Deprecated, available for future use", + "- 8: `ACCOUNT_TRANSFER_AUTHORITY_ALLOWED` - the admin has flagged with account to be moved,", + "original owner can now call `set_account_transfer_authority`" + ], + "type": "u64" + }, + { + "name": "emissions_destination_account", + "docs": [ + "Set with `update_emissions_destination_account`. Emissions rewards can be withdrawn to the", + "canonical ATA of this wallet without the user's input (withdraw_emissions_permissionless).", + "If pubkey default, the user has not opted into this feature, and must claim emissions", + "manually (withdraw_emissions)." + ], + "type": "pubkey" + }, + { + "name": "migrated_from", + "docs": [ + "If this account was migrated from another one, store the original account key" + ], + "type": "pubkey" + }, + { + "name": "health_cache", + "type": { + "defined": { + "name": "HealthCache" + } + } + }, + { + "name": "_padding0", + "type": { + "array": [ + "u64", + 17 + ] + } + } + ] + } + }, + { + "name": "MarginfiAccountCreateEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + } + ] + } + }, + { + "name": "MarginfiAccountTransferToNewAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "AccountEventHeader" + } + } + }, + { + "name": "old_account", + "type": "pubkey" + }, + { + "name": "old_account_authority", + "type": "pubkey" + }, + { + "name": "new_account_authority", + "type": "pubkey" + } + ] + } + }, + { + "name": "MarginfiGroup", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "admin", + "docs": [ + "Broadly able to modify anything, and can set/remove other admins at will." + ], + "type": "pubkey" + }, + { + "name": "group_flags", + "docs": [ + "Bitmask for group settings flags.", + "* 0: `PROGRAM_FEES_ENABLED` If set, program-level fees are enabled.", + "* 1: `ARENA_GROUP` If set, this is an arena group, which can only have two banks", + "* Bits 1-63: Reserved for future use." + ], + "type": "u64" + }, + { + "name": "fee_state_cache", + "docs": [ + "Caches information from the global `FeeState` so the FeeState can be omitted on certain ixes" + ], + "type": { + "defined": { + "name": "FeeStateCache" + } + } + }, + { + "name": "banks", + "type": "u16" + }, + { + "name": "pad0", + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "emode_admin", + "docs": [ + "This admin can configure collateral ratios above (but not below) the collateral ratio of", + "certain banks , e.g. allow SOL to count as 90% collateral when borrowing an LST instead of", + "the default rate." + ], + "type": "pubkey" + }, + { + "name": "delegate_curve_admin", + "docs": [ + "Can modify the fields in `config.interest_rate_config` but nothing else, for every bank under", + "this group" + ], + "type": "pubkey" + }, + { + "name": "delegate_limit_admin", + "docs": [ + "Can modify the `deposit_limit`, `borrow_limit`, `total_asset_value_init_limit` but nothing", + "else, for every bank under this group" + ], + "type": "pubkey" + }, + { + "name": "delegate_emissions_admin", + "docs": [ + "Can modify the emissions `flags`, `emissions_rate` and `emissions_mint`, but nothing else,", + "for every bank under this group" + ], + "type": "pubkey" + }, + { + "name": "_padding_0", + "type": { + "array": [ + { + "array": [ + "u64", + 2 + ] + }, + 18 + ] + } + }, + { + "name": "_padding_1", + "type": { + "array": [ + { + "array": [ + "u64", + 2 + ] + }, + 32 + ] + } + }, + { + "name": "_padding_4", + "type": "u64" + } + ] + } + }, + { + "name": "MarginfiGroupConfigureEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "flags", + "type": "u64" + } + ] + } + }, + { + "name": "MarginfiGroupCreateEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "header", + "type": { + "defined": { + "name": "GroupEventHeader" + } + } + } + ] + } + }, + { + "name": "OracleSetup", + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "None" + }, + { + "name": "PythLegacy" + }, + { + "name": "SwitchboardV2" + }, + { + "name": "PythPushOracle" + }, + { + "name": "SwitchboardPull" + }, + { + "name": "StakedWithPythPush" + } + ] + } + }, + { + "name": "RiskTier", + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "Collateral" + }, + { + "name": "Isolated" + } + ] + } + }, + { + "name": "StakedSettings", + "docs": [ + "Unique per-group. Staked Collateral banks created under a group automatically use these", + "settings. Groups that have not created this struct cannot create staked collateral banks. When", + "this struct updates, changes must be permissionlessly propogated to staked collateral banks.", + "Administrators can also edit the bank manually, i.e. with configure_bank, to temporarily make", + "changes such as raising the deposit limit for a single bank." + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "key", + "docs": [ + "This account's own key. A PDA derived from `marginfi_group` and `STAKED_SETTINGS_SEED`" + ], + "type": "pubkey" + }, + { + "name": "marginfi_group", + "docs": [ + "Group for which these settings apply" + ], + "type": "pubkey" + }, + { + "name": "oracle", + "docs": [ + "Generally, the Pyth push oracle for SOL" + ], + "type": "pubkey" + }, + { + "name": "asset_weight_init", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "asset_weight_maint", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "deposit_limit", + "type": "u64" + }, + { + "name": "total_asset_value_init_limit", + "type": "u64" + }, + { + "name": "oracle_max_age", + "type": "u16" + }, + { + "name": "risk_tier", + "type": { + "defined": { + "name": "RiskTier" + } + } + }, + { + "name": "_pad0", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "_reserved0", + "docs": [ + "The following values are irrelevant because staked collateral positions do not support", + "borrowing." + ], + "type": { + "array": [ + "u8", + 8 + ] + } + }, + { + "name": "_reserved1", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "_reserved2", + "type": { + "array": [ + "u8", + 64 + ] + } + } + ] + } + }, + { + "name": "StakedSettingsConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "oracle", + "type": "pubkey" + }, + { + "name": "asset_weight_init", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "asset_weight_maint", + "type": { + "defined": { + "name": "WrappedI80F48" + } + } + }, + { + "name": "deposit_limit", + "type": "u64" + }, + { + "name": "total_asset_value_init_limit", + "type": "u64" + }, + { + "name": "oracle_max_age", + "type": "u16" + }, + { + "name": "risk_tier", + "docs": [ + "WARN: You almost certainly want \"Collateral\", using Isolated risk tier makes the asset", + "worthless as collateral, and is generally useful only when creating a staked collateral pool", + "for rewards purposes only." + ], + "type": { + "defined": { + "name": "RiskTier" + } + } + } + ] + } + }, + { + "name": "StakedSettingsEditConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "oracle", + "type": { + "option": "pubkey" + } + }, + { + "name": "asset_weight_init", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "asset_weight_maint", + "type": { + "option": { + "defined": { + "name": "WrappedI80F48" + } + } + } + }, + { + "name": "deposit_limit", + "type": { + "option": "u64" + } + }, + { + "name": "total_asset_value_init_limit", + "type": { + "option": "u64" + } + }, + { + "name": "oracle_max_age", + "type": { + "option": "u16" + } + }, + { + "name": "risk_tier", + "docs": [ + "WARN: You almost certainly want \"Collateral\", using Isolated risk tier makes the asset", + "worthless as collateral, making all outstanding accounts eligible to be liquidated, and is", + "generally useful only when creating a staked collateral pool for rewards purposes only." + ], + "type": { + "option": { + "defined": { + "name": "RiskTier" + } + } + } + } + ] + } + }, + { + "name": "WrappedI80F48", + "serialization": "bytemuck", + "repr": { + "kind": "c", + "align": 8 + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "value", + "type": { + "array": [ + "u8", + 16 + ] + } + } + ] + } + } + ] +} \ No newline at end of file