> 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/partners.md).

# Partners

Attribute trades to a Partner and claim settled Partner fees.

### Attribute a trade

Use your registered `partnerId` on each trade. Partners earn a share of the base platform fee; current Registry rates apply to new trades.

```ts
const usability = await client.getPartnerUsability(partnerId);
```

Handle usability and earnings separately:

<table data-header-hidden><thead><tr><th width="177"></th><th width="92"></th><th width="102"></th><th></th></tr></thead><tbody><tr><td><code>partnerId</code></td><td><code>usable</code></td><td><code>earning</code></td><td>Effect</td></tr><tr><td><code>bytes32(0)</code></td><td>yes</td><td>no</td><td>Trades normally, no attribution</td></tr><tr><td>Registered, disabled</td><td>yes</td><td>no</td><td>Trades normally, still logged, earns nothing</td></tr><tr><td>Non-zero, unregistered</td><td><strong>no</strong></td><td>no</td><td><strong>The whole trade reverts</strong></td></tr></tbody></table>

An enabled, registered Partner is usable and earns fees. A disabled Partner remains usable for trading but earns no new fees. Check `getPartnerUsability` before displaying a referral incentive.

Pass `partnerId` to `prepareBuy` or `prepareSell`. For Uniswap V4 swaps, use `encodeLaunchpadPartnerHookData`; empty bytes means no Partner. Invalid encoding or an unregistered nonzero ID reverts.

### Claim Partner fees

Only the current recipient in the Partner Registry can claim. Disabled Partners keep their balances but cannot claim until re-enabled. A recipient change transfers access to the entire unclaimed balance.

```ts
const partner = await client.getPartner(partnerId);
const balance = await client.getPartnerClaimableBalance({ partnerId, asset });
// Connect partner.recipient and confirm partner.enabled before claiming.
const claim = await client.preparePartnerClaim({ partnerId, asset });
const claimHash = await client.send(claim);
const result = await client.wait(claimHash, { confirmations: chain.confirmations });
if (result.status !== "confirmed") throw new Error("Partner claim reverted");
const updatedBalance = await client.getPartnerClaimableBalance({ partnerId, asset });
```

### Track pending earnings

V4 settlement may convert only part of a Partner’s fees. Unconverted balances carry into the next epoch and remain pending. Keep pending and claimable amounts separate in the earnings view.

### Direct contract calls

Read PartnerRegistry.partner(bytes32 partnerId) → PartnerConfig for the controller, recipient, fee share, existence and enabled status; partnerPolicy() → PartnerPolicy exposes the default and maximum shares. SDK Partner reads and claims use these same contracts.

* `FeeEscrow.partnerBalance(bytes32 partnerId, address asset) → uint256` and `claimPartner(bytes32 partnerId, address asset) → uint256 amount`: read and claim Partner revenue. Claim caller must be the current registered recipient; disabling the Partner freezes claims.

For curve trades, use the five-argument buyExactIn / sellExactIn overload with partnerId. Zero bytes32 means no Partner; unknown nonzero IDs revert, while a known disabled Partner earns no trade share. For V4, use the hookData rules in the dedicated Hook guide.


---

# 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/partners.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.
