Skip to content

Commit

Permalink
Merge pull request #2148 from VaporFi/dev-816
Browse files Browse the repository at this point in the history
feat: add apechain support vapordex
  • Loading branch information
dtmkeng authored Nov 28, 2024
2 parents 133982e + e649922 commit ea6d70d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
23 changes: 19 additions & 4 deletions dexs/vapordex/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import * as sdk from "@defillama/sdk";
import { CHAIN } from "../../helpers/chains";
import { univ2Adapter2 } from "../../helpers/getUniSubgraphVolume";

const v1 = univ2Adapter2(
// Create AVAX adapter with custom fields
const avaxAdapter = univ2Adapter2(
{
[CHAIN.AVAX]: sdk.graph.modifyEndpoint(
"B6Tur5gXGCcswG8rEtmwfjBqeyDXCDUQSwM9wUXHoui5",
"B6Tur5gXGCcswG8rEtmwfjBqeyDXCDUQSwM9wUXHoui5"
),
},
{
Expand All @@ -14,8 +15,22 @@ const v1 = univ2Adapter2(
dayData: "financialsDailySnapshot",
dailyVolume: "dailyVolumeUSD",
dailyVolumeTimestampField: "timestamp",
}
);

const apechainAdapter = univ2Adapter2(
{
[CHAIN.APECHAIN]:
"https://api.goldsky.com/api/public/project_cloh4i8580dwo2nz7brhf4r6p/subgraphs/vapordex-v1-apechain/1.0.0/gn",
},
{} // Use default values
);

v1.adapter.avax.start = 1663545600;
export default v1.adapter;
const adapter = {
...avaxAdapter.adapter,
...apechainAdapter.adapter,
};

adapter.avax.start = 1663545600;
adapter.apechain.start = 2519744;
export default adapter;
13 changes: 10 additions & 3 deletions dexs/vapordex/v2.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { CHAIN } from "../../helpers/chains";
import { getUniV3LogAdapter } from "../../helpers/uniswap";

const FACTORY = "0x62B672E531f8c11391019F6fba0b8B6143504169";
export default {
[CHAIN.AVAX]: {
fetch: getUniV3LogAdapter({
factory: "0x62B672E531f8c11391019F6fba0b8B6143504169",
factory: FACTORY,
}),
start: '2023-10-17',
start: "2023-10-17",
},
};
[CHAIN.APECHAIN]: {
fetch: getUniV3LogAdapter({
factory: FACTORY,
}),
start: "2024-10-29",
},
};

0 comments on commit ea6d70d

Please sign in to comment.