Skip to content

Commit

Permalink
tvl adapter start field can be date striing
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Nov 27, 2024
1 parent 59219d0 commit 36e5cb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion defi/src/cli/fillOld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const main = async () => {
getHistoricalValues(dailyTokensTvl(protocol.id)),
getHistoricalValues(dailyUsdTokensTvl(protocol.id)),
]); */
const start = adapter.start ?? 0;
const start = adapter.start ? Math.round(+new Date(adapter.start) / 1000) : 0;
const now = Math.round(Date.now() / 1000);
let timestamp = getClosestDayStartTimestamp(latestDate ?? now);
if (timestamp > now) {
Expand Down
2 changes: 1 addition & 1 deletion defi/src/cli/fillOldChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const main = async () => {
// debugPrintDailyItems(dailyTokens, 'dailyTokens')
// debugPrintDailyItems(dailyUsdTokens, 'dailyUsdTokens')
// debugPrintDailyItems(rawTokenTvl, 'rawTokenTvl')
const start = adapter.start ?? 0;
const start = adapter.start ? Math.round(+new Date(adapter.start) / 1000) : 0;
const now = Math.round(Date.now() / 1000);
let timestamp = getClosestDayStartTimestamp(latestDate ?? now);
if (timestamp > now) {
Expand Down

0 comments on commit 36e5cb1

Please sign in to comment.