Skip to main content

Proposal Finalization and Execution

After the voting period ends, proposals must be finalized to determine the outcome, then executed after the timelock passes.

Finalize Proposal

createFinalizeProposalInstruction

Finalizes a proposal after its voting period has ended. Determines whether the proposal passed or was rejected based on the rejection threshold. Anyone can call this instruction.
import { createFinalizeProposalInstruction } from "@exponent-labs/exponent-sdk/client/vaults";

const ix = createFinalizeProposalInstruction({
  payer: wallet.publicKey,
  vault: vaultAddress,
  mintLp: vaultMintLp,
  proposal: proposalAddress,
});

Accounts

NameSignerWritableDescription
payerYesYesTransaction fee payer
vaultNoNoThe vault account
mintLpNoNoVault LP mint (used to check total supply for threshold calculation)
proposalNoYesThe proposal to finalize

Execute Proposal

createExecuteProposalInstruction

Executes an approved proposal after the timelock period has passed. Applies the proposed VaultSettingsAction or PositionUpdate to the vault. Anyone can call this instruction.
import { createExecuteProposalInstruction } from "@exponent-labs/exponent-sdk/client/vaults";

const ix = createExecuteProposalInstruction({
  payer: wallet.publicKey,
  vault: vaultAddress,
  proposal: proposalAddress,
  exponentPrices: exponentPricesPda,
  systemProgram: SystemProgram.programId,
});

Accounts

NameSignerWritableDescription
payerYesYesTransaction fee payer
vaultNoYesThe vault account (modified by the proposal action)
proposalNoYesThe approved proposal to execute
exponentPricesNoYesExponentPrices account
systemProgramNoNoSystem program

Cancel Proposal

createCancelProposalInstruction

Cancels an active proposal before execution. Only the vault manager (or Exponent sentinel) can cancel proposals.
import { createCancelProposalInstruction } from "@exponent-labs/exponent-sdk/client/vaults";

const ix = createCancelProposalInstruction({
  authority: wallet.publicKey, // manager or Exponent sentinel
  vault: vaultAddress,
  proposal: proposalAddress,
});

Accounts

NameSignerWritableDescription
authorityYesNoManager (or Exponent sentinel) with cancellation rights
vaultNoNoThe vault account
proposalNoYesThe proposal to cancel