Skip to content

Commit

Permalink
fix endtime
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Apr 19, 2024
1 parent dd90011 commit 953f029
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dexs/lyra/index.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 953f029

Please sign in to comment.