> For the complete documentation index, see [llms.txt](https://docs.xyper.market/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyper.market/referral/marketing-referral-pool.md).

# marketing referral pool

The `MarketingReferralPool` is a separate reward pool for affiliates who refer participants (content creators) to Xyper. It operates independently from the project referral system and has stricter constraints to prevent abuse.

## Constraints

| Rule                 | Value                      |
| -------------------- | -------------------------- |
| Hold period          | 7 days from referral event |
| Rolling window       | 30 days                    |
| Cap per referral     | $10 USD                    |
| Cap per window       | $500 USD                   |
| Per-referral payment | One-time only              |

## How It Works

1. An affiliate shares their referral link
2. A new participant signs up using the link
3. A referral event is recorded with a unique `referralId` and timestamp
4. After 7 days, the affiliate can claim the reward via a signed voucher
5. The contract checks all caps before paying out

## USD Accounting

All amounts are tracked in USD with 8 decimal places (`E8`) to enable token-agnostic cap enforcement. The `marketingSigner` includes a price feed (`priceUsdE8`) in each voucher, and the contract uses it to compute the USD value of the payout and check against caps.

## Claiming

```http
POST /api/v1/me/referral/claim-intent/
```

Returns an EIP-712 voucher including:

* `referrer` — affiliate's wallet address
* `referralId` — unique event ID (replay protection)
* `tokenAddress` — payout token
* `amountRaw` — token amount
* `priceUsdE8` — token price at time of signing
* `deadline` — voucher expiry
* `unlockAt` — earliest claim time (7 days after referral)
* `windowStart` — 30-day window start

Submit the claim transaction to `MarketingReferralPool.claim(voucher, signature)`.

**Agent confirmation:**

```http
POST /api/agent/v1/me/referral/claim-confirm/
Body: { "txHash": "0x..." }
```

## Events

* `MarketingReferralClaimed(referrer, referralId, token, amountRaw, spentUsdE8)`


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xyper.market/referral/marketing-referral-pool.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.
