Skip to content

Commit

Permalink
fix plunderswap
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Dec 13, 2024
1 parent 3421df6 commit 6a931ac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dexs/plunderswap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const fetch = async (timestamp: number, _: ChainBlocks, { createBalances, startO
const dailyVolume = createBalances()
const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(timestamp * 1000))
const historicalVolume: IVolumeall[] = (await fetchURL(historicalVolumeEndpoint));

// Format the timestamp without milliseconds
const targetTime = new Date(dayTimestamp * 1000).toISOString().replace('.000Z', 'Z');

// Filter entries to find exact 00:00 UTC entry of the current day
const dayEntries = historicalVolume.filter(entry => {
return entry.time === targetTime;
Expand All @@ -32,8 +32,7 @@ const fetch = async (timestamp: number, _: ChainBlocks, { createBalances, startO
const adapter: SimpleAdapter = {
adapter: {
zilliqa: {
fetch,
runAtCurrTime: true,
fetch: fetch,
start: '2024-12-10',
meta: {
methodology: {
Expand All @@ -44,4 +43,4 @@ const adapter: SimpleAdapter = {
},
};

export default adapter;
export default adapter;

0 comments on commit 6a931ac

Please sign in to comment.