# 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>


---

# 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://docs.interestprotocol.com/overview/deprecated/clamm/hooks.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.
