Skip to content

Commit 201c8c7

Browse files
committed
add token holder revenue
1 parent 1d1d8b9 commit 201c8c7

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

fees/flashtrade.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ interface Pool {
88
paid: string;
99
}
1010

11-
const methodology = {
12-
Fees: 'Sum of all fees accrued from LP pools.',
13-
ProtocolReveneue: '30% of all the fees accrued excluding Community pool.'
14-
}
15-
1611
const urlDailyStats = "https://api.prod.flash.trade/market-stat/revenue-24hr";
1712

1813
const calculateProtocolRevenue = (stats: Pool[]) => {
@@ -26,14 +21,23 @@ const fetchFlashStats = async (_: number): Promise<FetchResultFees> => {
2621
const dailyStats: Pool[] = dailyStatsResponse;
2722
const dailyAccrued = dailyStats.reduce((sum, item) => sum + parseFloat(item.accured), 0);
2823
const dailyProtocolRevenue = calculateProtocolRevenue(dailyStats);
24+
const dailyRevenue = dailyProtocolRevenue * 2;
2925

3026
return {
31-
dailyFees: dailyAccrued.toString(),
32-
dailyRevenue: dailyProtocolRevenue.toString(),
33-
dailyProtocolRevenue: dailyProtocolRevenue.toString(),
27+
dailyFees: dailyAccrued,
28+
dailyRevenue,
29+
dailyProtocolRevenue,
30+
dailyHoldersRevenue: dailyProtocolRevenue,
3431
};
3532
};
3633

34+
const methodology = {
35+
Fees: 'Sum of all fees accrued from LP pools.',
36+
Revenue: 'Sum of protocol revenue and holder revenue.',
37+
ProtocolRevenue: '30% of all the fees accrued excluding Community pool.',
38+
HolderRevenue: '50% of revenue goes to token stakers.',
39+
}
40+
3741
const adapter: Adapter = {
3842
version: 2,
3943
adapter: {

0 commit comments

Comments
 (0)