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);