# Partner Points Integration

{% hint style="info" %}
This guide explains how to calculate a position’s exposure for points programs in Napier markets.

I**f you’re a curator:** you can share this guide directly with asset issuers.
{% endhint %}

Follow the steps below to integrate Napier tokens with your point system.

{% stepper %}
{% step %}

### Step 1: Preparation

#### Before the integration

* Access the **Curator Dashboard**.
* If your account is not verified, complete verification under **Verify Your Account**.
* If you haven’t created a market yet, follow the steps in **Create Market**.

#### Start the integration

Measure each user’s **underlying token exposure** to run points, airdrops, or rewards.

{% hint style="info" %}
**Tokens:**

* **PT (principal):** holds the underlying; **no points** by itself.
* **YT (yield):** points come from your share of the **underlying held in PT**.
* **LP (AMM liquidity):** there are two possible cases - points can be earned either from the **entire LP** or only from the **portion of the LP excluding PT**.

**Note:** Whether points are earned from the entire LP or only from the portion excluding PT depends on the program operator’s policy. Make sure to confirm this before proceeding.
{% endhint %}

Go to the point integration example ([Github)](https://github.com/napierfi/point-integration-example) and install the dependency

```bash
git clone <https://github.com/napierfi/point-integration-example>
cd point-integration-example
pnpm install
```

{% endstep %}

{% step %}

### Step 2: Configuration

#### Edit `src/configuration.ts`:

```tsx
export const configuration = {
  chainId: 1,
  markets: ['0x8eb9f9e97d6a63aab7572ad0d96fa3f09255cce9'],
  blockNumber: 22160745,
};
```

* Use **PT addresses** (not LP or YT).
* Find your market’s PT on app.napier.finance.
* Double-check `chainId` and the snapshot `blockNumber`.
  {% endstep %}

{% step %}

### Step 3: Execution

#### Run the Script

```tsx
pnpm start
```

This creates:

* `user_balances_yt.csv` — exposure from YT
* `user_balances_lp.csv` — exposure from LP (non-PT portion of LP)

Each CSV row:

```tsx
address,balances
0x1234...abcd, 3524219 // LP (non-PT portion of LP)
0xabcd...5678, 1980132 // YT 
```

\= user address and their total **underlying exposure** at the snapshot block.
{% endstep %}

{% step %}

### Step 4: Verification

Verify a user's calculated exposure manually:

* **YT exposure:** `underlying.balanceOf(PT) × yt.balanceOf(user) ÷ yt.totalSupply()`
* **LP exposure:** `underlying.balanceOf(pool) × lp.balanceOf(user) ÷ lp.totalSupply()`

{% hint style="info" %}
**Quick Etherscan check**

1. Open the PT address (e.g <https://etherscan.io/address/0x8eb9f9e97d6a63aab7572ad0d96fa3f09255cce9>)
2. Read the underlying holding of PT contract.
3. See the user’s share under **Holders** (e.g <https://etherscan.io/token/0x7fd578D6d91487d4B699069766Fe440fc6524Ea1#balances>)
4. Apply the formula.
   {% endhint %}

{% hint style="info" %}
**After maturity:** YT stops accruing yield → **stop points tracking** for that market.
{% endhint %}
{% endstep %}

{% step %}

### Step 5: Notify Users

Go back to the [Partner Points Program](/curate/napier-curation/manage-market/partner-points-program.md), display the points program in the UI, and notify users.
{% endstep %}
{% endstepper %}


---

# 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.napier.finance/curate/napier-curation/manage-market/partner-points-integration.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.
