> For the complete documentation index, see [llms.txt](https://ch-docs.aftermath.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ch-docs.aftermath.finance/nong-chang/jia-gou/bao-xian-ku.md).

# 保险库

### **保险库包** <a href="#bao-xian-ku-bao" id="bao-xian-ku-bao"></a>

此软件包提供了与保险库操作的接口。主要入口点是AfterburnerVault结构 —— 一个用户可以将类型为`Coin<STAKE>`的代币存入其中的保险库。。任意数量的奖励可以添加到保险库，并按照每个奖励发行计划定义的速率分配给抵押者。用户在进入保险库时可以锁定其位置以获得额外奖励。根据Strict实施情况，奖励随后可在任何间隔内领取；根据Relaxed实施情况，在锁定期结束后才能领取奖励。

### **严格 vs 宽松执行** <a href="#yan-ge-vs-kuan-song-zhi-hang" id="yan-ge-vs-kuan-song-zhi-hang"></a>

Afterburner 保险库允许用户锁定其位置，以利用乘数来获得更多奖励。然而，在快速变化的 DeFi 环境中，锁定资产的典型问题是可能会出现另一个更有利可图的机会，用户可能会错过这个机会。

为了解决这个问题，我们提出了 Vault 的宽松变体 —— 用户可以在锁定期结束前解除他们的位置。在这种情况下，用户只能收到因为该位置被锁定时段而获得的额外奖励。

相反地，Afterburner Vault 还设有严格版本 —— 用户只能在锁定期结束后才能解除并撤回他们的位置。

\~\~\~\~\~\~\~

对于严格执行，用户可以随时领取奖励。

对于宽松执行，用户只能在位置解锁后才能领取奖励。

\~\~\~\~\~\~\~

### 创建保险库 <a href="#chuang-jian-bao-xian-ku" id="chuang-jian-bao-xian-ku"></a>

使用 new\<STAKE> 的方法负责创建保险库。它创建一个没有发行的新保险库。其中一个参数是lock\_enforcement，它可以启用Strict（lock\_enforcement = 0）或Relaxed（lock\_enforcement = 1）类型的保险库的创建。在保险库被创建后，必须通过执行share\_vault函数来共享。

为了使一个保险库正常运作，奖励发行应该由保险库所有者初始化。这可以通过调用initialize\_reward\<STAKE, REWARD>方法来实现，该方法允许设置发行计划、发行速率和发行延迟。

\~\~\~\~\~\~\~\~

排放时间表 - 两次排放事件之间的时间间隔，以毫秒为单位。

发射率 - 发射事件中发射的硬币数量。

发射延迟 - 开始发射前的时间段。

\~\~\~\~\~\~\~\~

### **添加和增加奖励** <a href="#tian-jia-he-zeng-jia-jiang-li" id="tian-jia-he-zeng-jia-jiang-li"></a>

所有者可使用 add\_reward\<STAKE, REWARD> 方法向保险库添加额外奖励，或使用 increase\_emissions\_for\<STAKE, REWARD> 函数增加奖励排放。


---

# 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://ch-docs.aftermath.finance/nong-chang/jia-gou/bao-xian-ku.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.
