solana-labs / perpetuals

Solana perpetuals reference implementation
Other
66 stars 36 forks source link

Update owned assets #4

Closed mabrehan closed 1 year ago

mabrehan commented 1 year ago

Need to update assets.owned for liquidate instruction. It was previously updated in close position instruction when a trader makes a loss. This negative PnL is profit for the pool, so it needs to be added to assets.owned

https://github.com/solana-labs/perpetuals/blob/34f9bbb34054b17ca3fab965e5287f0328f9e4c3/programs/perpetuals/src/instructions/liquidate.rs#L200

askibin commented 1 year ago

updated here https://github.com/solana-labs/perpetuals/pull/5/files