Skip to content

Commit

Permalink
Merge pull request DefiLlama#1280 from optfi/master
Browse files Browse the repository at this point in the history
add opt finance aggregator
  • Loading branch information
dtmkeng authored Mar 12, 2024
2 parents 3532525 + 5a28efd commit a0d8c06
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions aggregators/opt-agg/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import fetchURL from "../../utils/fetchURL";
import { FetchResult, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

const URL = "https://api.opt.finance/stat/vol";

const fetch = async (timestamp: number): Promise<FetchResult> => {
const dailyVolume = (await fetchURL(`${URL}`)).data.total_24h;

return {
dailyVolume,
timestamp,
};
};

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.WEMIX]: {
fetch,
start: 1705017600
},
},
};

export default adapter;

0 comments on commit a0d8c06

Please sign in to comment.