GLAMIDL Reference

submit_external_observation

Submit an observation for a configured external position.

Handler narrative

  1. Load the GLAM state or program account required by the instruction and verify the signer.
  2. Verify that the integration is enabled on the vault and that the caller has the required delegate permission or owner authority.
  3. Validate the instruction-specific policy, then invoke the external protocol with the vault authority where required.
  4. Submit an observation for a configured external position. Writes to pending slot; replaces any existing pending observation.

Required conditions

  • The submitted accounts must match the declared account list, signer requirements, writable requirements, fixed program addresses, and account relationships shown below.
  • The GLAM state account is the source of truth for owner, enabled integrations, delegate permissions, policies, assets, borrowable assets, timelock settings, mint linkage, and pricing records.
  • The vault integration ACL must enable this integration before the instruction is accepted; that enablement is defined on the GLAM state account.
  • If the signer is not the owner, the delegate ACL on the GLAM state must contain the exact protocol permission required by this instruction; registering a delegate alone is insufficient.
  • Instruction-specific destination accounts must satisfy the external protocol's own account model; GLAM validates the accounts it needs for authorization and policy enforcement, then passes the remaining protocol accounts through CPI.

Accounts

Uses the standard Big Seven account pattern, plus the instruction-specific accounts below.

AccountRoleDescription
observation_statewritableProgram-derived account used by this instruction; clients should prefer SDK helpers when available.

Arguments

ArgumentTypeNotes
inputPositionObservationInput

Instruction input object; field details are listed below. Fields: position_id: [u8; 32] - The position being observed, identified by position_id. The same 32-byte id is used as the canonical AUM coverage key.; amount: i128 - Signed amount in the position's denomination. Positive = asset, negative = liability.; denomination: DenominationSpec - Denomination of the amount.; observation_timestamp: i64 - Unix timestamp of the observation.; external_shares: u64 - External share count (required > 0 for Tokenized positions, 0 for Valued).; reserved: [u8; 128] - Reserved for future use.

Policy & permissions

  • Enable the External Position Interface integration before observations affect vault pricing.

  • Caller must be the owner or a delegate with the explicit protocol permission required by this instruction.

TypeScript SDK usage

await glamClient.epi.submitExternalObservation({
  positionId,
  amount,
  denomination,
  observationTimestamp,
  externalShares,
});

Cross-instruction constraints

  • The external position must be configured before observations are submitted; validation promotes a pending observation before refresh republishes aggregate pricing.