# Voting and Earning Rewards

The ve(3,3) model in the Spectra protocol promotes long-term engagement by letting users lock APW for veAPW, which provide governance power over protocol decisions, including voting for liquidity pools.

The voting mechanism enables efficient allocation of liquidity, rewarding both liquidity providers for their contributions and voters with a say in reward distribution. It results in a more stable protocol, motivated participants, and optimized rewards for committed stakeholders.

## Step by Step

### 1. Lock APW for veAPW

Create a veAPW lock for an APW amount of your choice and a duration of up to 2 years. Refer to [Locking APW for veAPW](/guides/locking-apw-for-veapw.md) guide for more details.

### 2. Find a pool to vote for

1. Pools are each identified by a unique ID, that can be obtained from `GovernanceRegistry`'s [`getPoolId()`](/technical-reference/contract-functions/governanceregistry.md#getpoolid) function.
2. Get the list of all dentifiers of pools that have associated voting rewards, using `Voter`'s [`getAllPoolIds()`](/technical-reference/contract-functions/voter.md#getallpoolids).
3. Verify that voting is not currently banned for a given `_poolId` using `Voter`'s [`isVoteAuthorized(_poolId)`](/technical-reference/contract-functions/voter.md#isvoteauthorized).
4. Vote for the desired pools, specifying the weights, using `Voter`'s [`vote()`](/technical-reference/contract-functions/voter.md#vote).

{% hint style="info" %}
If the identifier of a pool is not returned by [`getAllPoolIds()`](/technical-reference/contract-functions/voter.md#getallpoolids), voting rewards can be deployed for it. See Voter's [`createVotingRewards()`](/technical-reference/contract-functions/voter.md#createvotingrewards).
{% endhint %}

{% hint style="info" %}
User voting weights do not automatically update when voting power increases or decays. They can be updated using `Voter`'s [`poke()`](/technical-reference/contract-functions/voter.md#poke).
{% endhint %}

{% hint style="info" %}
User vote can be reset using `Voter`'s [`reset()`](/technical-reference/contract-functions/voter.md#reset)`.`
{% endhint %}

### 3. Find out about available rewards tokens for each pool

Fees and Bribes voting rewards can vary among pools.

1. `FeesVotingReward` and `BribeVotingReward` contracts associated with a given pool can be fetched respectively using `Voter`'s [`poolToFees()`](/technical-reference/contract-functions/voter.md#pooltofees) and [`poolToBribe()`](/technical-reference/contract-functions/voter.md#pooltobribe).
2. The list of all reward tokens for a given `FeeVotingReward` or `BribeVotingReward` can be fetched using [`getAllRewards()`](/technical-reference/contract-functions/votingreward.md#getallrewards) getter, which takes an index comprised between 0 and `VotingReward`'s [`rewardsListLength()`](/technical-reference/contract-functions/votingreward.md#rewardslistlength).
3. Earned rewards for a given user and a specific reward token can be fetched using `VotingReward`'s [`earned()`](/technical-reference/contract-functions/votingreward.md#earned).

### 4. Claim voting rewards

Each week, voting rewards for the previous week can be claimed.

Claim voting rewards for a specific list of pools and specific lists of bribes and fees reward token, using `Voter's` [`claimPoolsVotingRewards()`](/technical-reference/contract-functions/voter.md#claimpoolsvotingrewards).

{% hint style="info" %}
Bribes and fees rewards can also be claimed separately using [`claimBribes()`](/technical-reference/contract-functions/voter.md#claimbribes) and [`claimFees()`](/technical-reference/contract-functions/voter.md#claimfees).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.spectra.finance/guides/voting-and-earning-rewards.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
