Skip to content

Stop filtering out old data #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api2/cron-task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 = {}
Expand Down
7 changes: 1 addition & 6 deletions api2/cron-task/storeCharts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion api2/routes/getStableCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down