From 53b7f32732b77f4d281703479338f36caa9ad4dd Mon Sep 17 00:00:00 2001 From: royvardhan Date: Thu, 28 Nov 2024 11:16:11 +0530 Subject: [PATCH 1/2] feat: add apechain support vapordex --- dexs/vapordex/v1.ts | 24 ++++++++++++++++++++---- dexs/vapordex/v2.ts | 13 ++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/dexs/vapordex/v1.ts b/dexs/vapordex/v1.ts index 3a5e82d51b..e2fda9c1a6 100644 --- a/dexs/vapordex/v1.ts +++ b/dexs/vapordex/v1.ts @@ -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" ), }, { @@ -14,8 +15,23 @@ const v1 = univ2Adapter2( dayData: "financialsDailySnapshot", dailyVolume: "dailyVolumeUSD", dailyVolumeTimestampField: "timestamp", + } +); + +const apechainAdapter = univ2Adapter2( + { + [CHAIN.APECHAIN]: sdk.graph.modifyEndpoint( + "QmUpkSrGVym7Qv2akaJkCm8HZzH2wyfdzuFoYW9mrX83eA" + ), }, + {} // 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; diff --git a/dexs/vapordex/v2.ts b/dexs/vapordex/v2.ts index 3fefd93614..0b8d92aa97 100644 --- a/dexs/vapordex/v2.ts +++ b/dexs/vapordex/v2.ts @@ -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", }, -}; \ No newline at end of file + [CHAIN.APECHAIN]: { + fetch: getUniV3LogAdapter({ + factory: FACTORY, + }), + start: "2024-10-29", + }, +}; From e64992222a45a58d9a8dcfe01bb0e2b92b4c25b1 Mon Sep 17 00:00:00 2001 From: royvardhan Date: Thu, 28 Nov 2024 11:21:27 +0530 Subject: [PATCH 2/2] feat: add endpoint --- dexs/vapordex/v1.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dexs/vapordex/v1.ts b/dexs/vapordex/v1.ts index e2fda9c1a6..e57c514a59 100644 --- a/dexs/vapordex/v1.ts +++ b/dexs/vapordex/v1.ts @@ -20,9 +20,8 @@ const avaxAdapter = univ2Adapter2( const apechainAdapter = univ2Adapter2( { - [CHAIN.APECHAIN]: sdk.graph.modifyEndpoint( - "QmUpkSrGVym7Qv2akaJkCm8HZzH2wyfdzuFoYW9mrX83eA" - ), + [CHAIN.APECHAIN]: + "https://api.goldsky.com/api/public/project_cloh4i8580dwo2nz7brhf4r6p/subgraphs/vapordex-v1-apechain/1.0.0/gn", }, {} // Use default values );