{
  "address": "G1NTew9pcXtYUTuTK4bJTUxKw2LghYmJCCDYxaKQN7oc",
  "metadata": {
    "name": "ext_epi",
    "version": "1.0.0",
    "spec": "0.1.0",
    "description": "External Position Integration for GLAM Protocol"
  },
  "instructions": [
    {
      "name": "refresh_priced_protocol",
      "docs": [
        "Republish the aggregate EPI priced protocol from already validated",
        "observations at the current slot."
      ],
      "discriminator": [
        229,
        89,
        39,
        46,
        5,
        217,
        10,
        192
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "signer": true
        },
        {
          "name": "observation_state",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  115,
                  116,
                  97,
                  116,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ]
          }
        },
        {
          "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": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        }
      ],
      "args": []
    },
    {
      "name": "remove_external_position",
      "docs": [
        "Remove an external position from the registry.",
        "Closes the observation state PDA and refunds rent to the signer."
      ],
      "discriminator": [
        97,
        146,
        246,
        241,
        130,
        26,
        108,
        97
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": 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": "observation_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  115,
                  116,
                  97,
                  116,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ]
          }
        },
        {
          "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": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "position_id",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        }
      ]
    },
    {
      "name": "submit_external_observation",
      "docs": [
        "Submit an observation for a configured external position.",
        "Writes to pending slot; replaces any existing pending observation."
      ],
      "discriminator": [
        100,
        228,
        147,
        149,
        22,
        28,
        158,
        163
      ],
      "accounts": [
        {
          "name": "glam_state"
        },
        {
          "name": "glam_signer",
          "signer": true
        },
        {
          "name": "observation_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  115,
                  116,
                  97,
                  116,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "input",
          "type": {
            "defined": {
              "name": "PositionObservationInput"
            }
          }
        }
      ]
    },
    {
      "name": "submit_external_observation_wormhole",
      "docs": [
        "Submit a Wormhole Guardian-verified external observation.",
        "The caller only relays a VAA body whose signatures have already been",
        "posted to the Wormhole Verification Shim."
      ],
      "discriminator": [
        124,
        238,
        191,
        242,
        222,
        175,
        91,
        148
      ],
      "accounts": [
        {
          "name": "glam_state"
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "observation_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  115,
                  116,
                  97,
                  116,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ]
          }
        },
        {
          "name": "wormhole_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101,
                  45,
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              },
              {
                "kind": "arg",
                "path": "position_id"
              }
            ]
          }
        },
        {
          "name": "guardian_set"
        },
        {
          "name": "guardian_signatures"
        },
        {
          "name": "wormhole_verify_vaa_shim",
          "address": "EFaNWErqAtVWufdNb7yofSHHfWFos843DFpu4JBw24at"
        }
      ],
      "args": [
        {
          "name": "position_id",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "guardian_set_bump",
          "type": "u8"
        },
        {
          "name": "vaa_body",
          "type": "bytes"
        }
      ]
    },
    {
      "name": "upsert_external_position",
      "docs": [
        "Create or update an external position configuration.",
        "Creates the observation state PDA on first call for a position."
      ],
      "discriminator": [
        199,
        33,
        239,
        150,
        200,
        123,
        43,
        70
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": 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": "observation_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  115,
                  116,
                  97,
                  116,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ]
          }
        },
        {
          "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": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "config",
          "type": {
            "defined": {
              "name": "ExternalPositionConfig"
            }
          }
        }
      ]
    },
    {
      "name": "upsert_external_position_wormhole_config",
      "docs": [
        "Create or update Wormhole verification config for a Wormhole-sourced",
        "external position."
      ],
      "discriminator": [
        173,
        64,
        201,
        39,
        54,
        49,
        192,
        89
      ],
      "accounts": [
        {
          "name": "glam_state"
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "wormhole_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101,
                  45,
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              },
              {
                "kind": "arg",
                "path": "input.position_id"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "input",
          "type": {
            "defined": {
              "name": "WormholeObservationConfigInput"
            }
          }
        }
      ]
    },
    {
      "name": "upsert_external_position_wormhole_hyperliquid_config",
      "docs": [
        "Create or update Hyperliquid-specific payload config for a",
        "Wormhole-sourced external position."
      ],
      "discriminator": [
        42,
        13,
        175,
        7,
        34,
        137,
        176,
        108
      ],
      "accounts": [
        {
          "name": "glam_state"
        },
        {
          "name": "glam_signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "wormhole_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101,
                  45,
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              },
              {
                "kind": "arg",
                "path": "input.position_id"
              }
            ]
          }
        },
        {
          "name": "hyperliquid_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101,
                  45,
                  104,
                  108,
                  45,
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              },
              {
                "kind": "arg",
                "path": "input.position_id"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "input",
          "type": {
            "defined": {
              "name": "WormholeHyperliquidObservationConfigInput"
            }
          }
        }
      ]
    },
    {
      "name": "validate_external_observation",
      "docs": [
        "Validate a pending observation, promote to active, and publish",
        "the full aggregate priced protocol for ext_epi.",
        "",
        "Remaining accounts:",
        "- `remaining_accounts[0]` is required when the pending observation",
        "denomination is a non-base mint; it must be the observed mint oracle",
        "account used for price normalization."
      ],
      "discriminator": [
        88,
        144,
        219,
        126,
        79,
        29,
        43,
        188
      ],
      "accounts": [
        {
          "name": "glam_state",
          "writable": true
        },
        {
          "name": "glam_signer",
          "signer": true
        },
        {
          "name": "observation_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  98,
                  115,
                  101,
                  114,
                  118,
                  97,
                  116,
                  105,
                  111,
                  110,
                  45,
                  115,
                  116,
                  97,
                  116,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "glam_state"
              }
            ]
          }
        },
        {
          "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": "glam_config",
          "docs": [
            "and its discriminator is checked by AssetMetasRef before use."
          ],
          "optional": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103,
                  108,
                  111,
                  98,
                  97,
                  108,
                  45,
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                10,
                11,
                0,
                83,
                72,
                16,
                46,
                144,
                46,
                42,
                79,
                22,
                157,
                123,
                21,
                242,
                192,
                146,
                1,
                78,
                88,
                59,
                102,
                9,
                190,
                226,
                92,
                189,
                187,
                232,
                83,
                220
              ]
            }
          }
        },
        {
          "name": "sol_usd_oracle",
          "docs": [
            "against GLAM global oracle metadata before price use."
          ],
          "optional": true
        },
        {
          "name": "base_asset_oracle",
          "docs": [
            "GLAM global oracle metadata before price use."
          ],
          "optional": true
        },
        {
          "name": "glam_protocol_program",
          "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
        }
      ],
      "args": [
        {
          "name": "position_id",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "ObservationState",
      "discriminator": [
        122,
        174,
        197,
        53,
        129,
        9,
        165,
        132
      ]
    },
    {
      "name": "StateAccount",
      "discriminator": [
        142,
        247,
        54,
        95,
        85,
        133,
        249,
        103
      ]
    },
    {
      "name": "WormholeHyperliquidObservationConfig",
      "discriminator": [
        34,
        225,
        134,
        14,
        86,
        66,
        4,
        53
      ]
    },
    {
      "name": "WormholeObservationConfig",
      "discriminator": [
        64,
        123,
        229,
        21,
        82,
        252,
        177,
        166
      ]
    }
  ],
  "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": "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": "Denomination",
      "docs": [
        "Denomination of an observation amount.",
        "Never reorder existing variants — append only."
      ],
      "repr": {
        "kind": "rust"
      },
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Usd"
          },
          {
            "name": "Mint"
          }
        ]
      }
    },
    {
      "name": "DenominationSpec",
      "docs": [
        "Full denomination spec: the discriminant plus an optional mint pubkey."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "denom",
            "type": {
              "defined": {
                "name": "Denomination"
              }
            }
          },
          {
            "name": "mint",
            "docs": [
              "Only meaningful when `denom == Denomination::Mint`.",
              "Set to `Pubkey::default()` for `Usd`."
            ],
            "type": "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": "ExternalPositionConfig",
      "docs": [
        "Per-position configuration entry in the registry."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "position_id",
            "docs": [
              "Unique identifier for this position within the vault.",
              "",
              "Under the cleaner pricing model, this 32-byte id is also the canonical",
              "coverage key published into `glam_state.external_positions` and",
              "`PricedProtocol.positions`. For bridge-managed inflight transfers, this",
              "should be the transfer-record pubkey bytes."
            ],
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "position_type",
            "docs": [
              "Type of position (Valued or Tokenized)."
            ],
            "type": {
              "defined": {
                "name": "ExternalPositionType"
              }
            }
          },
          {
            "name": "source_type",
            "docs": [
              "Source type (Trusted or Native)."
            ],
            "type": {
              "defined": {
                "name": "ExternalSourceType"
              }
            }
          },
          {
            "name": "denomination",
            "docs": [
              "Denomination rules for Trusted positions.",
              "For Native positions this is ignored (denomination derived from custody)."
            ],
            "type": {
              "defined": {
                "name": "DenominationSpec"
              }
            }
          },
          {
            "name": "native_custody_account",
            "docs": [
              "Custody account for Native positions. `Pubkey::default()` for Trusted."
            ],
            "type": "pubkey"
          },
          {
            "name": "native_custody_kind",
            "docs": [
              "Custody kind for Native positions."
            ],
            "type": {
              "defined": {
                "name": "NativeCustodyKind"
              }
            }
          },
          {
            "name": "enabled",
            "docs": [
              "Whether this position is enabled for observations."
            ],
            "type": "bool"
          },
          {
            "name": "freshness_override_secs",
            "docs": [
              "Freshness override in seconds. 0 means use vault default."
            ],
            "type": "u32"
          },
          {
            "name": "submit_allowlist",
            "docs": [
              "Per-position submit allowlist. Empty vec = use role-based access only."
            ],
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "validate_allowlist",
            "docs": [
              "Per-position validate allowlist. Empty vec = use role-based access only."
            ],
            "type": {
              "vec": "pubkey"
            }
          },
          {
            "name": "configure_allowlist",
            "docs": [
              "Per-position configure allowlist. Empty vec = use role-based access only.",
              "This is intentionally more permissive than the protocol-wide asset",
              "allowlist semantics where an empty allowlist means deny all."
            ],
            "type": {
              "vec": "pubkey"
            }
          }
        ]
      }
    },
    {
      "name": "ExternalPositionType",
      "docs": [
        "Type of external position.",
        "Never reorder existing variants — append only."
      ],
      "repr": {
        "kind": "rust"
      },
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Valued"
          },
          {
            "name": "Tokenized"
          }
        ]
      }
    },
    {
      "name": "ExternalSourceType",
      "docs": [
        "Source of observation data.",
        "Never reorder existing variants — append only."
      ],
      "repr": {
        "kind": "rust"
      },
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Trusted"
          },
          {
            "name": "Native"
          },
          {
            "name": "Wormhole"
          }
        ]
      }
    },
    {
      "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": "NativeCustodyKind",
      "docs": [
        "Custody kind for Native source positions.",
        "Never reorder existing variants — append only."
      ],
      "repr": {
        "kind": "rust"
      },
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "SplToken"
          },
          {
            "name": "NativeSol"
          }
        ]
      }
    },
    {
      "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": "Observation",
      "docs": [
        "A single observation snapshot."
      ],
      "serialization": "bytemuckunsafe",
      "repr": {
        "kind": "c"
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "docs": [
              "Signed amount in the observation's denomination."
            ],
            "type": {
              "defined": {
                "name": "StoredI128"
              }
            }
          },
          {
            "name": "denomination",
            "docs": [
              "Denomination of the amount."
            ],
            "type": {
              "defined": {
                "name": "DenominationSpec"
              }
            }
          },
          {
            "name": "_pad_denom",
            "docs": [
              "Alignment padding after denomination (to 8-byte boundary for i64)."
            ],
            "type": {
              "array": [
                "u8",
                7
              ]
            }
          },
          {
            "name": "observation_timestamp",
            "docs": [
              "Unix timestamp of the observation."
            ],
            "type": "i64"
          },
          {
            "name": "external_shares",
            "docs": [
              "External share count (for Tokenized positions)."
            ],
            "type": "u64"
          },
          {
            "name": "submitted_by",
            "docs": [
              "Signer who submitted this observation."
            ],
            "type": "pubkey"
          },
          {
            "name": "submitted_at_slot",
            "docs": [
              "Slot at which this observation was submitted."
            ],
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "ObservationState",
      "docs": [
        "Single PDA per vault that tracks all external position observations.",
        "Seeds: [SEED_OBSERVATION_STATE, glam_state.key()]"
      ],
      "serialization": "bytemuckunsafe",
      "repr": {
        "kind": "c"
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "glam_state",
            "docs": [
              "The glam_state this observation state belongs to."
            ],
            "type": "pubkey"
          },
          {
            "name": "bump",
            "docs": [
              "PDA bump."
            ],
            "type": "u8"
          },
          {
            "name": "positions_len",
            "docs": [
              "Number of active positions stored in `positions`."
            ],
            "type": "u8"
          },
          {
            "name": "reserved",
            "type": {
              "array": [
                "u8",
                6
              ]
            }
          },
          {
            "name": "positions",
            "docs": [
              "Per-position observation entries."
            ],
            "type": {
              "array": [
                {
                  "defined": {
                    "name": "PositionObservation"
                  }
                },
                16
              ]
            }
          }
        ]
      }
    },
    {
      "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": "PositionObservation",
      "docs": [
        "Observation data for a single position, stored inline in `ObservationState`."
      ],
      "serialization": "bytemuckunsafe",
      "repr": {
        "kind": "c"
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "position_id",
            "docs": [
              "The position_id this entry tracks."
            ],
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "has_pending",
            "docs": [
              "Whether a pending observation exists."
            ],
            "type": "bool"
          },
          {
            "name": "_pad_pending",
            "docs": [
              "Alignment padding after has_pending (to 8-byte boundary for Observation)."
            ],
            "type": {
              "array": [
                "u8",
                7
              ]
            }
          },
          {
            "name": "pending_observation",
            "docs": [
              "The pending observation (only valid when `has_pending == true`)."
            ],
            "type": {
              "defined": {
                "name": "Observation"
              }
            }
          },
          {
            "name": "has_validated",
            "docs": [
              "Whether a validated observation exists."
            ],
            "type": "bool"
          },
          {
            "name": "_pad_validated",
            "docs": [
              "Alignment padding after has_validated (to 8-byte boundary for Observation)."
            ],
            "type": {
              "array": [
                "u8",
                7
              ]
            }
          },
          {
            "name": "last_validated_observation",
            "docs": [
              "The last validated observation (only valid when `has_validated == true`)."
            ],
            "type": {
              "defined": {
                "name": "Observation"
              }
            }
          },
          {
            "name": "validated_by",
            "docs": [
              "Signer who last validated."
            ],
            "type": "pubkey"
          },
          {
            "name": "validated_at_slot",
            "docs": [
              "Slot at which last validation occurred."
            ],
            "type": "u64"
          },
          {
            "name": "validated_base_asset_amount",
            "docs": [
              "Base-asset-normalized amount from the last validated observation.",
              "This is the value that contributes to the aggregate priced protocol."
            ],
            "type": {
              "defined": {
                "name": "StoredI128"
              }
            }
          }
        ]
      }
    },
    {
      "name": "PositionObservationInput",
      "docs": [
        "Observation data submitted by a caller."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "position_id",
            "docs": [
              "The position being observed, identified by position_id.",
              "The same 32-byte id is used as the canonical AUM coverage key."
            ],
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "amount",
            "docs": [
              "Signed amount in the position's denomination.",
              "Positive = asset, negative = liability."
            ],
            "type": "i128"
          },
          {
            "name": "denomination",
            "docs": [
              "Denomination of the amount."
            ],
            "type": {
              "defined": {
                "name": "DenominationSpec"
              }
            }
          },
          {
            "name": "observation_timestamp",
            "docs": [
              "Unix timestamp of the observation."
            ],
            "type": "i64"
          },
          {
            "name": "external_shares",
            "docs": [
              "External share count (required > 0 for Tokenized positions, 0 for Valued)."
            ],
            "type": "u64"
          },
          {
            "name": "reserved",
            "docs": [
              "Reserved for future use."
            ],
            "type": {
              "array": [
                "u8",
                128
              ]
            }
          }
        ]
      }
    },
    {
      "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": "StoredI128",
      "docs": [
        "Byte-backed i128 storage that keeps the containing zero-copy account 8-byte aligned."
      ],
      "serialization": "bytemuck",
      "repr": {
        "kind": "c"
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bytes",
            "type": {
              "array": [
                "u8",
                16
              ]
            }
          }
        ]
      }
    },
    {
      "name": "TimeUnit",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Second"
          },
          {
            "name": "Slot"
          }
        ]
      }
    },
    {
      "name": "ValuationModel",
      "type": {
        "kind": "enum",
        "variants": [
          {
            "name": "Continuous"
          },
          {
            "name": "Periodic"
          }
        ]
      }
    },
    {
      "name": "WormholeHyperliquidObservationConfig",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "glam_state",
            "type": "pubkey"
          },
          {
            "name": "position_id",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "hyperliquid_account",
            "type": {
              "array": [
                "u8",
                20
              ]
            }
          },
          {
            "name": "account_margin_summary_precompile",
            "type": {
              "array": [
                "u8",
                20
              ]
            }
          },
          {
            "name": "spot_balance_precompile",
            "type": {
              "array": [
                "u8",
                20
              ]
            }
          },
          {
            "name": "perp_dex_index",
            "type": "u32"
          },
          {
            "name": "usdc_spot_token",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "WormholeHyperliquidObservationConfigInput",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "position_id",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "hyperliquid_account",
            "type": {
              "array": [
                "u8",
                20
              ]
            }
          },
          {
            "name": "account_margin_summary_precompile",
            "type": {
              "array": [
                "u8",
                20
              ]
            }
          },
          {
            "name": "spot_balance_precompile",
            "type": {
              "array": [
                "u8",
                20
              ]
            }
          },
          {
            "name": "perp_dex_index",
            "type": "u32"
          },
          {
            "name": "usdc_spot_token",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "WormholeObservationConfig",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "glam_state",
            "type": "pubkey"
          },
          {
            "name": "position_id",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "emitter_chain",
            "type": "u16"
          },
          {
            "name": "emitter_address",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "payload_version",
            "type": "u8"
          },
          {
            "name": "payload_type",
            "type": "u8"
          },
          {
            "name": "max_age_seconds",
            "type": "u32"
          },
          {
            "name": "has_last_sequence",
            "type": "bool"
          },
          {
            "name": "last_sequence",
            "type": "u64"
          },
          {
            "name": "last_vaa_hash",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "WormholeObservationConfigInput",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "position_id",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "emitter_chain",
            "type": "u16"
          },
          {
            "name": "emitter_address",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "payload_version",
            "type": "u8"
          },
          {
            "name": "payload_type",
            "type": "u8"
          },
          {
            "name": "max_age_seconds",
            "type": "u32"
          }
        ]
      }
    }
  ],
  "constants": [
    {
      "name": "PROTO_EPI",
      "type": "u16",
      "value": "1"
    },
    {
      "name": "PROTO_EPI_PERM_CONFIGURE",
      "type": "u64",
      "value": "1"
    },
    {
      "name": "PROTO_EPI_PERM_SUBMIT_OBSERVATION",
      "type": "u64",
      "value": "2"
    },
    {
      "name": "PROTO_EPI_PERM_VALIDATE_OBSERVATION",
      "type": "u64",
      "value": "4"
    }
  ]
}