Skip to content

Commit

Permalink
loaddata gmx-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Oct 28, 2023
1 parent 6fa709e commit c190c3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions fees/gmx-v2/arbitrum.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions fees/gmx-v2/avax.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions fees/gmx-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ interface IFee {
const fetch = (chain: Chain) => {
return async (timestamp: number): Promise<FetchResultFees> => {
try {
const fees: IFee[] = (await queryDune(chain === CHAIN.ARBITRUM ? "3084798" : "3084801"))
// const fees: IFee[] = require(`./${chain}.json`);
// const fees: IFee[] = (await queryDune(chain === CHAIN.ARBITRUM ? "3084798" : "3084801"))
// const fs = require('fs');
// const path = require('path');
// fs.writeFileSync(path.resolve(__dirname, `./${chain}.json`), JSON.stringify(fees));
const fees: IFee[] = require(`./${chain}.json`);
const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(timestamp * 1000));
const dateString = new Date(dayTimestamp * 1000).toISOString().split("T")[0];
const daily = fees.find(fee => fee.time.split(' ')[0] === dateString);
Expand Down

0 comments on commit c190c3e

Please sign in to comment.