diff --git a/helpers/uniswap.ts b/helpers/uniswap.ts index eec7f56f29..d4a6347ffc 100644 --- a/helpers/uniswap.ts +++ b/helpers/uniswap.ts @@ -17,7 +17,7 @@ export async function filterPools({ api, pairs, createBalances }: { api: ChainAp } pairBalances[balanceCalls[i].params].add(balanceCalls[i].target, bal ?? 0) }) - // we do this to cache price results + // we do this to cache price results await balances.getUSDValue() const filteredPairs: IJSON = {} for (const pair of Object.keys(pairs)) { @@ -78,7 +78,7 @@ export const getUniV3LogAdapter: any = ({ factory, poolCreatedEvent = defaultPoo const fees: any = {} logs.forEach((log: any) => { pairObject[log.pool] = [log.token0, log.token1] - fees[log.pool] = log.fee.toString() / 1e6 + fees[log.pool] = (log.fee?.toString() || 0) / 1e6 // seem some protocol v3 forks does not have fee in the log when not use defaultPoolCreatedEvent }) const filteredPairs = await filterPools({ api, pairs: pairObject, createBalances }) const dailyVolume = createBalances() @@ -130,4 +130,4 @@ export function uniV3Exports(config: IJSON) { } }) return { adapter: exportObject, version: 2 } as SimpleAdapter -} \ No newline at end of file +} diff --git a/protocols/kim-exchange-v3.ts b/protocols/kim-exchange-v3.ts index ec0c980d13..0bf5f3410e 100644 --- a/protocols/kim-exchange-v3.ts +++ b/protocols/kim-exchange-v3.ts @@ -1,7 +1,9 @@ import { uniV3Exports } from "../helpers/uniswap"; -export default uniV3Exports({ +const poolEvent = 'event Pool(address indexed token0,address indexed token1,address pool)' +export default uniV3Exports({ mode: { + poolCreatedEvent: poolEvent, factory: '0xB5F00c2C5f8821155D8ed27E31932CFD9DB3C5D5', }, -}) \ No newline at end of file +})