> For the complete documentation index, see [llms.txt](https://pancakeswap.gitbook.io/pancakeswap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pancakeswap.gitbook.io/pancakeswap/chinese/jiao-yi/pancakeswap-infinity/hooks/shared-inventory-hook.md).

# Shared Inventory Hook

PancakeSwap 官方的 Shared Inventory Hook（SIH）旨在让同一份资金在所有共享相同代币的资金池中做市，而不必为每个资金池分别锁定流动性。它为交易者提供更深的报价和更低的价格影响，同时让流动性提供者以更少的资金获得同样的覆盖范围。

该 Hook 由 PancakeSwap 核心团队打造，专为希望在链上为多个交易对报价、又不想分散自身库存的资产发行方和做市商量身定制。

#### 🔍 为什么选择共享库存？

按传统方式为多个交易对提供流动性，意味着要把专用资金锁定在各个独立的资金池中，而这些资金大部分时间都在交易间隙闲置。SIH 则为每种代币只持有一份余额，仅在兑换需要时才将其作为流动性注入，因此同一份资金可以支持所有共享该代币的资金池。

#### 📊 它与其他模式有何不同？

传统的集中流动性要求把全部本金投入单一资金池。其他跨池方案（例如虚拟余额结算层）通常位于 AMM 本身之外，其流动性可能无法显示为链上资金池深度，也无法被聚合器直接路由。

SIH 的流动性在每次兑换时由 Hook 进出 PancakeSwap Infinity CLAMM 资金池，因此它会显示为真实的资金池深度，路由器可以看到并据此成交。

#### ⚙️ 工作原理

* **即时（JIT）注入**\
  每次兑换之前，Hook 会向资金池铸造一个已配置的集中流动性头寸；兑换执行后，它会销毁该头寸并结算净结果。该头寸仅在一次兑换期间存在，余额可以立即用于下一个需要它的资金池。
* **一份余额，多个资金池**\
  库存即 Hook 自身的代币余额，无需为每个资金池单独存入。任何需要用于多个资金池的代币都会在所有这些资金池之间共享。

{% hint style="success" %}
这使资金池所报价的深度与池内直接持有的资金脱钩：一个已注资的 Hook 可以在共享同一种代币的多个资金池中提供深度大、价差小的流动性。
{% endhint %}

* **可配置的 Hook**\
  对于它服务的每个资金池，Hook 都持有一份可调整的、独立的价格区间和深度配置。移动区间只需更新配置，因此可以轻松地围绕不断变动的参考价格重新校准报价。

#### 📌 核心要点

* 一份共享的代币余额支持所有使用该代币的资金池。新增资金池无需动用新的本金。
* 完全链上且可组合：SIH 的流动性是真实的资金池深度，PancakeSwap 和第三方聚合器都可以路由。
* 交易者可获得更深的报价，大额交易的价格影响更低；运营者只需传统方式所需资金的一小部分，即可赚取同样的交易手续费。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://pancakeswap.gitbook.io/pancakeswap/chinese/jiao-yi/pancakeswap-infinity/hooks/shared-inventory-hook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
