Skip to content

Commit cb8f982

Browse files
authored
stellaswap v4 (DefiLlama#3937)
1 parent 38a5681 commit cb8f982

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

dexs/stellaswap-v4/index.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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;

0 commit comments

Comments
 (0)