diff --git a/dexs/econia/index.ts b/dexs/econia/index.ts index 196371f463..9622776099 100644 --- a/dexs/econia/index.ts +++ b/dexs/econia/index.ts @@ -36,21 +36,22 @@ const fetch = async (timestamp: number) => { const feesPerMarket = await Promise.all( markets.map(async m => - await fetchURL(`${BASE_URL}/fees_24h?market_id=eq.${m.market_id}&day=eq.${dayISO}`) + await fetchURL(`${BASE_URL}/rpc/fees?market_id=${m.market_id}&time=${dayISO}`) .then(res => ( - { daily: res[0].fees / 1000000 } + { daily: res[0].daily / 1000000, total: res[0].total / 1000000 } )) ) ); const fees = feesPerMarket.reduce((prev, curr) => { - return { daily: prev.daily + curr.daily }; - }, { daily: 0 }); + return { daily: prev.daily + curr.daily, total: prev.total + curr.total }; + }, { daily: 0, total: 0 }); let res = { totalVolume: `${volumes.total}`, dailyVolume: `${volumes.daily}`, dailyFees: `${fees.daily}`, + totalFees: `${fees.total}`, timestamp: dayTimestamp, };