File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ import { FetchOptions , SimpleAdapter } from "../../adapters/types" ;
2+ import { CHAIN } from "../../helpers/chains" ;
3+ import { request } from "graphql-request" ;
4+ import * as sdk from "@defillama/sdk" ;
5+
6+ const fetch = async ( _timestamp : number , _ : any , options : FetchOptions ) : Promise < any > => {
7+ const dayID = Math . floor ( options . startOfDay / 86400 ) ;
8+ const query = `
9+ {
10+ algebraDayData(id:${ dayID } ) {
11+ id
12+ volumeUSD
13+ feesUSD
14+ }
15+ }` ;
16+ const url = sdk . graph . modifyEndpoint ( 'LgiKJnsTspbsPBLqDPqULPtnAdSZP6LfPCSo3GWuJ5a' ) ;
17+ const req = await request ( url , query ) ;
18+ return {
19+ dailyVolume : req . algebraDayData ?. volumeUSD ,
20+ dailyFees : req . algebraDayData ?. feesUSD ,
21+ }
22+ }
23+
24+ const adapter : SimpleAdapter = {
25+ adapter : {
26+ [ CHAIN . MOONBEAM ] : {
27+ fetch,
28+ start : 1738927506 ,
29+ } ,
30+ }
31+ }
32+
33+ export default adapter ;
You can’t perform that action at this time.
0 commit comments