Building a hierarchy table from transactions

Hi Community!

I’m struggling with a workflow, and the logic on how to do it. I have a table with transactions, and this table has an investor and an investee. As the investments might have multiple levels, I would like to extract the investment structure from the transactions. Below and attached, an example of the data. Can you think of any way to archieve this? :pray:

example hierarchy.xlsx