Skip to content

Commit

Permalink
feat: DeltaTrade volume solana (#2269)
Browse files Browse the repository at this point in the history
  • Loading branch information
harry1115 authored Jan 10, 2025
1 parent ff5f5e5 commit 78d1697
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions dexs/delta-trade/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type { SimpleAdapter } from "../../adapters/types";
import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume";
import { httpGet } from "../../utils/fetchURL";

const api = "https://api.deltatrade.ai/api/home/data";
const api = 'https://api.deltatrade.ai/api/home/data'

const fetch = async () => {
async function fetchVolume(chain: string) {
const timestamp = getUniqStartOfTodayTimestamp();
const res = await httpGet(api);
const res = await httpGet(`${api}?chain=${chain}`);
const { total_24h, total } = res.data;

return {
Expand All @@ -19,8 +19,12 @@ const fetch = async () => {
const adapter: SimpleAdapter = {
adapter: {
near: {
fetch,
runAtCurrTime: true,
fetch: () => fetchVolume('near'),
runAtCurrTime: true,
},
solana: {
fetch: () => fetchVolume('solana'),
runAtCurrTime: true,
},
},
};
Expand Down

0 comments on commit 78d1697

Please sign in to comment.