đFarScores & FarBoosts
Learn how to fetch the FarScores, FarBoosts, FarRank of a Farcaster member. In addition, you can also fetch a user's TVL and how much it impacts a member's FarBoosts.
Every Farcaster Member earns a FarScore based on their relative influence in the Farcaster network and each FarScore user can be increased by earning FarBoosts, which consequently can also increase a Farcaster Member's FarRank.
Every 1 point on FarBoosts is earned by contributing 100,000 Moxie into your total locked value (TVL) to the Moxie protocol.
To learn more about FarScores & FarBoosts, click here.
Table Of Contents
Pre-requisites
An Airstack API key. To access this, you'll need to hold at least 1 /airstack Channel Fan Token.
Basic knowledge of GraphQL
Get Started
JavaScript/TypeScript/Python
If you are using JavaScript/TypeScript or Python, Install the Airstack SDK:
React
Node
Then, add the following snippets to your code:
Other Programming Languages
To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.
Get The FarScores Of A User
You can get the FarScores of a user by using the Socials
API and inputting the user's FID in userId
input:
Try Demo
Code
Get The FarScores Of A User Without Any FarBoosts
You can get the original FarScores of a user without any FarBoosts by using the Socials
API and inputting the user's FID in userId
input to fetch the farScore
and farBoost
field:
Try Demo
Code
To get the original FarScore without any FarBoosts, simply substract farScore
to farBoost
.
Get The Percentage Of Increase Of User's FarScore From FarBoosts
You can get the percentage of increase from FarBoosts by using the Socials
API and inputting the user's FID in userId
input to fetch the farScore
and farBoost
field:
Try Demo
Code
To get the percentage of increase, simply divide farBoost
by farScore
and multiply it by 100%.
Get The FarRank Of A User
You can get the FarRank of a user by using the Socials
API and inputting the user's FID in userId
input:
Try Demo
Code
Get The FarBoost Of A User
You can get the FarBoost of a user by using the Socials
API and inputting the user's FID in userId
input:
Try Demo
Code
Get The FarBoost Of A User Gained Only From TVL
You can get the FarBoost of a user gained only from TVL by using the Socials
API and inputting the user's FID in userId
input:
Try Demo
Code
Get The TVL Of A User
You can get the TVL of a user in the Moxie protocol by using the Socials
API and inputting the user's FID in userId
input:
Try Demo
Code
The value returned in tvl
will be in wei. Therefore, you should divide the number by 10^18 to get the real value.
Developer Support
If you have any questions or need help regarding fetching Moxie earnings data, please join our Airstack's Telegram group.
More Resources
Last updated
Was this helpful?