Skip to content

Commit 1ddef26

Browse files
feat: add hyperbrick volume, fees (DefiLlama#3828)
* feat: add hyperbrick volume, fees * refactor --------- Co-authored-by: treeoflife2 <sol.analyzoor@gmail.com>
1 parent 22b1d9e commit 1ddef26

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

dexs/hyperbrick/index.ts

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

fees/hyperbrick/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import adapter from '../../dexs/hyperbrick';
2+
export default adapter;

0 commit comments

Comments
 (0)