Napier
WebsiteNapier InterfaceContributor Blog
  • Home
  • Introduction
  • Frequently Asked Question (FAQ)
  • Napier Protocol
    • Napier V1
    • Napier V2
      • Glossary - Napier v2
      • Yield Tokenization
        • Principal Token and Yield Token
        • Napier Factory
        • Market-Based Economics
        • Market-Based Governance
      • Trading Systems
      • Calculation
  • Points
    • Napier Point
    • Point Integration
    • Referral System
  • The NPR Token
  • Governance
    • Napier DAO
    • Napier Foundation
    • Napier Labs
    • Multisigs & Addresses
  • User Guide
    • User Dashboard
    • Mint and Redeem
    • Trade
    • Pool
    • Point
    • DeFi - Coming Soon
    • Calculator - Coming Soon
  • Curator Guide
    • Verify Your Account
    • Create a New Market
      • How to Choose a Resolver
    • Collect Curator Fee
    • Delegate Roles
    • Renounce All Roles
    • Transfer Full Ownership of a Market
    • Create a Pool Gauge
    • Integrate Your Market with a Point Program
    • Set up Reward Proxy
    • Add a Point Incentive
    • Monitor a Market
    • Emergency Pause a Market
    • Register DeFi Integrations - Coming Soon
    • Add a Token Incentive - Coming Soon
    • Educate Users - Coming Soon
    • Deploy a Lending System - Coming Soon
    • Deploy a Vault System - Coming Soon
  • Developer Guide
    • API
    • Deployment
  • Securing Napier
    • Technical Partners
      • How to Use HyperNative for Your Market Management
    • Bug Bounty
    • Risk Documentation
  • Education
    • User Education
    • Curator Education
  • Whitepaper
  • The Supreme Law of Napier
  • Marketing Policy
  • Napier Brand Guidelines
Powered by GitBook
On this page
  • Token Mechanism
  • Script Mechanism
  • How to Use the Script
  • Output Format
  • How to Verify Results
  1. Points

Point Integration

This guide explains how to track user positions in Napier markets and calculate their underlying token exposure to support points systems, airdrops, or reward campaigns

Token Mechanism

Napier users can interact with the protocol via:

PT (Principal Token)

  • Represents the principal portion of a yield position

  • Does not earn any points

  • Holds the underlying token

YT (Yield Token)

  • Represents the floating yield portion

  • Users earn points based on their proportional share of the underlying tokens stored in PT

LP Token

  • Represents liquidity in the Napier AMM (includes PT + YT)

  • LP holders earn points based on their share of the underlying tokens stored in the LP contract

Script Mechanism

You can track user balances and compute their total underlying exposure using our open-source integration script.

The script:

  1. Fetches balances for YT and LP holders of the configured market at certain block number

  2. Calculates each user's underlying token exposure

    1. For YT → it’s based on underlying stored in the PT contract

    2. For LP → It’s based on underlying stored in the pool

  3. Aggregates and exports the result to a CSV file

How to Use the Script

1. Clone & install dependencies

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

2. Configure src/configuration.ts

Available config are:

  1. chainId of your market

  2. markets is the pt addresses of the market you want to snapshot

  3. blockNumber the block number of the snapshot period

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

Finding address

You can use the Napier Interface (app.napier.finance) to find address of your market

3. Run the Script

pnpm start

4. Examine the output

Output of the script is generated as csv with the filename below

user_balances_lp.csv
user_balances_yt.csv

Output Format

The script generates two CSV (one for LP and one for YT) formatted like this:

address,balances
0x1234...abcd, 3524219
0xabcd...5678, 1980132

Each row represents a user address and their total underlying exposure (from YT or LP).


How to Verify Results

You can verify a user's calculated exposure manually:

YT Verification

Formula

underlying.balanceOf(pt) * yt.balanceOf(user) / yt.totalSupply()

Checking via etherscan

  1. Check the underlying holding of PT contract

  2. Using value above we can calculate

underlying proportion = 16.2994% * 1,008,799 = 164,428.184206

LP Verification

Formula

underlying.balanceOf(lp) * lp.balanceOf(user) / lp.totalSupply()

Checking via etherscan

  1. Check the underlying holding of LP contract

  2. Using value above we can calculate

underlying proportion = 15.5851% * 1,102,728 = 171.861,261528

Post Maturity

Once a market matures:

  • YT no longer accrues yield

  • Points tracking should stop

PreviousNapier PointNextReferral System

Last updated 1 month ago

Go to P and install the dependency

Open the PT address (e.g )

Check the user proportion on holders tab (e.g )

Open the Pool address (e.g )

Check the user proportion on holders tab (e.g )

oint Integration Example
https://etherscan.io/address/0x8eb9f9e97d6a63aab7572ad0d96fa3f09255cce9
https://etherscan.io/token/0x7fd578D6d91487d4B699069766Fe440fc6524Ea1#balances
https://etherscan.io/address/0x7c0b6cd399a225618d98c7faf3de1f99848c18b3
https://etherscan.io/token/0x7c0b6cd399a225618d98c7faf3de1f99848c18b3#balances
GitHub - napierfi/point-integration-exampleGitHub
Logo