@@ -10,25 +10,30 @@ interface IMobyVolumeResponse {
10
10
}
11
11
12
12
// endTime is in ms
13
- export const mobyVolumeEndpoint = ( endTime : number ) => {
13
+ export const arb_mobyVolumeEndpoint = ( endTime : number ) => {
14
14
return `https://lambda-api.moby.trade/getVolumeData?end_time=${ endTime } ` ;
15
15
}
16
16
17
+ export const bera_mobyVolumeEndpoint = ( endTime : number ) => {
18
+ return `https://lambda-bera-api.moby.trade/getVolumeData?end_time=${ endTime } ` ;
19
+ }
20
+
17
21
export const moby_adapter : SimpleAdapter = {
18
22
adapter : {
19
23
[ CHAIN . ARBITRUM ] : {
20
- fetch : fetchMobyVolumeData ,
24
+ fetch : arb_fetchMobyVolumeData ,
21
25
start : '2024-04-03'
22
26
} ,
27
+ [ CHAIN . BERACHAIN ] : {
28
+ fetch : bera_fetchMobyVolumeData ,
29
+ start : '2025-02-08'
30
+ }
23
31
} ,
24
32
} ;
25
33
26
- export async function fetchMobyVolumeData (
27
- /** Timestamp representing the end of the 24 hour period */
28
- timestamp : number
29
- ) {
34
+ const _fetchMobyVolumeData = async ( timestamp , endPoint ) => {
30
35
let timestamp_in_ms = timestamp * 1000
31
- const mobyVolumeData = await getMobyVolumeData ( mobyVolumeEndpoint ( timestamp_in_ms ) ) ;
36
+ const mobyVolumeData = await getMobyVolumeData ( endPoint ( timestamp_in_ms ) ) ;
32
37
33
38
const dailyNotionalVolume = Number ( mobyVolumeData . daily_notional_volume ) . toFixed ( 2 ) ;
34
39
const dailyPremiumVolume = Number ( mobyVolumeData . daily_premium_volume ) . toFixed ( 2 ) ;
@@ -44,6 +49,20 @@ export async function fetchMobyVolumeData(
44
49
} ;
45
50
}
46
51
52
+ export async function arb_fetchMobyVolumeData (
53
+ /** Timestamp representing the end of the 24 hour period */
54
+ timestamp : number
55
+ ) {
56
+ return await _fetchMobyVolumeData ( timestamp , arb_mobyVolumeEndpoint ) ;
57
+ }
58
+
59
+ export async function bera_fetchMobyVolumeData (
60
+ /** Timestamp representing the end of the 24 hour period */
61
+ timestamp : number
62
+ ) {
63
+ return await _fetchMobyVolumeData ( timestamp , bera_mobyVolumeEndpoint ) ;
64
+ }
65
+
47
66
async function getMobyVolumeData ( endpoint : string ) : Promise < IMobyVolumeResponse > {
48
67
const results = await fetchURL ( endpoint )
49
68
0 commit comments