# HIP-4: 使用 Keepers 关闭每周费用期

**类型：**&#x48;orizon改进提案\
**日期：**&#x32;022 年 8 月 30 日\
**状态：**&#x7B2C;一版

## 简介

部署一个 Keepers Upkeep 合约并注册一个 Keeper 账号以自动关闭每周费用期

## 规范

* 部署一个与 Keeper 兼容的合约，该合约可以自动执行费用期关闭到 BNB Chain 主网上。
* 注册并充值 Keeper账号

## 动机

费用池（FeePool） 合约中的 closeCurrentFeePeriod() 函数负责关闭当周收取的费用和奖励，并在每周（领取日）开始一个新的周期。此功能还会将任何未领取的奖励迁移到当前的领取期，为用户注明新领取期的费用/奖励，并开始新的领取期。

虽然 Horizo​​n Protocol 团队每周都会积极维护费用周期的关闭，但这个动作也可以由社区中的任何人完成，因为 closeCurrentFeePeriod() 是一个任何人都可以执行的公共函数。

利用 Chainlink Keepers 以自动执行这一重要的协议维护操作，将有助于减少未按时调用该功能的可能性，并有助于进一步将协议去中心化。

Keepers Upkeep （维护账号）需要 ERC677 LINK 代币，这将由社区基金提供资金。 Keepers Upkeep 对于调用该函数所需的 gas 费用收取 30% 的溢价（此价相对于其他网络而言较低），以便为其网络的维护操作提供资金。 closeCurrentFeePeriod() 函数在 BNB Chain 主网上使用约 220,000 gas（约 0.30 美元），因此每笔交易的估计成本将以 LINK 代币支付约 0.40 美元。此外，Upkeep中必须保持一定的[最低余额](https://docs.chain.link/docs/chainlink-keepers/keeper-economics/#minimum-balance)，否则它将停止运行。

<br>

## 潜在风险

此 HIP 的实施可能会带来一些风险，包括：

* 必须在 Keeper 中维持 LINK 代币的最低余额，否则它将不会执行维护

## 考虑因素

其他应当考虑的因素：

* 如果 Keeper 网络出现任何故障，社区应该意识到他们也可以自己调用 closeCurrentFeePeriod() 来帮助维护协议。

## 反馈与问题

如果您有任何问题或疑虑，请随时与我们联系。


---

# 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://academy.horizonprotocol.com/chinese/horizon-protocol/community-driven/hips/hip4-shi-yong-keepers-guan-bi-mei-zhou-fei-yong-qi.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.
