Skip to content

Commit

Permalink
add reax-one-dex
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Jul 20, 2023
1 parent ef0ddbc commit 756f01a
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 756f01a

Please sign in to comment.