Skip to content

Commit

Permalink
start time
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Jul 17, 2023
1 parent e7b4c9b commit 2373aa1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions dexs/iziswap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,17 @@ const fetch = (chain: Chain) => {
}
};

const getStartTimestamp = async (chain_id: number) => {
const historical: IVolumeall[] = (await fetchURL(historicalVolumeEndpoint(chain_id)))?.data.data;
const historicalVolume = historical.filter(e => e.chainId === chain_id);
return (new Date(historicalVolume[historicalVolume.length - 1].timestamp).getTime());
}

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.BSC]: {
fetch: fetch(CHAIN.BSC),
start: () => getStartTimestamp(chains[CHAIN.BSC]),
start: async () => 1680739200,
customBackfill: customBackfill(CHAIN.BSC as Chain, fetch)
},
[CHAIN.ERA]: {
fetch: fetch(CHAIN.ERA),
start: () => getStartTimestamp(chains[CHAIN.ERA]),
start: async () => 1680739200,
customBackfill: customBackfill(CHAIN.ERA as Chain, fetch)
},
},
Expand Down

0 comments on commit 2373aa1

Please sign in to comment.