Skip to content

Commit

Permalink
fix swapgpt
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Mar 26, 2024
1 parent f51025c commit d320948
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions aggregators/swapgpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ interface IVolumeall {
amount: string;
}

const baseUrl = "https://stats.swapgpt.ai"
const endpoint = "stats/getDefiLamaStats"
const baseUrl = "https://stats.panora.exchange";
const endpoint = "stats/getDefiLamaStats";


const fetch = async (timestamp: number) => {
Expand Down
12 changes: 6 additions & 6 deletions dexs/blitz/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ const computeVolume = async (timestamp: number, productIds: number[]) => {
snapshots[1].cumulative_volumes;
const totalVolume = Number(
Object.values(lastCumulativeVolumes).reduce(
(acc, current) => acc + BigInt(current),
BigInt(0)
) / BigInt(10 ** 18)
(acc, current) => acc + Number(current),
Number(0)
) / Number(10 ** 18)
);
const totalVolumeOneDayAgo = Number(
Object.values(prevCumulativeVolumes).reduce(
(acc, current) => acc + BigInt(current),
BigInt(0)
) / BigInt(10 ** 18)
(acc, current) => acc + Number(current),
Number(0)
) / Number(10 ** 18)
);
const dailyVolume = totalVolume - totalVolumeOneDayAgo;
return {
Expand Down
8 changes: 4 additions & 4 deletions dexs/cauldron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export async function fetchCauldronVolume(
const volume = await fetchURL(endpoint)

const total_sats = volume.reduce((acc, token) => {
return acc + BigInt(token.total_sats)
}, BigInt(0));
return acc + Number(token.total_sats)
}, Number(0));

const daily_sats = volume.reduce((acc, token) => {
return acc + BigInt(token.one_day_sats)
}, BigInt(0));
return acc + Number(token.one_day_sats)
}, Number(0));

const COIN = 100000000n;

Expand Down

0 comments on commit d320948

Please sign in to comment.