I am trying to implement a distribution of collateral deposited in the pool but I am not getting how it should be distributed in the perpetual pool.
1 Answer
I believe that you are asking about how the shares are calculated in perpetual pools/vaults based on your collateral. I would recommend you to check the ERC4626 implementation from OpenZeppelin to get glue on how internal math works.