This article shows how to get onchainindividual rewards
Fuul simplifies blockchain data for you. We take complex onchain information, clean it up, and present it in a format that's more readable. Projects then can choose to get the data from Fuul's indexed data, or directly from the subgraph.
Fuul's Indexed Data
Payouts for a specific Address
Rewards data is not updated in real time due to performance considerations. Recent conversions and payouts will appear on the leaderboard within a maximum of one hour.
To get the rewards use the getPayoutsLeaderboard method filtered by user address.
import { Fuul } from ('@fuul/sdk');
await Fuul.getPayoutsLeaderboard({
currency_address: '0x12345',
user_address: '0x12345' ,
from: new Date('2021-01-01'), // Optional
to: new Date('2022-01-01'), // Optional
user_type: 'all', // all, affiliate or end_user
conversions: '1,2,3' // Optional
});
currency_address is the address of the currency on the chain that the project is distributing payouts. Remember projects can payout different tokens for different conversions.
A simple response for retrieving this information would be the following:
import { Fuul } from ('@fuul/sdk');
await Fuul.getUserPayoutsByConversion({
user_address: '0x12345',
from: new Date('2021-01-01'),
to: new Date('2022-01-01'),
});
A simple response for retrieving this information would be the following:
Every payout reward has an onchain record on the project's FuulProject contract. This information can be retrieved from any indexer, but using our aggregated subgraphs makes it much easier.
To get the total, claimed and unclaimed rewards for a specific user and Fuul projects, use the following query.