{
  "address": "G1NTJX2noRfJeKS7NDgjsqUXcJ7R9yARED1LQvg7iwSK",
  "metadata": {
    "name": "ext_jupiter",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Jupiter Lend integration for GLAM Protocol"
  },
  "instructions": [
    {
      "name": "borrow_init_position",
      "docs": [
        "Initialize a Jupiter Borrow position NFT owned by the GLAM vault.",
        "",
        "- Permission: `BorrowPermissions::InitPosition`.",
        "- Policy: `vault_state` must be in `BorrowPolicy::vaults_allowlist`."
      ],
      "discriminator": [
        92,
        209,
        176,
        14,
        75,
        243,
        107,
        230
      ],
      "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": "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "vault_admin"
        },
        {
          "name": "vault_state",
          "writable": true
        },
        {
          "name": "position",
          "writable": true
        },
        {
          "name": "position_mint",
          "writable": true
        },
        {
          "name": "position_token_account",
          "writable": true
        },
        {
          "name": "metadata_account",
          "writable": true
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "sysvar_instruction",
          "address": "Sysvar1nstructions1111111111111111111111111"
        },
        {
          "name": "metadata_program",
          "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
        },
        {
          "name": "rent",
          "address": "SysvarRent111111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "vault_id",
          "type": "u16"
        },
        {
          "name": "next_position_id",
          "type": "u32"
        }
      ]
    },
    {
      "name": "borrow_operate",
      "docs": [
        "Operate a Jupiter Borrow position.",
        "",
        "Required permissions are derived from signed deltas:",
        "positive collateral = deposit, negative collateral = withdraw,",
        "positive debt = borrow, negative debt = repay."
      ],
      "discriminator": [
        46,
        121,
        58,
        48,
        13,
        5,
        117,
        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": "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "signer_supply_token_account",
          "writable": true
        },
        {
          "name": "signer_borrow_token_account",
          "writable": true
        },
        {
          "name": "recipient",
          "optional": true
        },
        {
          "name": "recipient_borrow_token_account",
          "writable": true,
          "optional": true
        },
        {
          "name": "recipient_supply_token_account",
          "writable": true,
          "optional": true
        },
        {
          "name": "vault_config"
        },
        {
          "name": "vault_state",
          "writable": true
        },
        {
          "name": "supply_token"
        },
        {
          "name": "borrow_token"
        },
        {
          "name": "oracle"
        },
        {
          "name": "position",
          "writable": true
        },
        {
          "name": "position_token_account"
        },
        {
          "name": "current_position_tick",
          "writable": true
        },
        {
          "name": "final_position_tick",
          "writable": true
        },
        {
          "name": "current_position_tick_id"
        },
        {
          "name": "final_position_tick_id",
          "writable": true
        },
        {
          "name": "new_branch",
          "writable": true
        },
        {
          "name": "supply_token_reserves_liquidity",
          "writable": true
        },
        {
          "name": "borrow_token_reserves_liquidity",
          "writable": true
        },
        {
          "name": "vault_supply_position_on_liquidity",
          "writable": true
        },
        {
          "name": "vault_borrow_position_on_liquidity",
          "writable": true
        },
        {
          "name": "supply_rate_model"
        },
        {
          "name": "borrow_rate_model"
        },
        {
          "name": "vault_supply_token_account",
          "writable": true
        },
        {
          "name": "vault_borrow_token_account",
          "writable": true
        },
        {
          "name": "supply_token_claim_account",
          "writable": true,
          "optional": true
        },
        {
          "name": "borrow_token_claim_account",
          "writable": true,
          "optional": true
        },
        {
          "name": "liquidity"
        },
        {
          "name": "liquidity_program",
          "address": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC"
        },
        {
          "name": "oracle_program",
          "address": "jupnw4B6Eqs7ft6rxpzYLJZYSnrpRgPcr589n5Kv4oc"
        },
        {
          "name": "supply_token_program"
        },
        {
          "name": "borrow_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "new_col",
          "type": "i128"
        },
        {
          "name": "new_debt",
          "type": "i128"
        },
        {
          "name": "transfer_type",
          "type": {
            "option": {
              "defined": {
                "name": "TransferType"
              }
            }
          }
        },
        {
          "name": "remaining_accounts_indices",
          "type": "bytes"
        }
      ]
    },
    {
      "name": "earn_deposit",
      "docs": [
        "Deposit underlying tokens into Jupiter Earn and mint jlTokens to the GLAM vault.",
        "",
        "- Permission: `EarnPermissions::Deposit`.",
        "- Policy: underlying `mint` must be in `EarnPolicy::mints_allowlist`."
      ],
      "discriminator": [
        81,
        98,
        113,
        207,
        82,
        192,
        187,
        234
      ],
      "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": "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "depositor_token_account",
          "writable": true
        },
        {
          "name": "recipient_token_account",
          "writable": true
        },
        {
          "name": "mint"
        },
        {
          "name": "lending_admin"
        },
        {
          "name": "lending",
          "writable": true
        },
        {
          "name": "f_token_mint",
          "writable": true
        },
        {
          "name": "supply_token_reserves_liquidity",
          "writable": true
        },
        {
          "name": "lending_supply_position_on_liquidity",
          "writable": true
        },
        {
          "name": "rate_model"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "liquidity",
          "writable": true
        },
        {
          "name": "liquidity_program",
          "writable": true,
          "address": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC"
        },
        {
          "name": "rewards_rate_model"
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "assets",
          "type": "u64"
        },
        {
          "name": "min_amount_out",
          "type": "u64"
        }
      ]
    },
    {
      "name": "earn_withdraw",
      "docs": [
        "Burn Jupiter Earn jlTokens and withdraw underlying tokens to the GLAM vault.",
        "",
        "- Permission: `EarnPermissions::Withdraw`.",
        "- Policy: underlying `mint` must be in `EarnPolicy::mints_allowlist`."
      ],
      "discriminator": [
        68,
        169,
        40,
        28,
        165,
        60,
        157,
        98
      ],
      "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": "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9"
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "owner_token_account",
          "writable": true
        },
        {
          "name": "recipient_token_account",
          "writable": true
        },
        {
          "name": "lending_admin"
        },
        {
          "name": "lending",
          "writable": true
        },
        {
          "name": "mint"
        },
        {
          "name": "f_token_mint",
          "writable": true
        },
        {
          "name": "supply_token_reserves_liquidity",
          "writable": true
        },
        {
          "name": "lending_supply_position_on_liquidity",
          "writable": true
        },
        {
          "name": "rate_model"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "claim_account",
          "writable": true
        },
        {
          "name": "liquidity",
          "writable": true
        },
        {
          "name": "liquidity_program",
          "writable": true,
          "address": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC"
        },
        {
          "name": "rewards_rate_model"
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "max_shares_burn",
          "type": "u64"
        }
      ]
    },
    {
      "name": "set_borrow_policy",
      "docs": [
        "Set the Jupiter Borrow policy on the GLAM state."
      ],
      "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"
        }
      ],
      "args": [
        {
          "name": "policy",
          "type": {
            "defined": {
              "name": "BorrowPolicy"
            }
          }
        }
      ]
    },
    {
      "name": "set_earn_policy",
      "docs": [
        "Set the Jupiter Earn policy on the GLAM state."
      ],
      "discriminator": [
        48,
        17,
        31,
        62,
        132,
        232,
        114,
        96
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        }
      ],
      "args": [
        {
          "name": "policy",
          "type": {
            "defined": {
              "name": "EarnPolicy"
            }
          }
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "StateAccount",
      "discriminator": [
        142,
        247,
        54,
        95,
        85,
        133,
        249,
        103
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "UnexpectedSigner",
      "msg": "Unexpected signer privilege passed to Jupiter CPI"
    },
    {
      "code": 6001,
      "name": "InvalidVaultTokenAccount",
      "msg": "Vault token account must be the GLAM vault ATA for the expected mint"
    },
    {
      "code": 6002,
      "name": "InvalidPositionTokenAccount",
      "msg": "Position token account must be controlled by the GLAM vault"
    },
    {
      "code": 6003,
      "name": "InvalidMetadataAccount",
      "msg": "Metadata account must be the Metaplex metadata PDA for the position mint"
    },
    {
      "code": 6004,
      "name": "DuplicateMutableAccount",
      "msg": "Mutable source and destination accounts must differ"
    },
    {
      "code": 6005,
      "name": "InvalidRemainingAccountIndices",
      "msg": "Jupiter operate remaining account indices must contain exactly three counts"
    },
    {
      "code": 6006,
      "name": "RemainingAccountsCountMismatch",
      "msg": "Jupiter operate remaining account counts do not match remaining accounts"
    },
    {
      "code": 6007,
      "name": "NoopOperate",
      "msg": "Jupiter operate instruction must request at least one position change"
    }
  ],
  "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": "BorrowPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vaults_allowlist",
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "collateral_mints_allowlist",
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "borrow_mints_allowlist",
            "type": {
              "vec": "pubkey"
            }
          }
        ]
      }
    },
    {
      "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": "EarnPolicy",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mints_allowlist",
            "type": {
              "vec": "pubkey"
            }
          }
        ]
      }
    },
    {
      "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": "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": "ManagementFee",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "fee_bps",
            "type": "u16"
          }
        ]
      }
    },
    {
      "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": "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": "TransferType",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "SKIP"
          },
          {
            "name": "DIRECT"
          },
          {
            "name": "CLAIM"
          }
        ]
      }
    },
    {
      "name": "ValuationModel",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Continuous"
          },
          {
            "name": "Periodic"
          }
        ]
      }
    }
  ],
  "constants": [
    {
      "name": "PROTO_JUPITER_BORROW",
      "type": "u16",
      "value": "2"
    },
    {
      "name": "PROTO_JUPITER_BORROW_PERM_BORROW",
      "type": "u64",
      "value": "8"
    },
    {
      "name": "PROTO_JUPITER_BORROW_PERM_DEPOSIT_COLLATERAL",
      "type": "u64",
      "value": "2"
    },
    {
      "name": "PROTO_JUPITER_BORROW_PERM_INIT_POSITION",
      "type": "u64",
      "value": "1"
    },
    {
      "name": "PROTO_JUPITER_BORROW_PERM_REPAY",
      "type": "u64",
      "value": "16"
    },
    {
      "name": "PROTO_JUPITER_BORROW_PERM_WITHDRAW_COLLATERAL",
      "type": "u64",
      "value": "4"
    },
    {
      "name": "PROTO_JUPITER_EARN",
      "type": "u16",
      "value": "1"
    },
    {
      "name": "PROTO_JUPITER_EARN_PERM_DEPOSIT",
      "type": "u64",
      "value": "1"
    },
    {
      "name": "PROTO_JUPITER_EARN_PERM_WITHDRAW",
      "type": "u64",
      "value": "2"
    }
  ]
}