Points Tracking
For regular on-chain reward claims, IP-Vault can handle them automatically. However, for rewards in the form of Points calculated off-chain, the following method is required for integration.
Mechanism
IP-Vault comprises PT and YT. PT represents users’ shares of the underlying assets, while all additional rewards generated by these assets, such as profits or points, are fully distributed to YT users. Unlike Pendle’s mechanism, in IP-Vault, YT users’ rewards are determined by their YT share proportion, not the quantity.
Points Tracking Method
This method applies to continuous point issuance, such as protocols that distribute points based on TVL daily or per hour/block. IP-Vault’s TVL earns points in the protocol’s system, and these points should be passed through to users, not retained by IP-Vault. The implementation is as follows:
Wand provides a JSON file
https://story-api.wandfi.io/api/third/points/:vaultaddress/:block
Inputs the relevant parameter to query the JSON file for the user list and their YT balances at that block. The data structure is as follows:
{ data: { address: string, balance: string }[], timestamp: number}
Abnormal state description:
400: Vault not started
404: Vault has not been created in this block yet
500: Needs to wait for server indexing data
Sum all YT balances to calculate the total YT Amount.
Calculate a user’s YT Share:
YT Share = User’s YT Balance / YT Amount
Determine the Total Points allocated to IP-Vault for the period.
Calculate points for each user:
User Points = Total Points × YT Share
Repeat these steps for each point issuance period, accumulating user points over time.
Last updated