Skip to content

Commit

Permalink
fix adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Feb 22, 2024
1 parent 43b9640 commit 400ff36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ const getStartTimestamp = async (chain: Chain) => {
return (new Date(historical[0].time).getTime()) / 1000
}

const adapter: SimpleAdapter = {
adapter: Object.keys(chainsMap).reduce((acc, chain: any) => {
const adapteragges: any = {
"mux-protocol-agge": Object.keys(chainsMap).reduce((acc, chain: any) => {
return {
...acc,
[chain]: {
fetch: fetch(chain as Chain),
start: async () => getStartTimestamp(chain),
customBackfill: customBackfill(chain as Chain, fetch),
start: 1708387200,
}
}
}, {})
};

export default adapter;
export {
adapteragges
}
16 changes: 12 additions & 4 deletions dexs/mux-protocol/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ChainBlocks, FetchOptions, SimpleAdapter } from "../../adapters/types";
import type { BreakdownAdapter, ChainBlocks, FetchOptions, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { adapteragges } from "./agge";

type TChainAddress = {
[chain: string]: string;
Expand Down Expand Up @@ -57,8 +58,8 @@ const fetchVolume = async (timestamp: number, _: ChainBlocks, { createBalances,
};
};

const adapter: SimpleAdapter = {
adapter: {
const adapter: any = {
"mux-protocol": {
[CHAIN.ARBITRUM]: {
fetch: fetchVolume,
start: 1680393600,
Expand All @@ -78,4 +79,11 @@ const adapter: SimpleAdapter = {
}
}

export default adapter;
const breakdownAdapter: BreakdownAdapter = {
breakdown: {
"mux-protocol": adapter["mux-protocol"],
"mux-protocol-agge": adapteragges["mux-protocol-agge"],
}
}

export default breakdownAdapter;

0 comments on commit 400ff36

Please sign in to comment.