From d320948404c648b576bade807e2d3aea4e71d0ba Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Tue, 26 Mar 2024 15:13:43 +0000 Subject: [PATCH] fix swapgpt --- aggregators/swapgpt/index.ts | 4 ++-- dexs/blitz/index.ts | 12 ++++++------ dexs/cauldron/index.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/aggregators/swapgpt/index.ts b/aggregators/swapgpt/index.ts index c9414769c3..9bbb9f594c 100644 --- a/aggregators/swapgpt/index.ts +++ b/aggregators/swapgpt/index.ts @@ -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) => { diff --git a/dexs/blitz/index.ts b/dexs/blitz/index.ts index b5f4e42b37..4ee4f10dd7 100644 --- a/dexs/blitz/index.ts +++ b/dexs/blitz/index.ts @@ -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 { diff --git a/dexs/cauldron/index.ts b/dexs/cauldron/index.ts index e33d9f9822..633c786fc7 100644 --- a/dexs/cauldron/index.ts +++ b/dexs/cauldron/index.ts @@ -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;