@@ -2,7 +2,8 @@ import { SimpleAdapter } from "../../adapters/types";
22import { CHAIN } from "../../helpers/chains" ;
33import { gql , request } from "graphql-request" ;
44
5- const endpoint = "https://api.goldsky.com/api/public/project_cmb20ryy424yb01wy7zwd7xd1/subgraphs/analytics/v1.0.0/gn" ;
5+ const endpoint =
6+ "https://api.goldsky.com/api/public/project_cmb20ryy424yb01wy7zwd7xd1/subgraphs/analytics/1.2.3/gn" ;
67
78// GraphQL query to fetch total volume
89const totalVolumeQuery = gql `
@@ -47,9 +48,11 @@ const fetchDailyData = async (date: number) => {
4748
4849 let totalRevenue = 0 ;
4950
50- pools . forEach ( pool => {
51+ pools . forEach ( ( pool ) => {
5152 const poolFees = parseFloat ( pool . feesUSD ) || 0 ;
52- const communityFee = pool . communityFee ? parseFloat ( pool . communityFee ) / 10000 : 0 ;
53+ const communityFee = pool . communityFee
54+ ? parseFloat ( pool . communityFee ) / 10000
55+ : 0 ;
5356
5457 const poolRevenue = poolFees * communityFee ;
5558
@@ -69,7 +72,9 @@ const adapter: SimpleAdapter = {
6972 fetch : async ( timestamp : number ) => {
7073 const dayTimestamp = Math . floor ( timestamp / 86400 ) * 86400 ;
7174 const totalVolume = await fetchTotalVolume ( ) ;
72- const { volumeUSD, feesUSD, revenueUSD } = await fetchDailyData ( dayTimestamp ) ;
75+ const { volumeUSD, feesUSD, revenueUSD } = await fetchDailyData (
76+ dayTimestamp
77+ ) ;
7378
7479 return {
7580 totalVolume : parseFloat ( totalVolume ) ,
@@ -80,17 +85,17 @@ const adapter: SimpleAdapter = {
8085 timestamp : dayTimestamp ,
8186 } ;
8287 } ,
83- start : ' 2025-02-06' ,
88+ start : " 2025-02-06" ,
8489 meta : {
8590 methodology : {
8691 Volume : "Total users swap volume." ,
8792 Fees : "Swap fees paid by users." ,
8893 Revenue : "Protocol and community shared from fees." ,
89- SupplySideRevenue : "Fees shared to liquidity providers."
90- }
91- }
94+ SupplySideRevenue : "Fees shared to liquidity providers." ,
95+ } ,
96+ } ,
9297 } ,
9398 } ,
9499} ;
95100
96- export default adapter ;
101+ export default adapter ;
0 commit comments