> 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/zhi-ya-tou-cun.md).

# 质押头寸

### 质押头寸**包** <a href="#zhi-ya-tou-cun-bao" id="zhi-ya-tou-cun-bao"></a>

该包提供了与抵押头寸操作相关的接口。主要入口点是StakedPosition结构。

### **开仓** <a href="#kai-cang" id="kai-cang"></a>

用户可以使用持仓功能开仓。开仓时，用户必须指定以毫秒为单位的锁定持续时间。锁定持续时间应遵守在配置 Afterburner Vault 时设定的界限。

锁定的仓位将根据配置的 Afterburner Vault 倍率获得奖励。

### **收获奖励** <a href="#shou-huo-jiang-li" id="shou-huo-jiang-li"></a>

奖励收获是一个三阶段的过程：

1. 用户必须调用 begin\_harvest 函数；
2. 对于每个奖励，用户应该调用 harvest\_rewards\<STAKE, REWARD> 函数。这将允许用户获取已累积的类型为 `Coin<REWARD>` 的奖励；
3. 要完成流程，用户必须调用 end\_harvest 函数，该函数会发出相应的事件。

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

对于宽松执行，只有在位置解锁后才能领取他们的奖励。

### **增加赌注** <a href="#zeng-jia-du-zhu" id="zeng-jia-du-zhu"></a>

在任何时刻，用户可以使用deposit\_principal函数来增加仓位的抵押金额。在增加锁定仓位的押金后，将重新计算锁定期。

### **撤回赌注** <a href="#che-hui-du-zhu" id="che-hui-du-zhu"></a>

用户可以使用withdraw\_principal函数提取已抵押的本金。必须解锁仓位才能从中撤回。

在锁定期结束前，无法解锁在Strict Afterburner保险库中锁定的仓位。

### **延长仓位锁定期** <a href="#yan-chang-cang-wei-suo-ding-qi" id="yan-chang-cang-wei-suo-ding-qi"></a>

用户可以使用 renew\_lock 函数延长锁定期。

### **合并仓位** <a href="#he-bing-cang-wei" id="he-bing-cang-wei"></a>

用户可以使用 join 函数合并两个位置。合并后的位置将拥有最近的锁定开始时间和两个位置之间较长的锁定时间。

### **分割仓位** <a href="#fen-ge-cang-wei" id="fen-ge-cang-wei"></a>

用户可使用 split 功能将一个位置一分为二。累积奖励将在两个仓位之间分配，分配比例为按比例分配的金额与总赌注金额之比。所有其他参数均与原始仓位保持一致。

### **关闭仓位** <a href="#guan-bi-cang-wei" id="guan-bi-cang-wei"></a>

用户可以使用 destroy 功能删除一个不活动的仓位。销毁的仓位必须没有任何剩余本金或奖励。


---

# 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/zhi-ya-tou-cun.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.
