Skip to content

Commit db1bd95

Browse files
authored
RolleX derivatives adapter (DefiLlama#3999)
1 parent bde0f3a commit db1bd95

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

dexs/rollx/index.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { FetchOptions, SimpleAdapter } from "../../adapters/types";
2+
import { CHAIN } from "../../helpers/chains";
3+
import { httpGet } from "../../utils/fetchURL";
4+
5+
const v2VolumeAPI = "https://adm.rolldex.io/api/trade/query/dailyTradeVol";
6+
7+
const chainConfig = {
8+
[CHAIN.BITLAYER]: {
9+
start: '2024-06-22',
10+
},
11+
[CHAIN.BASE]: {
12+
start: '2024-06-22',
13+
},
14+
}
15+
16+
const fetch = async (_a: any, _b: any, options: FetchOptions) => {
17+
const res = (
18+
await httpGet(v2VolumeAPI, { params: { chain: options.chain, timestamp: options.startOfDay } })
19+
) as { data: { dailyVolume: number }, success: boolean }
20+
21+
return {
22+
dailyVolume: res.data.dailyVolume
23+
}
24+
};
25+
26+
27+
const adapter: SimpleAdapter = {
28+
fetch,
29+
adapter: chainConfig
30+
};
31+
32+
export default adapter;

0 commit comments

Comments
 (0)