Skip to content

Commit

Permalink
Merge pull request #640 from DefiLlama/add-reax-one-dex
Browse files Browse the repository at this point in the history
add reax-one-dex
  • Loading branch information
dtmkeng authored Jul 20, 2023
2 parents ef0ddbc + 756f01a commit a5d1f4b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions dexs/reax-one-dex/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { ChainEndpoints, SimpleAdapter } from "../../adapters/types";
import { getChainVolume } from "../../helpers/getUniSubgraphVolume";
import customBackfill from "../../helpers/customBackfill";
import { CHAIN } from "../../helpers/chains";
import { Chain } from "@defillama/sdk/build/general";
import { getStartTimestamp } from "../../helpers/getStartTimestamp";

const endpoints: ChainEndpoints = {
[CHAIN.MANTLE]: "https://graph.reax.one/subgraphs/name/reax/swaps",
};

const graphParams = {
totalVolume: {
factory: "balancers",
field: "totalSwapVolume",
},
hasDailyVolume: false,
}


const graphs = getChainVolume({
graphUrls: endpoints,
...graphParams
});

const adapter: SimpleAdapter = {
adapter: Object.keys(endpoints).reduce((acc, chain: any) => {
return {
...acc,
[chain]: {
fetch: graphs(chain as Chain),
customBackfill: customBackfill(chain as Chain, graphs),
start: async () => 1689638400,
}
}
}, {})
};
export default adapter;

0 comments on commit a5d1f4b

Please sign in to comment.