Skip to content

Commit

Permalink
fix missing fees
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Mar 18, 2024
1 parent 45a83e0 commit 2cb7e0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions helpers/uniswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number> = {}
for (const pair of Object.keys(pairs)) {
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -130,4 +130,4 @@ export function uniV3Exports(config: IJSON<UniV3Config>) {
}
})
return { adapter: exportObject, version: 2 } as SimpleAdapter
}
}
6 changes: 4 additions & 2 deletions protocols/kim-exchange-v3.ts
Original file line number Diff line number Diff line change
@@ -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',
},
})
})

0 comments on commit 2cb7e0f

Please sign in to comment.