Tipping based User Rankings powered by OpenRank

Create a user ranking based on tipping activity of $degen (or any token) using OpenRank.

This guide demonstrates how tipping communities can leverage their tipping data (both on-chain and off-chain) to create user rankings and reputation. We use the $degen community as an example to generate rankings of the most trusted/valued users based on tipping activity.

Overview:

This process involves:

  1. Data Collection: Determining local trust and seed trust.

  2. Processing: Running EigenTrust using OpenRank

  3. Publishing: Sharing the generated rankings.

For a detailed walk-through, you can access the Hex notebook directly here.

Data Collection:

In this step, we will use Dune to source our Local trust (i,j,v) table and the pre trust table (i,v). If you are unsure of what these terms mean, you can learn more about eigentrust here.

  1. Local Trust (i,j,v)

    We are using this dune query to get all the tipping activity that has happened between users Here we have

    • i: Farcaster ID (FID) of the tipper

    • j: FID of the tip receiver

    • v: Tip amount

  2. Pretrust (Seed Peers) (i,v) We determine the pre-trust (seed peers) based on the users who have received the most tips. Here we have used:

    • i: FID of the most tipped user

    • v: Amount of tips received / total received sum

    Alternatively, all tippers can be used as seed peers with equal pre-trust scores. Access this pre-trust dataset for reference. You can view that pretrust here.

Running OpenRank

With the local trust and pre-trust data, we run the EigenTrust algorithm using the OpenRank SDK. Learn more about the eigentrust reference here.

Note: The Hex notebook and the accompanying picture may appear complex because the notebook includes various pre-trust assumptions to visualize how rankings change with each assumption. For simplicity, we will use the top 100 tip receivers as our pre-trust set and set the alpha (strength of pre-trust) to 0.5. You can read more about these parameters here.

The main steps here include:

  1. Local Trust Retrieval Store the local trust values (i, j, v) obtained in the data collection step into a variable, ensuring only records with tipping activity are included: l['v'] > 0.0 just makes sure only records with some tipping that has happened is taken into consideration.

  2. Pretrust Retrieval & Configuring Alpha Store the pre-trust data into a variable, ensuring trusted users have a trust score (v) greater than 0. The limit: function is added to make sure we only take the top 100 users into the pretrust.

  3. Running EigenTrust Here we first load alpha into EigenTrust and store the EigenTrust class in to a variable a a = EigenTrust(alpha=alpha) and then running the compute and storing it into the score variable score=a.run_eigentrust(localtrust, pretrust)

Publishing Rankings

With the scores variable containing the rankings, use the publishing methods in the SDK to share the results:

a.publish_eigentrust(eigentrust_id, scores) uploads the rankings generated into a s3 bucket and makes it available to download via the published_url

Visualize these rankings

Utilize the rankings in a Dune query to add additional information such as usernames and enhance visualization. This allows for easier interpretation and validation of the rankings.

Last updated

Logo

Copyright 2024