Xoheb
Xoheb
Also, the collective position handling invokes the get_interest_amount_usd() function under the context of the worng custody. For isntance: https://github.com/solana-labs/perpetuals/blob/85dc9ed43718590d1008c6bdd209d3c0091298ae/programs/perpetuals/src/instructions/open_position.rs#L346 Invokes: https://github.com/solana-labs/perpetuals/blob/85dc9ed43718590d1008c6bdd209d3c0091298ae/programs/perpetuals/src/state/custody.rs#L444 To solve this issue we propose a seperate "market"...
Only true for longs... Trader does not borrow the trade token, he borrows/locks the same token as the collateral token. For example, when a trader opens a short position, he...
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...