🚀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.

As of 3 October, 2024, FarScores do not factor in follows from users who have not been active on Farcaster in the previous 60 days, on a rolling basis.

Every 1 point on FarBoosts is earned by contributing 100,000 Moxie into your total locked value (TVL) into the Moxie protocol or providing 100,000 Moxie into the Liquidity Pool (Uniswap v2 & Aerodrome).

Additionally, you can also earn 1.2 point on FarBoosts by for every 100,000 Moxie worth of Fan Token is locked into the Moxie Staking contract for at least 3 months.

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

npm install @airstack/airstack-react

Node

npm install @airstack/node

Then, add the following snippets to your code:

import { init, useQuery } from "@airstack/airstack-react";

init("YOUR_AIRSTACK_API_KEY");

const query = `YOUR_QUERY`; // Replace with GraphQL Query

const Component = () => {
  const { data, loading, error } = useQuery(query);

  if (data) {
    return <p>Data: {JSON.stringify(data)}</p>;
  }

  if (loading) {
    return <p>Loading...</p>;
  }

  if (error) {
    return <p>Error: {error.message}</p>;
  }
};

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

Show me the FarScore of FID 3

Code

query MyQuery{
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "3"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        farScore # Get the FarScore here
      }
    }
  }
}

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 organicFarScore field:

Try Demo

Show me the organic FarScore of FID 3

Code

query MyQuery{
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "3"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        organicScore
      }
    }
  }
}

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 organicScore field:

Try Demo

Show me the total and organic FarScore of FID 3

Code

query MyQuery{
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "3"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        farScore
        organicScore
      }
    }
  }
}

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

Show me the FarRank of FID 3

Code

query MyQuery{
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "3"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        farRank
      }
    }
  }
}

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 to get all the boost variables:

Try Demo

Show me the Farboost of FID 3

Code

query MyQuery{
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "3"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        lpBoost
        tvlBoost
        powerBoost
      }
    }
  }
}

By adding up the LP boost, TVL boost, and power boost, you'll get the total Farboost of a user.

Get The FarBoost Of A User Gained From Providing Liquidity to DEXs (Also referred to as LP Boost)

You can get the Liquidity Boost, that is the FarBoost of a user gained from providing liquidity to DEXs, by using the Socials API and inputting the user's FID in userId input:

Try Demo

Show me the Liquidity Boosts of FID 6500

Code

query MyQuery {
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "6500"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        lpBoost
      }
    }
  }
}

Get The FarBoost Of A User Gained Only From TVL

You can get the TVL Boost, that is 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

Show me the TVL Boosts of FID 3

Code

query MyQuery{
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "3"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        tvlBoost
      }
    }
  }
}

Get The FarBoost Of A User Gained From Locking Fan Tokens (Moxie Power Boost)

You can get the Moxie Power Boost by using the Socials API and inputting the user's FID in userId input:

Try Demo

Show me the Moxie Power Boost of FID 602

Code

query MyQuery {
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "602"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      realTimeFarScore {
        powerBoost
      }
    }
  }
}

Get The Moxie Hero Multiplier Of A User

You can get the Moxie Hero Multiplier by using the Socials API and inputting the user's FID in userId input and first getting the Moxie Hero Boost:

Try Demo

Show me the Moxie Hero Boost of FID 488178

Code

query MyQuery {
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "488178"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      userId
      profileName
      farcasterScore {
        farBoost
        farRank
        farScore
        farScoreRaw
        heroBoost
        liquidityBoost
        powerBoost
        tvl
        tvlBoost
      }
    }
  }
}

Once you get the Moxie Hero boost of the user, you can use the formula here to get the multiplier.

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

Show me the TVL of FID 3

Code

query MyQuery{
  Socials(
    input: {
      filter: {
        dappName: {_eq: farcaster},
        userId: {_eq: "3"}
      },
      blockchain: ethereum
    }
  ) {
    Social {
      farcasterScore {
        tvl
      }
    }
  }
}

The value returned in tvl will be in wei. Therefore, you should divide the number by 10^18 to get the real value.

Get Top Farcaster Users Sorted By Their Total FarScores

You can get the top Farcaster users sorted by their total Farscores by using the FarScores API and configure the API to sort by farScore in descending order:

Try Demo

Show me top Farcaster users sorted by their total FarScores

Code

query MyQuery {
  FarScores(
    input: {
      filter: {},
      limit: 200,
      order: {farScore: DESC}
    }
  ) {
    FarScore {
      farScore
      social {
        profileName
        fid: userId
      }
    }
  }
}

Get Top Farcaster Users Sorted By Their Organic FarScores

You can get the top Farcaster users sorted by their organic Farscores by using the FarScores API and configure the API to sort by organicScore in descending order:

Try Demo

Show me top Farcaster users sorted by their organic FarScores

Code

query MyQuery {
  FarScores(
    input: {
      filter: {},
      limit: 200,
      order: {organicScore: DESC}
    }
  ) {
    FarScore {
      organicScore
      social {
        profileName
        fid: userId
      }
    }
  }
}

Get Top Farcaster Users Sorted By Their TVL Boost

You can get the top Farcaster users sorted by their TVL boost by using the FarScores API and configure the API to sort by tvlBoost in descending order:

Try Demo

Show me top Farcaster users sorted by their TVL Boost

Code

query MyQuery {
  FarScores(
    input: {
      filter: {},
      limit: 200,
      order: {tvlBoost: DESC}
    }
  ) {
    FarScore {
      tvlBoost
      social {
        profileName
        fid: userId
      }
    }
  }
}

Get Top Farcaster Users Sorted By Their Liquidity Boost

You can get the top Farcaster users sorted by their Liquidity Boost by using the FarScores API and configure the API to sort by lpBoost in descending order:

Try Demo

Show me top Farcaster users sorted by their Liquidity Boost

Code

query MyQuery {
  FarScores(
    input: {
      filter: {},
      limit: 200,
      order: {lpBoost: DESC}
    }
  ) {
    FarScore {
      lpBoost
      social {
        profileName
        fid: userId
      }
    }
  }
}

Get Top Farcaster Users Sorted By Their Power Boost

You can get the top Farcaster users sorted by their Power Boost by using the FarScores API and configure the API to sort by powerBoost in descending order:

Try Demo

Code

query MyQuery {
  FarScores(
    input: {
      filter: {},
      limit: 200,
      order: {powerBoost: DESC}
    }
  ) {
    FarScore {
      powerBoost
      social {
        profileName
        fid: userId
      }
    }
  }
}

Get All The Current Moxie Heroes

You can get the Farcaster users that are currently Moxie Heroes by using the FarScores API and configure the API by setting the heroBoost filter to greater than 0 to only fetch those with Hero boost:

Try Demo

Code

query MyQuery {
  FarScores(
    input: {
      filter: {
        # Only get user that have hero boost
        heroBoost: {_gt: 0}
      },
      limit: 200
    }
  ) {
    FarScore {
      farScore
      heroBoost
      social {
        profileName
        fid: userId
      }
    }
  }
}

Developer Support

If you have any questions or need help regarding fetching FarScore & FarBoosts data, please join our Airstack's Telegram group.

More Resources

Last updated

Was this helpful?