1+ import fetchURL from "../../utils/fetchURL" ;
2+ import { FetchOptions , FetchResult , SimpleAdapter } from "../../adapters/types" ;
3+ import { CHAIN } from "../../helpers/chains" ;
4+
5+ const URL = 'https://volume-tracking.icecreamswap.dev' ;
6+
7+ interface IAPIResponse {
8+ dailyVolume : string ;
9+ }
10+
11+ const commonStartTime = '2025-08-01'
12+
13+ const chainConfig : Record < string , { id : number , start : string } > = {
14+ [ CHAIN . ETHEREUM ] : { id : 1 , start : commonStartTime } ,
15+ [ CHAIN . HEMI ] : { id : 43111 , start : commonStartTime } ,
16+ [ CHAIN . ARBITRUM ] : { id : 42161 , start : commonStartTime } ,
17+ [ CHAIN . CELO ] : { id : 42220 , start : commonStartTime } ,
18+ [ CHAIN . ROOTSTOCK ] : { id : 30 , start : commonStartTime } ,
19+ [ CHAIN . XDC ] : { id : 50 , start : commonStartTime } ,
20+ [ CHAIN . TELOS ] : { id : 40 , start : commonStartTime } ,
21+ [ CHAIN . AVAX ] : { id : 43114 , start : commonStartTime } ,
22+ [ CHAIN . SONIC ] : { id : 146 , start : commonStartTime } ,
23+ [ CHAIN . SCROLL ] : { id : 534352 , start : commonStartTime } ,
24+ [ CHAIN . TAIKO ] : { id : 167000 , start : commonStartTime } ,
25+ [ CHAIN . CORE ] : { id : 1116 , start : commonStartTime } ,
26+ [ CHAIN . IMMUTABLEX ] : { id : 13371 , start : commonStartTime } ,
27+ [ CHAIN . MORPH ] : { id : 2818 , start : commonStartTime } ,
28+ [ CHAIN . OPTIMISM ] : { id : 10 , start : commonStartTime } ,
29+ [ CHAIN . LINEA ] : { id : 59144 , start : commonStartTime } ,
30+ [ CHAIN . ZIRCUIT ] : { id : 48900 , start : commonStartTime } ,
31+ [ CHAIN . BOB ] : { id : 60808 , start : commonStartTime } ,
32+ [ CHAIN . BOBA ] : { id : 288 , start : commonStartTime } ,
33+ [ CHAIN . BASE ] : { id : 8453 , start : commonStartTime } ,
34+ [ CHAIN . MANTLE ] : { id : 5000 , start : commonStartTime } ,
35+ [ CHAIN . BSC ] : { id : 56 , start : commonStartTime } ,
36+ [ CHAIN . POLYGON ] : { id : 137 , start : commonStartTime } ,
37+ [ CHAIN . CRONOS ] : { id : 25 , start : commonStartTime } ,
38+ [ CHAIN . BLAST ] : { id : 81457 , start : commonStartTime } ,
39+ [ CHAIN . POLYGON_ZKEVM ] : { id : 1101 , start : commonStartTime } ,
40+ [ CHAIN . BITTORRENT ] : { id : 199 , start : commonStartTime } ,
41+ [ CHAIN . BERACHAIN ] : { id : 80094 , start : commonStartTime } ,
42+ [ CHAIN . UNICHAIN ] : { id : 130 , start : commonStartTime } ,
43+ [ CHAIN . HYPERLIQUID ] : { id : 999 , start : commonStartTime } ,
44+ [ CHAIN . SEI ] : { id : 1329 , start : commonStartTime } ,
45+ [ CHAIN . BITGERT ] : { id : 32520 , start : commonStartTime } ,
46+ [ CHAIN . ULTRON ] : { id : 1231 , start : commonStartTime } ,
47+ [ CHAIN . EOS ] : { id : 17777 , start : commonStartTime } ,
48+ [ CHAIN . KAVA ] : { id : 2222 , start : commonStartTime } ,
49+ [ CHAIN . MOONRIVER ] : { id : 1285 , start : commonStartTime } ,
50+ [ CHAIN . XLAYER ] : { id : 196 , start : commonStartTime } ,
51+ [ CHAIN . METIS ] : { id : 1088 , start : commonStartTime } ,
52+ [ CHAIN . LIGHTLINK_PHOENIX ] : { id : 1890 , start : commonStartTime } ,
53+ [ CHAIN . MINT ] : { id : 185 , start : commonStartTime } ,
54+ [ CHAIN . GRAVITY ] : { id : 1625 , start : commonStartTime } ,
55+ [ CHAIN . OKEXCHAIN ] : { id : 66 , start : commonStartTime } ,
56+ [ CHAIN . AURORA ] : { id : 1313161554 , start : commonStartTime } ,
57+ [ CHAIN . ZORA ] : { id : 7777777 , start : commonStartTime } ,
58+ [ CHAIN . DUCKCHAIN ] : { id : 5545 , start : commonStartTime } ,
59+ [ CHAIN . MANTA ] : { id : 169 , start : commonStartTime } ,
60+ [ CHAIN . PULSECHAIN ] : { id : 369 , start : commonStartTime } ,
61+ [ CHAIN . EOS_EVM ] : { id : 17777 , start : commonStartTime } ,
62+ [ CHAIN . THUNDERCORE ] : { id : 108 , start : commonStartTime } ,
63+ [ CHAIN . ASTAR ] : { id : 592 , start : commonStartTime } ,
64+ [ CHAIN . METER ] : { id : 82 , start : commonStartTime } ,
65+ [ CHAIN . SONEIUM ] : { id : 1868 , start : commonStartTime } ,
66+ [ CHAIN . SHIMMER_EVM ] : { id : 148 , start : commonStartTime } ,
67+ [ CHAIN . SANKO ] : { id : 1996 , start : commonStartTime } ,
68+ [ CHAIN . BITLAYER ] : { id : 200901 , start : commonStartTime } ,
69+ [ CHAIN . ZETA ] : { id : 7000 , start : commonStartTime } ,
70+ [ CHAIN . RONIN ] : { id : 2020 , start : commonStartTime } ,
71+ [ CHAIN . BSQUARED ] : { id : 223 , start : commonStartTime } ,
72+ [ CHAIN . ETHERLINK ] : { id : 42793 , start : commonStartTime } ,
73+ [ CHAIN . FLARE ] : { id : 14 , start : commonStartTime } ,
74+ [ CHAIN . INK ] : { id : 57073 , start : commonStartTime } ,
75+ [ CHAIN . FRAXTAL ] : { id : 252 , start : commonStartTime } ,
76+ [ CHAIN . IOTAEVM ] : { id : 8822 , start : commonStartTime } ,
77+ [ CHAIN . STORY ] : { id : 1514 , start : commonStartTime } ,
78+ [ CHAIN . BOUNCE_BIT ] : { id : 6001 , start : commonStartTime } ,
79+ [ CHAIN . SWELLCHAIN ] : { id : 1923 , start : commonStartTime } ,
80+ [ CHAIN . VANA ] : { id : 1480 , start : commonStartTime } ,
81+ [ CHAIN . CORN ] : { id : 21000000 , start : commonStartTime } ,
82+ [ CHAIN . FLOW ] : { id : 747 , start : commonStartTime } ,
83+ [ CHAIN . CONFLUX ] : { id : 1030 , start : commonStartTime } ,
84+ [ CHAIN . CHILIZ ] : { id : 88888 , start : commonStartTime } ,
85+ [ CHAIN . OP_BNB ] : { id : 204 , start : commonStartTime } ,
86+ [ CHAIN . WAN ] : { id : 888 , start : commonStartTime } ,
87+ [ CHAIN . MERLIN ] : { id : 4200 , start : commonStartTime } ,
88+ [ CHAIN . LISK ] : { id : 1135 , start : commonStartTime } ,
89+ [ CHAIN . TARA ] : { id : 841 , start : commonStartTime } ,
90+ [ CHAIN . DOGECHAIN ] : { id : 2000 , start : commonStartTime } ,
91+ [ CHAIN . APECHAIN ] : { id : 33139 , start : commonStartTime } ,
92+ [ CHAIN . RARI ] : { id : 1380012617 , start : commonStartTime } ,
93+ [ CHAIN . FILECOIN ] : { id : 314 , start : commonStartTime } ,
94+ [ CHAIN . SUPERPOSITION ] : { id : 55244 , start : commonStartTime } ,
95+ [ CHAIN . FUSE ] : { id : 122 , start : commonStartTime } ,
96+ [ CHAIN . MEER ] : { id : 813 , start : commonStartTime } ,
97+ [ CHAIN . KROMA ] : { id : 255 , start : commonStartTime } ,
98+ [ CHAIN . MODE ] : { id : 34443 , start : commonStartTime } ,
99+ } ;
100+
101+ const fetch = async ( _a : any , _b : any , options : FetchOptions ) : Promise < FetchResult > => {
102+ const chainId = chainConfig [ options . chain ] . id ;
103+
104+ const endpoint = `/api/v1/statistics/${ chainId } /${ options . dateString } ` ;
105+ const response : IAPIResponse = await fetchURL ( `${ URL } ${ endpoint } ` ) ;
106+
107+ return {
108+ dailyVolume : response . dailyVolume
109+ } ;
110+ } ;
111+
112+ const adapter : SimpleAdapter = {
113+ fetch,
114+ adapter : chainConfig
115+ } ;
116+
117+ export default adapter ;
0 commit comments