{
  "address": "G1NTLoPS5orMCxgFjzNDE5H6c3AbxiU1DgqCJBaJ1pfM",
  "metadata": {
    "name": "ext_loopscale",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Loopscale integration for GLAM Protocol"
  },
  "instructions": [
    {
      "name": "borrow_principal",
      "docs": [
        "Borrow principal against a locked loan.",
        "",
        "- Permission: `BorrowPermissions::BorrowPrincipal`.",
        "- Policy:",
        "- `principal_mint` must be present in `BorrowPolicy::principal_allowlist`.",
        "- If `market_information` has a `BorrowPolicy::market_policies` entry,",
        "advanced per-market borrow limits are enforced."
      ],
      "discriminator": [
        106,
        10,
        38,
        204,
        139,
        188,
        124,
        50
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "market_information",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "borrower_ta",
          "writable": true
        },
        {
          "name": "strategy_ta",
          "writable": true
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "token_program"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "BorrowPrincipalParams"
            }
          }
        }
      ]
    },
    {
      "name": "claim_vault_rewards",
      "docs": [
        "Claim rewards accrued by a Loopscale VaultStake account.",
        "",
        "- Permission: `VaultPermissions::ClaimVaultRewards`.",
        "- Policy: `vault` must be present in `VaultPolicy::vault_allowlist`."
      ],
      "discriminator": [
        0,
        152,
        75,
        29,
        195,
        223,
        12,
        101
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "vault"
        },
        {
          "name": "vault_rewards_info",
          "writable": true
        },
        {
          "name": "user_rewards_info",
          "writable": true
        },
        {
          "name": "stake_account",
          "writable": true
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "mints",
          "type": {
            "vec": "pubkey"
          }
        }
      ]
    },
    {
      "name": "close_loan",
      "docs": [
        "Close an existing Loopscale loan PDA.",
        "",
        "- Permission: `BorrowPermissions::CloseLoan`."
      ],
      "discriminator": [
        96,
        114,
        111,
        204,
        149,
        228,
        235,
        124
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": []
    },
    {
      "name": "close_strategy",
      "docs": [
        "Close a Loopscale lender strategy account.",
        "",
        "- Permission: `LendingPermissions::CloseStrategy`."
      ],
      "discriminator": [
        56,
        247,
        170,
        246,
        89,
        221,
        134,
        200
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": []
    },
    {
      "name": "create_loan",
      "docs": [
        "Create a new Loopscale loan PDA owned by the GLAM vault.",
        "",
        "- Permission: `BorrowPermissions::CreateLoan`."
      ],
      "discriminator": [
        166,
        131,
        118,
        219,
        138,
        218,
        206,
        140
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "CreateLoanParams"
            }
          }
        }
      ]
    },
    {
      "name": "create_strategy",
      "docs": [
        "Create a new Loopscale lender strategy owned by the GLAM vault.",
        "",
        "- Permission: `LendingPermissions::CreateStrategy`.",
        "- Policy:",
        "- `principal_mint` must be present in `LendingPolicy::principal_allowlist`.",
        "- If `market_information` has a `LendingPolicy::market_policies` entry,",
        "advanced per-market lending limits are enforced.",
        "- `params.lender` must equal the GLAM vault."
      ],
      "discriminator": [
        152,
        160,
        107,
        148,
        245,
        190,
        127,
        224
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "nonce",
          "signer": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "market_information"
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "CreateStrategyParams"
            }
          }
        }
      ]
    },
    {
      "name": "deposit_collateral",
      "docs": [
        "Deposit collateral into a Loopscale loan.",
        "",
        "- Permission: `BorrowPermissions::DepositCollateral`.",
        "- Policy:",
        "- `deposit_mint` must be present in `BorrowPolicy::collateral_allowlist`."
      ],
      "discriminator": [
        156,
        131,
        142,
        116,
        146,
        247,
        162,
        120
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "borrower_collateral_ta",
          "writable": true
        },
        {
          "name": "loan_collateral_ta",
          "writable": true
        },
        {
          "name": "deposit_mint"
        },
        {
          "name": "asset_identifier"
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "DepositCollateralParams"
            }
          }
        }
      ]
    },
    {
      "name": "deposit_strategy",
      "docs": [
        "Deposit principal liquidity into a Loopscale lender strategy.",
        "",
        "- Permission: `LendingPermissions::DepositStrategy`.",
        "- Policy:",
        "- `principal_mint` must be present in `LendingPolicy::principal_allowlist`.",
        "- If `market_information` has a `LendingPolicy::market_policies` entry,",
        "advanced per-market lending limits are enforced."
      ],
      "discriminator": [
        246,
        82,
        57,
        226,
        131,
        222,
        253,
        249
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "market_information"
        },
        {
          "name": "lender_ta",
          "writable": true
        },
        {
          "name": "strategy_ta",
          "writable": true
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "deposit_user_vault",
      "docs": [
        "Deposit principal into a Loopscale user vault and receive Token-2022 LP tokens.",
        "",
        "- Permission: `VaultPermissions::DepositUserVault`.",
        "- Policy: `vault` must be present in `VaultPolicy::vault_allowlist`."
      ],
      "discriminator": [
        204,
        190,
        182,
        224,
        15,
        219,
        247,
        121
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "market_information"
        },
        {
          "name": "lp_mint",
          "writable": true
        },
        {
          "name": "user_lp_ta",
          "writable": true
        },
        {
          "name": "user_principal_ta",
          "writable": true
        },
        {
          "name": "strategy_principal_ta",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "principal_token_program"
        },
        {
          "name": "token_2022_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "LpParams"
            }
          }
        }
      ]
    },
    {
      "name": "repay_principal",
      "docs": [
        "Repay principal on a Loopscale loan.",
        "",
        "- Permission: `BorrowPermissions::RepayPrincipal`."
      ],
      "discriminator": [
        229,
        67,
        83,
        65,
        77,
        84,
        80,
        141
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "market_information",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "borrower_ta",
          "writable": true
        },
        {
          "name": "strategy_ta",
          "writable": true
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "token_program"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "RepayPrincipalParams"
            }
          }
        }
      ]
    },
    {
      "name": "sell_ledger",
      "docs": [
        "Sell a loan ledger from one strategy to another.",
        "",
        "- Permission: `LendingPermissions::SellLedger`.",
        "- Policy:",
        "- `principal_mint` must be present in `LendingPolicy::principal_allowlist`.",
        "- If the new strategy market account has a `LendingPolicy::market_policies` entry,",
        "advanced exposure limits are enforced."
      ],
      "discriminator": [
        55,
        17,
        153,
        148,
        120,
        242,
        80,
        5
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "new_strategy_ta",
          "writable": true
        },
        {
          "name": "lender_auth_ta",
          "writable": true
        },
        {
          "name": "old_strategy",
          "writable": true
        },
        {
          "name": "new_strategy",
          "writable": true
        },
        {
          "name": "old_strategy_market_information",
          "writable": true
        },
        {
          "name": "new_strategy_market_information",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "user_vault"
        },
        {
          "name": "old_strategy_ta"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "SellLedgerParams"
            }
          }
        }
      ]
    },
    {
      "name": "set_borrow_policy",
      "docs": [
        "Set the Loopscale borrow policy (collateral allowlist and market policies).",
        "",
        "- Permission: `BorrowPermissions::SetPolicy`."
      ],
      "discriminator": [
        199,
        94,
        106,
        205,
        150,
        227,
        206,
        68
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "integration_program",
          "address": "G1NTLoPS5orMCxgFjzNDE5H6c3AbxiU1DgqCJBaJ1pfM"
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "policy",
          "type": {
            "defined": {
              "name": "BorrowPolicy"
            }
          }
        }
      ]
    },
    {
      "name": "set_lending_policy",
      "docs": [
        "Set the Loopscale lending policy (allowlists, market policies, and sell-ledger limits).",
        "",
        "- Permission: `LendingPermissions::SetPolicy`."
      ],
      "discriminator": [
        226,
        185,
        23,
        3,
        113,
        88,
        118,
        176
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "integration_program",
          "address": "G1NTLoPS5orMCxgFjzNDE5H6c3AbxiU1DgqCJBaJ1pfM"
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "policy",
          "type": {
            "defined": {
              "name": "LendingPolicy"
            }
          }
        }
      ]
    },
    {
      "name": "set_vault_policy",
      "docs": [
        "Set the Loopscale vault policy (vault allowlist).",
        "",
        "- Permission: `VaultPermissions::SetPolicy`."
      ],
      "discriminator": [
        184,
        31,
        142,
        18,
        106,
        143,
        184,
        158
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "integration_program",
          "address": "G1NTLoPS5orMCxgFjzNDE5H6c3AbxiU1DgqCJBaJ1pfM"
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "policy",
          "type": {
            "defined": {
              "name": "VaultPolicy"
            }
          }
        }
      ]
    },
    {
      "name": "stake_user_vault_lp",
      "docs": [
        "Stake Loopscale user vault LP tokens into a VaultStake account.",
        "",
        "- Permission: `VaultPermissions::StakeUserVaultLp`.",
        "- Policy: `vault` must be present in `VaultPolicy::vault_allowlist`."
      ],
      "discriminator": [
        114,
        132,
        194,
        209,
        208,
        149,
        43,
        136
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "nonce",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "vault_stake",
          "writable": true
        },
        {
          "name": "lp_mint"
        },
        {
          "name": "user_lp_ta",
          "writable": true
        },
        {
          "name": "vault_stake_lp_ta",
          "writable": true
        },
        {
          "name": "vault_rewards_info",
          "writable": true
        },
        {
          "name": "user_rewards_info",
          "writable": true
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "VaultStakeParams"
            }
          }
        }
      ]
    },
    {
      "name": "unstake_user_vault_lp",
      "docs": [
        "Unstake Loopscale user vault LP tokens from a VaultStake account.",
        "",
        "- Permission: `VaultPermissions::UnstakeUserVaultLp`.",
        "- Policy: `vault` must be present in `VaultPolicy::vault_allowlist`."
      ],
      "discriminator": [
        83,
        78,
        230,
        123,
        226,
        40,
        158,
        97
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "lp_mint",
          "writable": true
        },
        {
          "name": "vault_stake",
          "writable": true
        },
        {
          "name": "user_lp_ta",
          "writable": true
        },
        {
          "name": "vault_stake_lp_ta",
          "writable": true
        },
        {
          "name": "vault_rewards_info",
          "writable": true
        },
        {
          "name": "user_rewards_info",
          "writable": true
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "VaultUnstakeParams"
            }
          }
        }
      ]
    },
    {
      "name": "update_strategy",
      "docs": [
        "Update a Loopscale lender strategy's terms, caps, and collateral terms.",
        "",
        "- Permission: `LendingPermissions::UpdateStrategy`.",
        "- Policy:",
        "- The strategy market account must be passed as the first remaining account.",
        "- `principal_mint` must be present in `LendingPolicy::principal_allowlist`.",
        "- Collateral term asset identifiers must be present in",
        "`LendingPolicy::collateral_allowlist`.",
        "- If the strategy market account has a `LendingPolicy::market_policies` entry,",
        "advanced per-market lending limits are enforced."
      ],
      "discriminator": [
        16,
        76,
        138,
        179,
        171,
        112,
        196,
        21
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "strategy_ta",
          "writable": true
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "token_program"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "collateral_terms",
          "type": {
            "vec": {
              "defined": {
                "name": "MultiCollateralTermsUpdateParams"
              }
            }
          }
        },
        {
          "name": "params",
          "type": {
            "option": {
              "defined": {
                "name": "UpdateStrategyParams"
              }
            }
          }
        }
      ]
    },
    {
      "name": "update_weight_matrix",
      "docs": [
        "Update the collateral weight matrix on a loan.",
        "",
        "- Permission: `BorrowPermissions::UpdateLoan`."
      ],
      "discriminator": [
        252,
        166,
        37,
        207,
        154,
        83,
        187,
        128
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "protocol_admin_state"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "UpdateWeightMatrixParams"
            }
          }
        }
      ]
    },
    {
      "name": "withdraw_collateral",
      "docs": [
        "Withdraw collateral from a Loopscale loan.",
        "",
        "- Permission: `BorrowPermissions::WithdrawCollateral`."
      ],
      "discriminator": [
        115,
        135,
        168,
        106,
        139,
        214,
        138,
        150
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true
        },
        {
          "name": "borrower_ta",
          "writable": true
        },
        {
          "name": "loan_ta",
          "writable": true
        },
        {
          "name": "asset_mint"
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "WithdrawCollateralParams"
            }
          }
        }
      ]
    },
    {
      "name": "withdraw_strategy",
      "docs": [
        "Withdraw undeployed principal from a Loopscale lender strategy.",
        "",
        "- Permission: `LendingPermissions::WithdrawStrategy`."
      ],
      "discriminator": [
        31,
        45,
        162,
        5,
        193,
        217,
        134,
        188
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "market_information"
        },
        {
          "name": "lender_ta",
          "writable": true
        },
        {
          "name": "strategy_ta",
          "writable": true
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "token_program"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "withdraw_all",
          "type": "bool"
        }
      ]
    },
    {
      "name": "withdraw_user_vault",
      "docs": [
        "Withdraw principal from a Loopscale user vault by burning Token-2022 LP tokens.",
        "",
        "- Permission: `VaultPermissions::WithdrawUserVault`.",
        "- Policy: `vault` must be present in `VaultPolicy::vault_allowlist`."
      ],
      "discriminator": [
        9,
        80,
        134,
        138,
        212,
        20,
        61,
        42
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ],
            "program": {
              "kind": "account",
              "path": "glam_protocol_program"
            }
          }
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "integration_authority",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  105,
                  110,
                  116,
                  101,
                  103,
                  114,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  97,
                  117,
                  116,
                  104,
                  111,
                  114,
                  105,
                  116,
                  121
                ]
              }
            ]
          }
        },
        {
          "name": "cpi_program",
          "address": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "bs_auth",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "strategy",
          "writable": true
        },
        {
          "name": "market_information"
        },
        {
          "name": "lp_mint",
          "writable": true
        },
        {
          "name": "user_lp_ta",
          "writable": true
        },
        {
          "name": "user_principal_ta",
          "writable": true
        },
        {
          "name": "strategy_principal_ta",
          "writable": true
        },
        {
          "name": "principal_mint"
        },
        {
          "name": "principal_token_program"
        },
        {
          "name": "token_2022_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "protocol_admin_state"
        },
        {
          "name": "event_authority"
        }
      ],
      "args": [
        {
          "name": "params",
          "type": {
            "defined": {
              "name": "LpParams"
            }
          }
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "StateAccount",
      "discriminator": [
        142,
        247,
        54,
        95,
        85,
        133,
        249,
        103
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "AutoCloseLoanNotSupported",
      "msg": "Auto-close loan not supported"
    },
    {
      "code": 6001,
      "name": "InvalidVaultTokenAccount",
      "msg": "Vault token account must be the GLAM vault ATA for the expected mint"
    }
  ],
  "types": [
    {
      "name": "AccountType",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Vault"
          },
          {
            "name": "TokenizedVault"
          },
          {
            "name": "Mint"
          },
          {
            "name": "SingleAssetVault"
          }
        ]
      }
    },
    {
      "name": "AccruedFees",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault_subscription_fee",
            "type": "u128"
          },
          {
            "name": "vault_redemption_fee",
            "type": "u128"
          },
          {
            "name": "manager_subscription_fee",
            "type": "u128"
          },
          {
            "name": "manager_redemption_fee",
            "type": "u128"
          },
          {
            "name": "management_fee",
            "type": "u128"
          },
          {
            "name": "performance_fee",
            "type": "u128"
          },
          {
            "name": "protocol_base_fee",
            "type": "u128"
          },
          {
            "name": "protocol_flow_fee",
            "type": "u128"
          }
        ]
      }
    },
    {
      "name": "BorrowMarketPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "market",
            "docs": [
              "Loopscale market information account this policy applies to."
            ],
            "type": "pubkey"
          },
          {
            "name": "max_borrow_amount",
            "docs": [
              "Maximum principal amount that may be borrowed in a single instruction.",
              "A value of zero means no per-instruction borrow is allowed for this market."
            ],
            "type": "u64"
          },
          {
            "name": "max_total_borrow_amount",
            "docs": [
              "Maximum outstanding principal a single loan may owe in this market.",
              "Enforced per loan (summed over that loan's ledgers in this market), not",
              "aggregated across all of the vault's loans in this market. A value of zero",
              "means no outstanding borrow exposure is allowed for this market."
            ],
            "type": "u64"
          },
          {
            "name": "max_ltv_bps",
            "docs": [
              "Maximum expected liquidation LTV threshold, in basis points.",
              "Borrow enforcement compares this to Loopscale's expected LQT values.",
              "A value of zero means no expected liquidation LTV is allowed for this market."
            ],
            "type": "u16"
          },
          {
            "name": "duration_indexes_allowlist",
            "docs": [
              "Duration indexes that may be used when borrowing from this market.",
              "An empty list denies all borrow durations for this market. Index mapping:",
              "- 0 = 1 day",
              "- 1 = 1 week",
              "- 2 = 1 month",
              "- 3 = 3 months",
              "- 4 = 1 year"
            ],
            "type": "bytes"
          }
        ]
      }
    },
    {
      "name": "BorrowPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "collateral_allowlist",
            "docs": [
              "Collateral mints that may be deposited into Loopscale borrow loans."
            ],
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "principal_allowlist",
            "docs": [
              "Principal mints that may be borrowed from Loopscale borrow markets.",
              "An empty list denies all principal borrows."
            ],
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "market_policies",
            "docs": [
              "Optional per-market risk limits for borrow operations.",
              "If a market is present here, advanced per-market limits are enforced.",
              "If absent, borrow operations are governed by the top-level allowlists."
            ],
            "type": {
              "vec": {
                "defined": {
                  "name": "BorrowMarketPolicy"
                }
              }
            }
          }
        ]
      }
    },
    {
      "name": "BorrowPrincipalParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "asset_index_guidance",
            "type": "bytes"
          },
          {
            "name": "duration",
            "type": "u8"
          },
          {
            "name": "expected_loan_values",
            "type": {
              "defined": {
                "name": "ExpectedLoanValues"
              }
            }
          },
          {
            "name": "skip_sol_unwrap",
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "CollateralTermsIndices",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "collateral_index",
            "type": "u8"
          },
          {
            "name": "duration_index",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "CreateLoanParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "nonce",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "CreateStrategyParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "lender",
            "type": "pubkey"
          },
          {
            "name": "origination_cap",
            "type": "u64"
          },
          {
            "name": "liquidity_buffer",
            "type": "u64"
          },
          {
            "name": "interest_fee",
            "type": "u64"
          },
          {
            "name": "origination_fee",
            "type": "u64"
          },
          {
            "name": "principal_fee",
            "type": "u64"
          },
          {
            "name": "originations_enabled",
            "type": "bool"
          },
          {
            "name": "external_yield_source_args",
            "type": {
              "option": {
                "defined": {
                  "name": "ExternalYieldSourceArgs"
                }
              }
            }
          }
        ]
      }
    },
    {
      "name": "CreatedModel",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "key",
            "type": {
              "array": [
                "u8",
                8
              ]
            }
          },
          {
            "name": "created_by",
            "type": "pubkey"
          },
          {
            "name": "created_at",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "DelegateAcl",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "pubkey",
            "type": "pubkey"
          },
          {
            "name": "integration_permissions",
            "type": {
              "vec": {
                "defined": {
                  "name": "IntegrationPermissions"
                }
              }
            }
          },
          {
            "name": "expires_at",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "DepositCollateralParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "asset_type",
            "type": "u8"
          },
          {
            "name": "asset_identifier",
            "type": "pubkey"
          },
          {
            "name": "asset_index_guidance",
            "type": "bytes"
          }
        ]
      }
    },
    {
      "name": "EngineField",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "name",
            "type": {
              "defined": {
                "name": "EngineFieldName"
              }
            }
          },
          {
            "name": "value",
            "type": {
              "defined": {
                "name": "EngineFieldValue"
              }
            }
          }
        ]
      }
    },
    {
      "name": "EngineFieldName",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Owner"
          },
          {
            "name": "PortfolioManagerName"
          },
          {
            "name": "Name"
          },
          {
            "name": "Uri"
          },
          {
            "name": "Assets"
          },
          {
            "name": "DelegateAcls"
          },
          {
            "name": "IntegrationAcls"
          },
          {
            "name": "TimelockDuration"
          },
          {
            "name": "Borrowable"
          },
          {
            "name": "DefaultAccountStateFrozen"
          },
          {
            "name": "PermanentDelegate"
          },
          {
            "name": "NotifyAndSettle"
          },
          {
            "name": "FeeStructure"
          },
          {
            "name": "FeeParams"
          },
          {
            "name": "ClaimableFees"
          },
          {
            "name": "ClaimedFees"
          },
          {
            "name": "OracleConfigs"
          }
        ]
      }
    },
    {
      "name": "EngineFieldValue",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Boolean",
            "fields": [
              {
                "name": "val",
                "type": "bool"
              }
            ]
          },
          {
            "name": "U8",
            "fields": [
              {
                "name": "val",
                "type": "u8"
              }
            ]
          },
          {
            "name": "U32",
            "fields": [
              {
                "name": "val",
                "type": "u32"
              }
            ]
          },
          {
            "name": "U64",
            "fields": [
              {
                "name": "val",
                "type": "u64"
              }
            ]
          },
          {
            "name": "String",
            "fields": [
              {
                "name": "val",
                "type": "string"
              }
            ]
          },
          {
            "name": "Pubkey",
            "fields": [
              {
                "name": "val",
                "type": "pubkey"
              }
            ]
          },
          {
            "name": "VecPubkey",
            "fields": [
              {
                "name": "val",
                "type": {
                  "vec": "pubkey"
                }
              }
            ]
          },
          {
            "name": "VecU8",
            "fields": [
              {
                "name": "val",
                "type": "bytes"
              }
            ]
          },
          {
            "name": "VecU32",
            "fields": [
              {
                "name": "val",
                "type": {
                  "vec": "u32"
                }
              }
            ]
          },
          {
            "name": "VecDelegateAcl",
            "fields": [
              {
                "name": "val",
                "type": {
                  "vec": {
                    "defined": {
                      "name": "DelegateAcl"
                    }
                  }
                }
              }
            ]
          },
          {
            "name": "VecIntegrationAcl",
            "fields": [
              {
                "name": "val",
                "type": {
                  "vec": {
                    "defined": {
                      "name": "IntegrationAcl"
                    }
                  }
                }
              }
            ]
          },
          {
            "name": "FeeStructure",
            "fields": [
              {
                "name": "val",
                "type": {
                  "defined": {
                    "name": "FeeStructure"
                  }
                }
              }
            ]
          },
          {
            "name": "FeeParams",
            "fields": [
              {
                "name": "val",
                "type": {
                  "defined": {
                    "name": "FeeParams"
                  }
                }
              }
            ]
          },
          {
            "name": "AccruedFees",
            "fields": [
              {
                "name": "val",
                "type": {
                  "defined": {
                    "name": "AccruedFees"
                  }
                }
              }
            ]
          },
          {
            "name": "NotifyAndSettle",
            "fields": [
              {
                "name": "val",
                "type": {
                  "defined": {
                    "name": "NotifyAndSettle"
                  }
                }
              }
            ]
          },
          {
            "name": "OracleConfigs",
            "fields": [
              {
                "name": "val",
                "type": {
                  "defined": {
                    "name": "OracleConfigs"
                  }
                }
              }
            ]
          }
        ]
      }
    },
    {
      "name": "EntryExitFees",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "subscription_fee_bps",
            "type": "u16"
          },
          {
            "name": "redemption_fee_bps",
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "ExactInParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount_in",
            "type": "u64"
          },
          {
            "name": "min_amount_out",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "ExactOutParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount_out",
            "type": "u64"
          },
          {
            "name": "max_amount_in",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "ExpectedLoanValues",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "expected_apy",
            "type": "u64"
          },
          {
            "name": "expected_lqt",
            "type": {
              "array": [
                "u32",
                5
              ]
            }
          }
        ]
      }
    },
    {
      "name": "ExternalYieldSourceArgs",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "new_external_yield_source",
            "type": "u8"
          },
          {
            "name": "external_yield_vault",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "FeeParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "year_in_seconds",
            "type": "u32"
          },
          {
            "name": "pa_high_water_mark",
            "type": "i128"
          },
          {
            "name": "pa_last_nav",
            "type": "i128"
          },
          {
            "name": "last_aum",
            "type": "i128"
          },
          {
            "name": "last_performance_fee_crystallized",
            "type": "i64"
          },
          {
            "name": "last_management_fee_crystallized",
            "type": "i64"
          },
          {
            "name": "last_protocol_fee_crystallized",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "FeeStructure",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": {
              "defined": {
                "name": "EntryExitFees"
              }
            }
          },
          {
            "name": "manager",
            "type": {
              "defined": {
                "name": "EntryExitFees"
              }
            }
          },
          {
            "name": "management",
            "type": {
              "defined": {
                "name": "ManagementFee"
              }
            }
          },
          {
            "name": "performance",
            "type": {
              "defined": {
                "name": "PerformanceFee"
              }
            }
          },
          {
            "name": "protocol",
            "type": {
              "defined": {
                "name": "ProtocolFees"
              }
            }
          }
        ]
      }
    },
    {
      "name": "HurdleType",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Hard"
          },
          {
            "name": "Soft"
          }
        ]
      }
    },
    {
      "name": "IntegrationAcl",
      "docs": [
        "An integration program can have multiple protocols supported.",
        "Enabled protocols are stored in a bitmask, and each protocol can have its own policy."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "integration_program",
            "type": "pubkey"
          },
          {
            "name": "protocols_bitmask",
            "type": "u16"
          },
          {
            "name": "protocol_policies",
            "type": {
              "vec": {
                "defined": {
                  "name": "ProtocolPolicy"
                }
              }
            }
          }
        ]
      }
    },
    {
      "name": "IntegrationPermissions",
      "docs": [
        "Stores delegate permissions for an integration program."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "integration_program",
            "type": "pubkey"
          },
          {
            "name": "protocol_permissions",
            "type": {
              "vec": {
                "defined": {
                  "name": "ProtocolPermissions"
                }
              }
            }
          }
        ]
      }
    },
    {
      "name": "LendingMarketPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "market",
            "docs": [
              "Loopscale market information account this policy applies to."
            ],
            "type": "pubkey"
          },
          {
            "name": "max_deposit_amount",
            "docs": [
              "Maximum principal amount that may be deposited in a single instruction.",
              "A value of zero means no per-instruction deposit is allowed for this market."
            ],
            "type": "u64"
          },
          {
            "name": "max_total_deposit_amount",
            "docs": [
              "Maximum principal exposure (token balance + deployed amount) a single",
              "strategy may hold in this market. Enforced per strategy, not aggregated",
              "across all of the vault's strategies in this market. A value of zero means",
              "no lending exposure is allowed for this market."
            ],
            "type": "u64"
          },
          {
            "name": "min_loan_apy_cbps",
            "docs": [
              "Minimum accepted loan APY, in centibasis points, for strategy terms in this market."
            ],
            "type": "u32"
          },
          {
            "name": "max_ltv_bps",
            "docs": [
              "Maximum accepted borrower loan-to-value, in basis points, for strategy terms in this market.",
              "A value of zero means no borrower LTV is allowed for this market."
            ],
            "type": "u16"
          },
          {
            "name": "duration_indexes_allowlist",
            "docs": [
              "Duration indexes that may be offered by vault-owned strategies in this market.",
              "An empty list denies all lending durations for this market. Index mapping:",
              "- 0 = 1 day",
              "- 1 = 1 week",
              "- 2 = 1 month",
              "- 3 = 3 months",
              "- 4 = 1 year"
            ],
            "type": "bytes"
          },
          {
            "name": "collateral_asset_allowlist",
            "docs": [
              "Collateral asset identifiers that vault-owned strategies may accept in this market.",
              "An empty list denies all strategy collateral assets for this market."
            ],
            "type": {
              "vec": "pubkey"
            }
          }
        ]
      }
    },
    {
      "name": "LendingPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "principal_allowlist",
            "docs": [
              "Principal mints that may be lent into Loopscale strategies.",
              "An empty list denies all strategy creation, updates, deposits, and ledger sales."
            ],
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "collateral_allowlist",
            "docs": [
              "Collateral asset identifiers that vault-owned strategies may accept.",
              "An empty list denies all strategy collateral assets."
            ],
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "market_policies",
            "docs": [
              "Optional per-market risk limits for strategy creation, updates, deposits, and ledger sales.",
              "If a market is present here, advanced per-market limits are enforced.",
              "If absent, lending operations are governed by top-level allowlists,",
              "permission checks, and sell-ledger limits."
            ],
            "type": {
              "vec": {
                "defined": {
                  "name": "LendingMarketPolicy"
                }
              }
            }
          },
          {
            "name": "sell_ledger_policy",
            "docs": [
              "Risk limits for selling Loopscale loan ledgers."
            ],
            "type": {
              "defined": {
                "name": "SellLedgerPolicy"
              }
            }
          }
        ]
      }
    },
    {
      "name": "LpParams",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "ExactIn",
            "fields": [
              {
                "defined": {
                  "name": "ExactInParams"
                }
              }
            ]
          },
          {
            "name": "ExactOut",
            "fields": [
              {
                "defined": {
                  "name": "ExactOutParams"
                }
              }
            ]
          }
        ]
      }
    },
    {
      "name": "ManagementFee",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "fee_bps",
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "MultiCollateralTermsUpdateParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "apy",
            "type": "u64"
          },
          {
            "name": "indices",
            "type": {
              "vec": {
                "defined": {
                  "name": "CollateralTermsIndices"
                }
              }
            }
          }
        ]
      }
    },
    {
      "name": "NoticePeriodType",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Hard"
          },
          {
            "name": "Soft"
          }
        ]
      }
    },
    {
      "name": "NotifyAndSettle",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "model",
            "type": {
              "defined": {
                "name": "ValuationModel"
              }
            }
          },
          {
            "name": "permissionless_fulfillment",
            "type": "bool"
          },
          {
            "name": "subscribe_notice_period_type",
            "type": {
              "defined": {
                "name": "NoticePeriodType"
              }
            }
          },
          {
            "name": "subscribe_notice_period",
            "type": "u64"
          },
          {
            "name": "subscribe_settlement_period",
            "type": "u64"
          },
          {
            "name": "subscribe_cancellation_window",
            "type": "u64"
          },
          {
            "name": "redeem_notice_period_type",
            "type": {
              "defined": {
                "name": "NoticePeriodType"
              }
            }
          },
          {
            "name": "redeem_notice_period",
            "type": "u64"
          },
          {
            "name": "redeem_settlement_period",
            "type": "u64"
          },
          {
            "name": "redeem_cancellation_window",
            "type": "u64"
          },
          {
            "name": "time_unit",
            "type": {
              "defined": {
                "name": "TimeUnit"
              }
            }
          },
          {
            "name": "_padding",
            "type": {
              "array": [
                "u8",
                3
              ]
            }
          }
        ]
      }
    },
    {
      "name": "OracleConfigs",
      "docs": [
        "Vault-specific oracle configs. If available, these configs are preferred over the global config."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "max_ages_seconds",
            "type": {
              "vec": {
                "array": [
                  "u16",
                  2
                ]
              }
            }
          },
          {
            "name": "padding",
            "type": {
              "array": [
                "u8",
                12
              ]
            }
          }
        ]
      }
    },
    {
      "name": "PerformanceFee",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "fee_bps",
            "type": "u16"
          },
          {
            "name": "hurdle_rate_bps",
            "type": "u16"
          },
          {
            "name": "hurdle_type",
            "type": {
              "defined": {
                "name": "HurdleType"
              }
            }
          }
        ]
      }
    },
    {
      "name": "PricedProtocol",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "rent",
            "type": "u64"
          },
          {
            "name": "amount",
            "type": "i128"
          },
          {
            "name": "decimals",
            "type": "u8"
          },
          {
            "name": "last_updated_slot",
            "type": "u64"
          },
          {
            "name": "integration_program",
            "type": "pubkey"
          },
          {
            "name": "protocol_bitflag",
            "type": "u16"
          },
          {
            "name": "positions",
            "type": {
              "vec": "pubkey"
            }
          }
        ]
      }
    },
    {
      "name": "ProtocolFees",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "base_fee_bps",
            "type": "u16"
          },
          {
            "name": "flow_fee_bps",
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "ProtocolPermissions",
      "docs": [
        "Represents a delegate's permissions for a specific protocol"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "protocol_bitflag",
            "type": "u16"
          },
          {
            "name": "permissions_bitmask",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "ProtocolPolicy",
      "docs": [
        "Stores policy data for an integrated protocol.",
        "Integration programs serialize/deserialize this data."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "protocol_bitflag",
            "type": "u16"
          },
          {
            "name": "data",
            "type": "bytes"
          }
        ]
      }
    },
    {
      "name": "RepayPrincipalParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "ledger_index",
            "type": "u8"
          },
          {
            "name": "repay_all",
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "SellLedgerParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "ledger_index",
            "type": "u8"
          },
          {
            "name": "expected_sale_price",
            "type": "u64"
          },
          {
            "name": "asset_index_guidance",
            "type": "bytes"
          }
        ]
      }
    },
    {
      "name": "SellLedgerPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "max_discount_bps",
            "docs": [
              "Maximum discount from the ledger's expected value, in basis points.",
              "A value of zero requires no discount."
            ],
            "type": "u16"
          },
          {
            "name": "max_slippage_bps",
            "docs": [
              "Maximum tolerated slippage while selling a ledger, in basis points.",
              "A value of zero allows no slippage."
            ],
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "StateAccount",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "account_type",
            "type": {
              "defined": {
                "name": "AccountType"
              }
            }
          },
          {
            "name": "enabled",
            "type": "bool"
          },
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "portfolio_manager_name",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "created",
            "type": {
              "defined": {
                "name": "CreatedModel"
              }
            }
          },
          {
            "name": "base_asset_mint",
            "type": "pubkey"
          },
          {
            "name": "base_asset_decimals",
            "type": "u8"
          },
          {
            "name": "base_asset_token_program",
            "type": "u8"
          },
          {
            "name": "name",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "timelock_duration",
            "type": "u32"
          },
          {
            "name": "timelock_expires_at",
            "type": "u64"
          },
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "assets",
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "integration_acls",
            "type": {
              "vec": {
                "defined": {
                  "name": "IntegrationAcl"
                }
              }
            }
          },
          {
            "name": "delegate_acls",
            "type": {
              "vec": {
                "defined": {
                  "name": "DelegateAcl"
                }
              }
            }
          },
          {
            "name": "external_positions",
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "priced_protocols",
            "type": {
              "vec": {
                "defined": {
                  "name": "PricedProtocol"
                }
              }
            }
          },
          {
            "name": "params",
            "type": {
              "vec": {
                "vec": {
                  "defined": {
                    "name": "EngineField"
                  }
                }
              }
            }
          }
        ]
      }
    },
    {
      "name": "TimeUnit",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Second"
          },
          {
            "name": "Slot"
          }
        ]
      }
    },
    {
      "name": "UpdateStrategyParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "originations_enabled",
            "type": {
              "option": "bool"
            }
          },
          {
            "name": "liquidity_buffer",
            "type": {
              "option": "u64"
            }
          },
          {
            "name": "interest_fee",
            "type": {
              "option": "u64"
            }
          },
          {
            "name": "origination_fee",
            "type": {
              "option": "u64"
            }
          },
          {
            "name": "principal_fee",
            "type": {
              "option": "u64"
            }
          },
          {
            "name": "origination_cap",
            "type": {
              "option": "u64"
            }
          },
          {
            "name": "market_information",
            "type": {
              "option": "pubkey"
            }
          },
          {
            "name": "external_yield_source_args",
            "type": {
              "option": {
                "defined": {
                  "name": "ExternalYieldSourceArgs"
                }
              }
            }
          }
        ]
      }
    },
    {
      "name": "UpdateWeightMatrixParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "collateral_index",
            "type": "u8"
          },
          {
            "name": "weight_matrix",
            "type": {
              "array": [
                "u32",
                5
              ]
            }
          },
          {
            "name": "expected_loan_values",
            "type": {
              "defined": {
                "name": "ExpectedLoanValues"
              }
            }
          },
          {
            "name": "asset_index_guidance",
            "type": "bytes"
          }
        ]
      }
    },
    {
      "name": "ValuationModel",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Continuous"
          },
          {
            "name": "Periodic"
          }
        ]
      }
    },
    {
      "name": "VaultPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault_allowlist",
            "docs": [
              "Loopscale user vault accounts that may be used by the GLAM vault.",
              "An empty list denies all Loopscale user vault operations."
            ],
            "type": {
              "vec": "pubkey"
            }
          }
        ]
      }
    },
    {
      "name": "VaultStakeParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "principal_amount",
            "type": "u64"
          },
          {
            "name": "stake_all",
            "type": {
              "option": "bool"
            }
          },
          {
            "name": "duration",
            "type": "u32"
          },
          {
            "name": "duration_type",
            "type": "u8"
          },
          {
            "name": "action_type",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "VaultUnstakeParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "action_type",
            "type": "u8"
          },
          {
            "name": "principal_amount",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "WithdrawCollateralParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "collateral_index",
            "type": "u8"
          },
          {
            "name": "asset_index_guidance",
            "type": "bytes"
          },
          {
            "name": "expected_loan_values",
            "type": {
              "defined": {
                "name": "ExpectedLoanValues"
              }
            }
          },
          {
            "name": "close_if_eligible",
            "type": "bool"
          },
          {
            "name": "withdraw_all",
            "type": "bool"
          }
        ]
      }
    }
  ],
  "constants": [
    {
      "name": "PROTO_LOOPSCALE_BORROW",
      "type": "u16",
      "value": "1"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_BORROW_PRINCIPAL",
      "type": "u64",
      "value": "32"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_CLOSE_LOAN",
      "type": "u64",
      "value": "2"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_CREATE_LOAN",
      "type": "u64",
      "value": "1"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_DEPOSIT_COLLATERAL",
      "type": "u64",
      "value": "8"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_REPAY_PRINCIPAL",
      "type": "u64",
      "value": "64"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_SET_POLICY",
      "type": "u64",
      "value": "128"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_UPDATE_LOAN",
      "type": "u64",
      "value": "4"
    },
    {
      "name": "PROTO_LOOPSCALE_BORROW_PERM_WITHDRAW_COLLATERAL",
      "type": "u64",
      "value": "16"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING",
      "type": "u16",
      "value": "2"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING_PERM_CLOSE_STRATEGY",
      "type": "u64",
      "value": "16"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING_PERM_CREATE_STRATEGY",
      "type": "u64",
      "value": "1"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING_PERM_DEPOSIT_STRATEGY",
      "type": "u64",
      "value": "4"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING_PERM_SELL_LEDGER",
      "type": "u64",
      "value": "32"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING_PERM_SET_POLICY",
      "type": "u64",
      "value": "64"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING_PERM_UPDATE_STRATEGY",
      "type": "u64",
      "value": "2"
    },
    {
      "name": "PROTO_LOOPSCALE_LENDING_PERM_WITHDRAW_STRATEGY",
      "type": "u64",
      "value": "8"
    },
    {
      "name": "PROTO_LOOPSCALE_VAULT",
      "type": "u16",
      "value": "4"
    },
    {
      "name": "PROTO_LOOPSCALE_VAULT_PERM_CLAIM_VAULT_REWARDS",
      "type": "u64",
      "value": "16"
    },
    {
      "name": "PROTO_LOOPSCALE_VAULT_PERM_DEPOSIT_USER_VAULT",
      "type": "u64",
      "value": "1"
    },
    {
      "name": "PROTO_LOOPSCALE_VAULT_PERM_SET_POLICY",
      "type": "u64",
      "value": "32"
    },
    {
      "name": "PROTO_LOOPSCALE_VAULT_PERM_STAKE_USER_VAULT_LP",
      "type": "u64",
      "value": "4"
    },
    {
      "name": "PROTO_LOOPSCALE_VAULT_PERM_UNSTAKE_USER_VAULT_LP",
      "type": "u64",
      "value": "8"
    },
    {
      "name": "PROTO_LOOPSCALE_VAULT_PERM_WITHDRAW_USER_VAULT",
      "type": "u64",
      "value": "2"
    }
  ]
}