From 953f029f623d00c30d35ec4e39f940fac04a1acc Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Fri, 19 Apr 2024 11:39:24 +0000 Subject: [PATCH] fix endtime --- dexs/lyra/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dexs/lyra/index.ts b/dexs/lyra/index.ts index b953d707bc..060016a7f0 100644 --- a/dexs/lyra/index.ts +++ b/dexs/lyra/index.ts @@ -1,6 +1,7 @@ import { ChainBlocks, FetchOptions, SimpleAdapter } from "../../adapters/types"; import fetchURL from "../../utils/fetchURL"; import { CHAIN } from "../../helpers/chains"; +import { getTimestampAtStartOfNextDayUTC } from "../../utils/date"; interface ILyraVolumeResponse { daily_premium_volume: string; @@ -25,9 +26,10 @@ const adapter: SimpleAdapter = { }; export async function fetchLyraVolumeData( - timestamp: number, _:ChainBlocks, { endTimestamp }: FetchOptions + timestamp: number ) { - const timestamp_in_ms = endTimestamp * 1000 + const dayTimestamp = getTimestampAtStartOfNextDayUTC(timestamp); + const timestamp_in_ms = dayTimestamp * 1000 const lyraVolumeData = await getLyraVolumeData(lyraVolumeEndpoint(timestamp_in_ms)); const dailyVolume = Number(lyraVolumeData.daily_premium_volume).toFixed(2); const totalVolume = Number(lyraVolumeData.total_premium_volume).toFixed(2);