diff --git a/api2/cron-task/index.ts b/api2/cron-task/index.ts index bdc05bd9..378a4fb2 100644 --- a/api2/cron-task/index.ts +++ b/api2/cron-task/index.ts @@ -113,10 +113,10 @@ async function run() { await storeRouteData('stablecoincharts/all' , allData.aggregated) const allDataShortened: any = { breakdown: {}, - aggregated: allData.aggregated.filter((item: any) => item.date >= allChartsStartTimestamp) + aggregated: allData.aggregated } for (const [id, value] of Object.entries(allData.breakdown)) { - allDataShortened.breakdown[id] = (value as any).filter((item: any) => item.date >= allChartsStartTimestamp) + allDataShortened.breakdown[id] = (value as any) } await storeRouteData('stablecoincharts2/' + frontendKey, allDataShortened) @@ -132,7 +132,7 @@ async function run() { } async function getChainData(chain: string) { - let startTimestamp = chain === frontendKey ? allChartsStartTimestamp : undefined + let startTimestamp = undefined chain = chain === frontendKey ? 'all' : chain const aggregated = removeEmptyItems(await craftChartsResponse({ chain, startTimestamp, assetChainMap})) const breakdown: any = {} diff --git a/api2/cron-task/storeCharts.ts b/api2/cron-task/storeCharts.ts index 1fbb2cda..6a83e43b 100644 --- a/api2/cron-task/storeCharts.ts +++ b/api2/cron-task/storeCharts.ts @@ -247,12 +247,7 @@ export function craftChartsResponse( // if (chain !== "all" && !lastBalance?.[normalizedChain]) // return undefined; - const defaultStartTimestamp = 1609372800; - const earliestTimestamp = - chain === "all" || backfilledChains.includes(chain ?? "") - ? defaultStartTimestamp - : 1652241600; // chains have mostly incomplete data before May 11, 2022 - let historicalBalance = { Items: balances.filter(i => i.SK > earliestTimestamp) } as any; + let historicalBalance = { Items: balances } as any; if (historicalBalance.Items === undefined || historicalBalance.Items.length < 1) return undefined; diff --git a/api2/routes/getStableCoin.ts b/api2/routes/getStableCoin.ts index 8e7c9585..63519804 100644 --- a/api2/routes/getStableCoin.ts +++ b/api2/routes/getStableCoin.ts @@ -25,7 +25,7 @@ export function getStablecoinData(peggedID: string | undefined) { const { balances, lastBalance } = cache.peggedAssetsData?.[peggedData.id] ?? {} const lastBalancesHourlyRecord = lastBalance // currently frontend does not use data before May 11, 2022 for individual stablecoins - const historicalPeggedBalances = balances.filter((item) => item.SK >= 1652241600) + const historicalPeggedBalances = balances if (!useHourlyData) { replaceLast(historicalPeggedBalances, lastBalancesHourlyRecord);