> For the complete documentation index, see [llms.txt](https://docs.interestprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.interestprotocol.com/overview/deprecated/clamm/hooks.md).

# Hooks

### <mark style="color:blue;">Design</mark>

Hooks follow the same design principle as Sui's  [Kiosk transfer policy](https://github.com/MystenLabs/sui/blob/main/crates/sui-framework/packages/sui-framework/sources/kiosk/transfer_policy.move). It allows developers to enforce rules to pools. The rules are completed by calling the rule's module and collecting its witness. Rules can be anything from custom oracles to fee on swap.

### <mark style="color:blue;">Hooks</mark>

The **CLAMM** supports 8 hooks:

* <mark style="color:blue;">Start Swap:</mark> This hook must be completed before a swap transaction.
* <mark style="color:blue;">Finish Swap:</mark> A swap transaction must fulfill this hook to finish.
* <mark style="color:blue;">Start Add Liquidity:</mark> This hook must be completed before a user adds liquidity.
* <mark style="color:blue;">Finish Add Liquidity:</mark> A transaction to add liquidity must fulfill this hook to finish.
* <mark style="color:blue;">Start Remove Liquidity:</mark> This hook must be completed before a user removes liquidity.
* <mark style="color:blue;">Finish Remove Liquidity:</mark> A transaction to remove liquidity must fulfill this hook to finish.
* <mark style="color:blue;">Start Donate:</mark> This hook must be completed before a swap transaction.
* <mark style="color:blue;">Finish Donate:</mark> A swap transaction must fulfill this hook to finish.

Pools are not required to have hooks and a pool can have a Start Swap hook without a Finish Swap hook. Hooks are set at deployment and cannot be changed afterwards.

### <mark style="color:blue;">Examples</mark>

We will provide a set of standard hooks that will be automatically resolved via the SDK. Please refer to them on how to use your own hooks!

<https://github.com/interest-protocol/hooks>
