Skip to content

Commit 377d128

Browse files
Add ElfomoFi DEX Volume (#5606)
* elfomofi dex volume * fix start date --------- Co-authored-by: eden <[email protected]>
1 parent c68626f commit 377d128

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

dexs/elfomofi/index.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { FetchOptions, FetchResult, SimpleAdapter } from "../../adapters/types";
2+
import { CHAIN } from "../../helpers/chains";
3+
4+
5+
const SwapEvent = "event ElfomoTrade(uint256 indexed quoteId, uint256 indexed partnerId, address executor, address receiver, address fromToken, address toToken, uint256 fromAmount, uint256 toAmount)";
6+
7+
const ELFOMOFI_SWAP_ADDRESS = "0xf0f0F0F0FB0d738452EfD03A28e8be14C76d5f73"
8+
9+
const fetch = async (options: FetchOptions): Promise<FetchResult> => {
10+
const dailyVolume = options.createBalances();
11+
12+
const logs = await options.getLogs({
13+
target: ELFOMOFI_SWAP_ADDRESS,
14+
eventAbi: SwapEvent,
15+
})
16+
17+
for (const log of logs) {
18+
dailyVolume.add(log.fromToken, log.fromAmount);
19+
}
20+
21+
return {
22+
dailyVolume: dailyVolume,
23+
}
24+
}
25+
26+
const methodology = {
27+
Volume: "Volume is calculated from the fromAmount of all ElfomoTrade events on the Elfomofi swap contract.",
28+
}
29+
30+
const adapter: SimpleAdapter = {
31+
version: 2,
32+
methodology,
33+
adapter: {
34+
[CHAIN.BASE]: {
35+
fetch,
36+
start: "2026-01-06",
37+
},
38+
},
39+
};
40+
41+
export default adapter;

0 commit comments

Comments
 (0)