Skip to content

Commit

Permalink
fix: missing BAL prices (#542)
Browse files Browse the repository at this point in the history
Co-authored-by: José Ribeiro <[email protected]>
  • Loading branch information
luizakp and ribeirojose authored Dec 19, 2023
1 parent 1e7225b commit bf12d08
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/balancer-apr/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,13 @@ export async function fetchTokenPrice(
const [networkSlug, tokenAddress] = Object.keys(prices.coins)[0].split(
":",
);
const timestamp = new Date(
epochToDate(entry.timestamp).setUTCHours(0, 0, 0, 0),
);
let timestamp = new Date(epochToDate(entry.timestamp));
if (timestamp.getUTCHours() === 23 && timestamp.getUTCMinutes() >= 58) {
timestamp = new Date(
timestamp.setUTCDate(timestamp.getUTCDate() + 1),
);
}
timestamp.setUTCHours(0, 0, 0, 0);

return {
tokenAddress,
Expand Down

0 comments on commit bf12d08

Please sign in to comment.