Skip to content

Commit

Permalink
Merge pull request #747 from DackieSwap/master
Browse files Browse the repository at this point in the history
dackieswap integrate volume chart
  • Loading branch information
dtmkeng authored Aug 15, 2023
2 parents 13ea2f2 + fd355ba commit 02cc353
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions dexs/dackieswap/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { IJSON, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

import { getGraphDimensions } from "../../helpers/getUniSubgraph";

const v3Endpoint = {
[CHAIN.BASE]:
"https://api.studio.thegraph.com/query/50473/exchange-clmm/version/latest",
};

const VOLUME_USD = "volumeUSD";

const v3Graph = getGraphDimensions({
graphUrls: v3Endpoint,
totalVolume: {
factory: "factories",
},
dailyVolume: {
factory: "pancakeDayData",
field: VOLUME_USD,
},
totalFees:{
factory: "factories",
},
dailyFees: {
factory: "pancakeDayData",
field: "feesUSD"
},
});

const v3StartTimes = {
[CHAIN.BASE]: 1691712000,
} as IJSON<number>;

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.BASE]: {
fetch: v3Graph(CHAIN.BASE),
start: async () => v3StartTimes[CHAIN.BASE]
},
},
};

export default adapter;

0 comments on commit 02cc353

Please sign in to comment.