We have to run a algoritm that finds all CPFP clusters and store that data. On the Mempool and on a specific block like this.
How does one detect a CPFP transaction? How does mempool.space do this? https://mempool.space/tx/12afa4bfab373ac148e4ad9145d39329105fb56a7027cd7253d2b7c7027c5b86
Discussion
As far as I could see, it's when a tx input is using a tx input in the same block and the fee of the first tx is lower than the next tx. With this I get an approximation, at least the few I checked. I'm not sure if there are other heuristics involved?