Skip to content

Commit

Permalink
add uni chain v2, v3
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Feb 11, 2025
1 parent 0865471 commit 82c121c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helpers/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ export enum CHAIN {
REDSTONE = "redstone",
PLUME = "plume",
PENUMBRA = "penumbra",
BERACHAIN = "berachain"
BERACHAIN = "berachain",
UNICHAIN = "unichain"
}

// Don´t use
Expand Down
15 changes: 15 additions & 0 deletions protocols/uniswap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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,
Expand All @@ -355,4 +367,7 @@ okuChains.forEach(chain => {
}
})

adapter.breakdown.v3.unichain = uniV3.adapter.unichain;
adapter.breakdown.v2.unichain = uniV2.adapter.unichain;

export default adapter;

0 comments on commit 82c121c

Please sign in to comment.