> For the complete documentation index, see [llms.txt](https://dev.spectra.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.spectra.finance/technical-reference/contract-functions/feedistributor.md).

# FeeDistributor

## Overview

The `FeeDistributor.vy` contract allows users to claim APW locking rewards.

## FeeDistributor Methods

### claim

Claim fees for `_addr.`

```solidity
def claim(_addr: address = msg.sender) -> uint256
```

<table><thead><tr><th width="246.33333333333331">Input Parameter</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>_addr</code></td><td>address</td><td>The user address to claim for.</td></tr></tbody></table>

<table><thead><tr><th width="246.33333333333331">Return Parameter</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amount</code></td><td>uint256</td><td>The amount claimed.</td></tr></tbody></table>

{% hint style="info" %}
Each call to claim look at a maximum of 50 user veAPW points. For accounts with many veAPW related actions, this function may need to be called more than once to claim all available fees. In the `Claimed` event that fires, if `claim_epoch` is less than `max_epoch`, the account may claim again.
{% endhint %}

### claim\_many

Make multiple fee claims in a single call.

```solidity
def claim_many(_receivers: address[20]) -> bool
```

<table><thead><tr><th width="246.33333333333331">Input Parameter</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>_receivers</code></td><td>address[20]</td><td>List of addresses to claim for. Claiming terminates at the first <code>ZERO_ADDRESS.</code></td></tr></tbody></table>

<table><thead><tr><th width="246.33333333333331">Return Parameter</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td>bool</td><td>True if execution succeeded.</td></tr></tbody></table>

{% hint style="info" %}
Used to claim for many accounts at once, or to make multiple claims for the same address when that address has significant veAPW history.
{% endhint %}

### checkpoint\_token

Updates the token checkpoint.

```solidity
def checkpoint_token()
```

{% hint style="info" %}
Calculates the total number of tokens to be distributed in a given week. During setup for the initial distribution this function is only callable by the contract owner. Beyond initial distro, it can be enabled for anyone to call.
{% endhint %}

### checkpoint\_total\_supply

Update the veAPW total supply checkpoint.

```solidity
def checkpoint_total_supply()
```

{% hint style="info" %}
The checkpoint is also updated by the first claimant each new epoch week. This function may be called independently of a claim, to reduce claiming gas costs.
{% endhint %}

## View Methods

### ve\_for\_at

Get the veAPW balance for `_user` at `_timestamp`

```solidity
def ve_for_at(_user: address, _timestamp: uint256) -> uint256
```

<table><thead><tr><th width="246.33333333333331">Input Parameter</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>_user</code></td><td>address</td><td>The address to query balance for.</td></tr><tr><td><code>_timestamp</code></td><td>uint256</td><td>The epoch time to query balance at.</td></tr></tbody></table>

<table><thead><tr><th width="246.33333333333331">Return Parameter</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>balance</code></td><td>uint256</td><td>The veAPW balance.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://dev.spectra.finance/technical-reference/contract-functions/feedistributor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
