diff --git a/functions/src/update-metrics.ts b/functions/src/update-metrics.ts index 1fde9cfd..106ed773 100644 --- a/functions/src/update-metrics.ts +++ b/functions/src/update-metrics.ts @@ -150,12 +150,12 @@ export async function updateMetricsCore() { contractsById, currentBets ) - const lastPortfolio = portfolioHistory.current + const currPortfolio = portfolioHistory.current const didPortfolioChange = - lastPortfolio === undefined || - lastPortfolio.balance !== newPortfolio.balance || - lastPortfolio.totalDeposits !== newPortfolio.totalDeposits || - lastPortfolio.investmentValue !== newPortfolio.investmentValue + currPortfolio === undefined || + currPortfolio.balance !== newPortfolio.balance || + currPortfolio.totalDeposits !== newPortfolio.totalDeposits || + currPortfolio.investmentValue !== newPortfolio.investmentValue const newProfit = calculateNewProfit(portfolioHistory, newPortfolio)