Skip to content

Fracticality-Protocol/pointsSystem

Repository files navigation

Points system service

This service is responsible for distributing points to our users to incentivize the usage of our protocol.

The points system will have 2 stage. Right now, this system implements the first stage, which is meant to bootstrap the TVL of the vault and reward early users.

Stage 1 involves distributing a certain amount of points to users based on their percentage of the total assets in the system.

The points distributed daily can either be a fixed amount, or decay linearly over time. The decay is based on 2 points: (startTime, initialDailyPoints) and (endTime, 0). These points get stored on the database and are used to calculate the daily point pool for a given day. The end point can also be changed, in case we want to change the points distribution over time.

Pseudocode for points distribution:

  • Get all users. This is done by looking at 2 events on subgraph, to transfers and also deposits, the 2 ways users can get tokens.
  • Get the current vault assets of the vault.
  • Get the users's current assets amount. This is done by looking at each user's current share balance and then converting them to the underlying asset via convertToAssets().
  • Calculate the users's percentage of the total assets in the system.
  • Use the percentage to calculate the points the user should receive for that day.

Risks/Concerns:

  • This needs to have the pnl reporting to be working perfectly as we're using the exchange rate of the shares to assets to calculate the users's percentage of the total assets in the system.

About

Microservice for points system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •