> For the complete documentation index, see [llms.txt](https://docs.peach.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peach.ag/documentation/arc/launchpad/launchpad-classic/core-features/uniswap-v4-hooks/partner-and-hookdata.md). Agents can also search and read this documentation through its [MCP server](https://docs.peach.ag/~gitbook/mcp).

# Partner and hookData

Hook Partner attribution selects a registered Partner's share of the protocol portion of the Hook Fee. It does not add a separate user fee. The Partner is identified by a `bytes32` ID, not a recipient address, referral string or Aggregator custom-fee receiver.

#### Encoding

| Input              | Exact bytes                                 | Meaning                                                |
| ------------------ | ------------------------------------------- | ------------------------------------------------------ |
| No Partner         | `0x`                                        | No Partner attribution                                 |
| Zero Partner ID    | 32 zero bytes from `abi.encode(bytes32(0))` | Also no Partner attribution                            |
| Registered Partner | `abi.encode(partnerId)`; exactly 32 bytes   | Resolve Partner and apply current enabled/policy state |

```ts
import { encodeLaunchpadPartnerHookData } from "@masterpeach/launchpad-sdk";

const hookData = encodeLaunchpadPartnerHookData(partnerId);
const noPartner = encodeLaunchpadPartnerHookData(); // "0x"
```

Use your registered `partnerId`. The SDK encodes it as one ABI bytes32 value; an omitted or zero ID produces empty bytes. Read the registry before quoting and simulate with the same bytes that will be sent. Encoding does not establish whether a Partner is registered or enabled.

#### Registry state and failure behavior

At `0xcbAEf9E31D5be62CD084CC41EE20388D3f712A01`, read `partner(bytes32)` for `(name, controller, recipient, shareOfPlatformBps, exists, enabled)` and `partnerPolicy()` for `(defaultPartnerShareOfPlatformBps, maxPartnerShareOfPlatformBps)`. Use the deployed ABI when constructing these reads; policy and rates can change between simulation and mining.

| Condition                                    | Current behavior                                                       |
| -------------------------------------------- | ---------------------------------------------------------------------- |
| Empty or zero ID                             | Swap has no Partner allocation                                         |
| Non-empty data of length other than 32 bytes | `InvalidConfiguration`                                                 |
| Unknown nonzero ID                           | `PartnerNotFound` when fee allocation resolves that ID                 |
| Existing but disabled Partner                | Swap may proceed; Partner share is zero                                |
| Enabled Partner whose share exceeds policy   | `PartnerShareTooHigh`                                                  |
| Disabled Partner attempting to claim         | `PartnerDisabled`; existing balance stays in Escrow                    |
| Wrong claim caller                           | `NotPartnerRecipient`; only the current registered recipient can claim |

Do not treat disabled as deleted. Settlement can still credit an existing disabled Partner; claiming is gated at claim time. Re-enabling or changing the registered recipient affects who can later claim the Partner ledger. Never replace a rejected ID silently with a different revenue recipient.

#### Supported entry points

| Entry point                                         | Can set this Hook's hookData?                                           |
| --------------------------------------------------- | ----------------------------------------------------------------------- |
| Current Arc Aggregator HTTP swap / prepare / build  | No Partner hookData parameter; adapter sends empty bytes                |
| Direct Router with an explicit forwarding parameter | Yes, if its deployed implementation forwards it unmodified              |
| Hook's own conversion/buyback                       | Internal self-swap exemption; not a third-party attribution entry point |

`customFeeBps` and `customFeeReceiver` charge an Aggregator output fee under a signed execution plan. Hook Partner fees are deducted from the Hook protocol allocation and credited by Partner ID through the Hook/Escrow settlement process. They have different configuration, accounting and claim paths. See [Hook fee arithmetic](https://docs.peach.ag/documentation/arc/launchpad/launchpad-classic/core-features/uniswap-v4-hooks/hook-behavior-and-fees) and [Aggregator fees](https://docs.peach.ag/documentation/arc/aggregator/core-features/custom-fee-and-slippage).


---

# 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://docs.peach.ag/documentation/arc/launchpad/launchpad-classic/core-features/uniswap-v4-hooks/partner-and-hookdata.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.
