solana-labs / perpetuals

Solana perpetuals reference implementation
Other
66 stars 36 forks source link

Position handling does not support shorts and virtual assets with multiple stable coin custodies #19

Open mzs-dev opened 1 year ago

mzs-dev commented 1 year ago

There is no way to segregate user positions associated to one custody according to the collateral locked in the pool and used by the user. Even the collective position tracks all cumulative long and short positions against a custody in a unified way which leaves no way for us to track mutliple positons on the same custody with different collaterals.

mzs-dev commented 1 year ago

The only solution is to have a sperate market state as a link-object that's derived from the combination of "collateral custody" and "custody" (to be renamed as "position custody") to enable admin control over all possible combinations with the many-many realtionship between custodies