# harvest

An entrypoint that harvests (claims) user's rewards. Rewards are minted to the user and to the referrer (***harvest\_fee***).

### Call parameters

```pascaligo
type harvest_type       is [@layout:comb] record [
  fid                     : fid_type;
  rewards_receiver        : address;
]
```

| Field             | Type            | Description               |
| ----------------- | --------------- | ------------------------- |
| fid               | fid\_type (nat) | Farm's ID                 |
| rewards\_receiver | address         | Receiver of earned tokens |

### Usage

{% tabs %}
{% tab title="🌮 Taquito" %}

```javascript
const qFarmAddress = "KT1...";
const params = {
    fid: 1,
    rewards_receiver: "tz1.../KT1...",
};
const qFarm = await tezos.contract.at(qFarmAddress);
const operation = await qFarm.methodsObject.harvest(params).send();

await operation.confirmation();
```

{% endtab %}
{% endtabs %}

### Errors

* `QSystem/farm-not-set` - farming with `fid` parameter doesn't exist.
* `QFarm/timelock-is-not-finished` - timelock after last user's deposit (stake) is not finished.


---

# 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://docs.quipuswap.com/smart-contracts/farming/qfarm-contract/entrypoints-overview/farming-entrypoints/harvest.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.
