Skip to main content

createRecalculateAumInstruction

Recalculates the vault’s assets under management by reading balance accounts and current price data. This instruction is typically called as a post-hook after Squads policy execution to verify that the transaction outcome is within expected bounds. Can be called by anyone since it only reads balance data and updates the vault’s cached AUM value.

Usage

import { createRecalculateAumInstruction } from "@exponent-labs/exponent-sdk/client/vaults";
import { PublicKey } from "@solana/web3.js";

const ix = createRecalculateAumInstruction(
  {
    exponentVaultsProgram: EXPONENT_VAULTS_PROGRAM_ID,
    vault: vaultAddress,
    exponentPrices: exponentPricesAddress,
  },
  {
    instructions: compiledInstructions,
  }
);

Accounts

NameSignerWritableDescription
exponentVaultsProgramNoNoExponent Vaults program
vaultNoYesVault account to recalculate AUM for
exponentPricesNoNoExponentPrices account for token valuations

Args

NameTypeDescription
instructionsHookCompiledInstruction[]Compiled instructions from the sync transaction used for outcome verification

Returns

TransactionInstruction — a transaction instruction ready to be added to a transaction.