File tree Expand file tree Collapse file tree 2 files changed +5
-51
lines changed Expand file tree Collapse file tree 2 files changed +5
-51
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ import { CHAIN } from "../helpers/chains";
3
3
import { getUniqStartOfTodayTimestamp } from "../helpers/getUniSubgraphVolume" ;
4
4
import fetchURL from "../utils/fetchURL" ;
5
5
6
-
7
- const historicalVolumeEndpoint = "https://api-junoswap.enigma-validator.com/volumes/total/historical/999M/d"
6
+ const historicalVolumeEndpoint = "https://api-junoswap.enigma-validator.com/volumes/total/historical/12M/d"
8
7
9
8
interface IVolumeall {
10
9
volume_total : string ;
@@ -21,10 +20,12 @@ const fetch = async (timestamp: number) => {
21
20
const dailyVolume = historicalVolume
22
21
. find ( dayItem => getUniqStartOfTodayTimestamp ( new Date ( dayItem . date ) ) === dayTimestamp ) ?. volume_total
23
22
const totalFeesUsd = totalVolume * TOTAL_FEES ;
24
- const dailyFeesUsd = Number ( dailyVolume || 0 ) * TOTAL_FEES
23
+ const dailyFeesUsd = dailyVolume ? Number ( dailyVolume ) * TOTAL_FEES : undefined
25
24
return {
26
25
totalFees : totalFeesUsd . toString ( ) ,
27
- dailyFees : dailyFeesUsd . toString ( ) ,
26
+ dailyFees : dailyFeesUsd ? dailyFeesUsd . toString ( ) : undefined ,
27
+ dailyVolume : dailyVolume ? dailyVolume . toString ( ) : undefined ,
28
+ totalVolume : `${ totalVolume } ` ,
28
29
timestamp : dayTimestamp ,
29
30
} ;
30
31
} ;
You can’t perform that action at this time.
0 commit comments