Separate Uniswap v3 NFT ownership from the core pool position
Two LP NFTs in the same range can contribute to one core pool position owned by the position manager. Looking for the wallet address as the pool-level owner can therefore return the wrong record.
Resolve each NFT through its manager
For each token ID call ownerOf and positions on the verified position-manager deployment. Record the pool tokens, fee, ticks, liquidity and NFT-level fee checkpoint at the same block. Derive the core position using the manager’s address and the tick pair.
NFT #7 and NFT #8: same pool, same lower and upper ticks
core owner: NonfungiblePositionManager
In the example, the NFTs can have different owners and fee histories while sharing one aggregate core key. Treating the core liquidity as belonging entirely to NFT 7 duplicates NFT 8’s contribution.
Handle transfers independently of liquidity
An ERC-721 transfer changes who controls the NFT but does not necessarily change the range or liquidity at the pool. Track NFT transfers and manager liquidity events separately. Different manager contracts create separate core owner keys even for identical tick ranges. github.com NonfungiblePositionManager.sol