Fix use correct date to obtain prices (#983)

Co-authored-by: walker-16 <agpazos85@gmail.com>
This commit is contained in:
ftocal 2024-01-12 12:32:31 -03:00 committed by GitHub
parent d8d1d76a1e
commit 798da44152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ func (c *CoinPricesCache) GetPriceByTime(coingeckoID string, day time.Time) (dec
// remove hours and minutes,
// times are in UTC
day = time.Date(day.Year(), day.Month(), day.Day(), 0, 0, 0, 0, time.UTC)
day = day.Truncate(24 * time.Hour).UTC()
// look up the price
key := fmt.Sprintf("%s%d", coingeckoID, day.UnixMilli())