File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ import fetchURL from '../../utils/fetchURL' ;
2+ import type { FetchOptions , SimpleAdapter } from '../../adapters/types' ;
3+ import { CHAIN } from '../../helpers/chains' ;
4+
5+ interface IData {
6+ feesUSD : number ;
7+ volumeUSD : number ;
8+ timestamp : number ;
9+ }
10+
11+ const fetch = async ( options :FetchOptions ) => {
12+ const startOfDay = options . startOfDay ;
13+ const endpointsV2 = `https://api.hyperbrick.xyz/lb/dex/analytics?startTime=${ startOfDay } &aggregateBy=daily` ;
14+
15+ const historical : IData [ ] = await fetchURL ( endpointsV2 ) ;
16+
17+ const dailyFees = historical . find ( ( dayItem ) => dayItem . timestamp === startOfDay ) ?. feesUSD || 0 ;
18+ const dailyVolume = historical . find ( ( dayItem ) => dayItem . timestamp === startOfDay ) ?. volumeUSD || 0 ;
19+
20+ return {
21+ dailyVolume,
22+ dailyFees,
23+ } ;
24+ } ;
25+
26+ const adapter : SimpleAdapter = {
27+ version : 2 ,
28+ adapter : {
29+ [ CHAIN . HYPERLIQUID ] : {
30+ fetch,
31+ start : '2025-07-24' ,
32+ } ,
33+ } ,
34+ } ;
35+ export default adapter ;
Original file line number Diff line number Diff line change 1+ import adapter from '../../dexs/hyperbrick' ;
2+ export default adapter ;
You can’t perform that action at this time.
0 commit comments