From 82c121c00a8f1a605385df68564b1de8ad0e694e Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Tue, 11 Feb 2025 16:35:08 +0000 Subject: [PATCH] add uni chain v2, v3 --- helpers/chains.ts | 3 ++- protocols/uniswap/index.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/helpers/chains.ts b/helpers/chains.ts index 4a31ebf4b9..bf9a6cd871 100644 --- a/helpers/chains.ts +++ b/helpers/chains.ts @@ -211,7 +211,8 @@ export enum CHAIN { REDSTONE = "redstone", PLUME = "plume", PENUMBRA = "penumbra", - BERACHAIN = "berachain" + BERACHAIN = "berachain", + UNICHAIN = "unichain" } // DonĀ“t use diff --git a/protocols/uniswap/index.ts b/protocols/uniswap/index.ts index 49ea3ee74c..89c9bc26d8 100644 --- a/protocols/uniswap/index.ts +++ b/protocols/uniswap/index.ts @@ -7,6 +7,7 @@ import ADDRESSES from '../../helpers/coreAssets.json'; import { getStartTimestamp } from "../../helpers/getStartTimestamp"; import { DEFAULT_TOTAL_VOLUME_FIELD, getGraphDimensions2 } from "../../helpers/getUniSubgraph"; import { httpPost } from '../../utils/fetchURL'; +import { uniV2Exports, uniV3Exports } from '../../helpers/uniswap' const v1Endpoints = { [CHAIN.ETHEREUM]: sdk.graph.modifyEndpoint('ESnjgAG9NjfmHypk4Huu4PVvz55fUwpyrRqHF21thoLJ'), @@ -346,6 +347,17 @@ const okuChains = [ CHAIN.BSC ] +const uniV3 = uniV3Exports({ + unichain: { factory: '0x1F98400000000000000000000000000000000003' } +}) + +const uniV2 = uniV2Exports({ + unichain: { + factory: '0x1F98400000000000000000000000000000000002', + } +}) + + okuChains.forEach(chain => { adapter.breakdown.v3[chain] = { fetch: fetchFromOku, @@ -355,4 +367,7 @@ okuChains.forEach(chain => { } }) +adapter.breakdown.v3.unichain = uniV3.adapter.unichain; +adapter.breakdown.v2.unichain = uniV2.adapter.unichain; + export default adapter;