Skip to main content

createProposeActionInstruction

Creates a new governance proposal. Only the vault manager can propose actions. The proposal enters a voting period where LP holders can vote to reject or opt out. There is no high-level class method for this instruction; use the raw instruction builder directly.

Usage

import {
  createProposeActionInstruction,
  proposalAction,
  vaultSettingsAction,
  priceId,
} from "@exponent-labs/exponent-sdk/client/vaults";

const ix = createProposeActionInstruction(
  {
    payer: wallet.publicKey,
    manager: wallet.publicKey,
    vault: vaultAddress,
    proposal: proposalAddress, // PDA derived from vault + proposalId
    systemProgram: SystemProgram.programId,
  },
  {
    proposalId: 1n,
    action: proposalAction("VaultSettingsAction", [
      vaultSettingsAction("AddTokenEntry", [{
        mint: newTokenMint,
        priceId: priceId("Simple", { priceId: 2n }),
        tokenSquadsAccount: tokenSquadsAddr,
        forceDeallocatePolicyIds: [],
      }]),
    ]),
    votingPeriodSeconds: 86400, // 24 hours
    timelockSeconds: 3600, // 1 hour after approval
  },
);

Accounts

NameSignerWritableDescription
payerYesYesTransaction fee payer
managerYesNoVault manager (must have manager role)
vaultNoYesThe vault account
proposalNoYesThe proposal account PDA
systemProgramNoNoSystem program

Args

NameTypeDescription
proposalIdu64Sequential proposal identifier
actionProposalActionThe proposed change — either VaultSettingsAction or PositionUpdate
votingPeriodSeconds`u32null`Voting period override. Uses vault default if null
timelockSeconds`u32null`Timelock override. Uses vault default if null
The action field accepts a ProposalAction — either a VaultSettingsAction or PositionUpdate. See ActionProposal for the full type definition.

Returns

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