> For the complete documentation index, see [llms.txt](https://hoodstrategy.gitbook.io/hoodstrategy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hoodstrategy.gitbook.io/hoodstrategy/automation.md).

# Automation & Harvesting

The *harvest* is the cycle that buys HOOD and updates rewards. HoodStrategy triggers it in three complementary ways.

## 1. Trade-driven auto-trigger (primary)

The harvest is triggered **by the trades themselves**, in the hook's `afterSwap`, when `harvestThreshold` and `harvestCooldown` are satisfied. This is the most atomic mode: no external dependency. As long as there's volume, the loop runs on its own.

## 2. Public backup function (`harvest()`)

For quiet periods, a **public** `harvest()` function can be called by **anyone**. The caller receives a **small reward** (`keeperReward`, e.g. 0.25% of the harvested amount) to cover gas and incentivize them. Protocol upkeep is thus decentralized and incentivized.

## 3. Chainlink Automation (optional)

As a complement, **Chainlink Automation** can call `harvest()` on a schedule or an on-chain condition, ensuring regular distributions even without activity. It's optional and introduces no central point of trust (Chainlink is decentralized).

## The "every X minutes"

A smart contract **cannot trigger itself on a clock** — it must be pushed by a transaction. The "every X minutes" cadence is therefore achieved by the combination of:

* `harvestThreshold` — a minimum amount of ETH must be accumulated;
* `harvestCooldown` — a minimum delay must elapse between purchases.

## Parameters

| Parameter          | Default      | Description                                |
| ------------------ | ------------ | ------------------------------------------ |
| `harvestThreshold` | to calibrate | Min. ETH before a purchase                 |
| `harvestCooldown`  | 300 s        | Min. delay between purchases               |
| `keeperReward`     | 0.25%        | Reward paid to the `harvest()` caller      |
| `maxSlippageBps`   | 100 (1%)     | Max slippage tolerated vs Chainlink oracle |


---

# 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://hoodstrategy.gitbook.io/hoodstrategy/automation.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.
