> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exponent.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Voting

> Stake LP tokens to vote on proposals, and unstake after voting ends

# Voting on Proposals

LP holders participate in governance by staking their LP tokens to vote on active proposals. See [ActionProposal](/developer-strategy-vaults/account-references/action-proposal) for how the voting model works.

## Stake Vote

### createStakeVoteInstruction

Stakes LP tokens to cast a vote on an active proposal. The voter chooses either `Reject` (block the proposal) or `OptOut` (don't block, but queue LP for withdrawal if it passes).

```typescript theme={null}
import { createStakeVoteInstruction, VoteChoice } from "@exponent-labs/exponent-sdk/client/vaults";

const ix = createStakeVoteInstruction(
  {
    voter: wallet.publicKey,
    vault: vaultAddress,
    proposal: proposalAddress,
    voteAccount: voteAccountPda,
    tokenLpSrc: voterLpTokenAccount,
    tokenLpEscrow: vaultLpEscrow,
    mintLp: vaultMintLp,
    tokenProgram: TOKEN_PROGRAM_ID,
    systemProgram: SystemProgram.programId,
  },
  {
    voteChoice: VoteChoice.Reject,
    lpAmount: 1_000_000n,
  },
);
```

### Accounts

| Name            | Signer | Writable | Description                          |
| --------------- | ------ | -------- | ------------------------------------ |
| `voter`         | Yes    | Yes      | The LP holder casting the vote       |
| `vault`         | No     | No       | The vault account                    |
| `proposal`      | No     | Yes      | The active proposal                  |
| `voteAccount`   | No     | Yes      | Vote account PDA (created if needed) |
| `tokenLpSrc`    | No     | Yes      | Voter's LP token account             |
| `tokenLpEscrow` | No     | Yes      | Vault LP escrow                      |
| `mintLp`        | No     | No       | Vault LP mint                        |
| `tokenProgram`  | No     | No       | SPL Token program                    |
| `systemProgram` | No     | No       | System program                       |

### Args

| Name         | Type         | Description                                   |
| ------------ | ------------ | --------------------------------------------- |
| `voteChoice` | `VoteChoice` | `Reject` or `OptOut`                          |
| `lpAmount`   | `u64`        | Amount of LP tokens to stake as voting weight |

***

## Unstake Vote

### createUnstakeVoteInstruction

Unstakes LP tokens after the voting period has ended. Returns staked LP to the voter.

```typescript theme={null}
import { createUnstakeVoteInstruction } from "@exponent-labs/exponent-sdk/client/vaults";

const ix = createUnstakeVoteInstruction({
  voter: wallet.publicKey,
  vault: vaultAddress,
  proposal: proposalAddress,
  voteAccount: voteAccountPda,
  tokenLpDst: voterLpTokenAccount,
  tokenLpEscrow: vaultLpEscrow,
  mintLp: vaultMintLp,
  tokenProgram: TOKEN_PROGRAM_ID,
});
```

### Accounts

| Name            | Signer | Writable | Description                        |
| --------------- | ------ | -------- | ---------------------------------- |
| `voter`         | Yes    | Yes      | The original voter                 |
| `vault`         | No     | No       | The vault account                  |
| `proposal`      | No     | No       | The finalized proposal             |
| `voteAccount`   | No     | Yes      | Vote account to close              |
| `tokenLpDst`    | No     | Yes      | Destination for returned LP tokens |
| `tokenLpEscrow` | No     | Yes      | Vault LP escrow                    |
| `mintLp`        | No     | No       | Vault LP mint                      |
| `tokenProgram`  | No     | No       | SPL Token program                  |

### Args

None.

<Note>
  Unstaking is only possible after the proposal has been finalized (either approved or rejected). If you voted `OptOut` and the proposal passed, your LP is automatically queued for withdrawal instead of being returned.
</Note>
