Skip to content

Commit 335c0cd

Browse files
authored
Fix + join junoswap adapters (DefiLlama#335)
* Fix + join junoswap adapters * undefined is default
1 parent c6a500f commit 335c0cd

File tree

2 files changed

+5
-51
lines changed

2 files changed

+5
-51
lines changed

dexs/junoswap/index.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

fees/junoswap.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { CHAIN } from "../helpers/chains";
33
import { getUniqStartOfTodayTimestamp } from "../helpers/getUniSubgraphVolume";
44
import fetchURL from "../utils/fetchURL";
55

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"
87

98
interface IVolumeall {
109
volume_total: string;
@@ -21,10 +20,12 @@ const fetch = async (timestamp: number) => {
2120
const dailyVolume = historicalVolume
2221
.find(dayItem => getUniqStartOfTodayTimestamp(new Date(dayItem.date)) === dayTimestamp)?.volume_total
2322
const totalFeesUsd = totalVolume * TOTAL_FEES;
24-
const dailyFeesUsd = Number(dailyVolume || 0) * TOTAL_FEES
23+
const dailyFeesUsd = dailyVolume ? Number(dailyVolume) * TOTAL_FEES : undefined
2524
return {
2625
totalFees: totalFeesUsd.toString(),
27-
dailyFees: dailyFeesUsd.toString(),
26+
dailyFees: dailyFeesUsd ? dailyFeesUsd.toString(): undefined,
27+
dailyVolume: dailyVolume ? dailyVolume.toString() : undefined,
28+
totalVolume: `${totalVolume}`,
2829
timestamp: dayTimestamp,
2930
};
3031
};

0 commit comments

Comments
 (0)