✂ī¸Moxie Everyday Rewards Split

Learn how you can fetch a certain FID's Moxie everyday rewards split between the user, their fans, the channel fans, and the Farcaster network.

By default Everyday Rewards earned from Casts and Frames by a member are split as follows:

  • 50% to the member who earned the reward

  • 20% to their Fans (holders of their Fan Tokens)

  • 20% to the Fans of the Channel casted into (holders of their Fan Tokens)

  • 10% to Fans of Farcaster overall (holders of the Fan Tokens)

This split can be modified by the address that is the subject of the Member Fan Token.

To learn more about the different split options and how it can impact Everyday Rewards distribution on the Moxie protocol, 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 Everyday Rewards Split Percentage Of A User

You can get the the current percentage of how much the user, their fans, the channel fans (if any), and the Farcaster network FT holders by using the FarcasterFanTokenAuctions API and providing the user's FID in the entityId field:

Try Demo

Show me the everyday rewards split of FID 602

Code

query MyQuery {
  FarcasterFanTokenAuctions(
    input: {
      filter: {
        entityId: {_eq: "602"}, # Specify FID here
        entityType: {_eq: USER}
      },
      blockchain: ALL
    }
  ) {
    FarcasterFanTokenAuction {
      rewardDistributionPercentage {
        channelFans
        creator
        creatorFans
        network
      }
    }
  }
}

Developer Support

If you have any questions or need help regarding fetching Everyday rewards split data, please join our Airstack's Telegram group.

More Resources

Last updated

Was this helpful?