Submitted by KingNFT
To protect the fund of vault, the protocol has a security mechanism which limits:
source: https://docs.tigris.trade/protocol/trading-and-fees#limitations
But the implementation is missing to check this limitation while addToPosition(), an attacker can exploit it to get more profit than expected.
The following test case shows both normal case and the exploit scenario.
In the normal case,  a 990 USD margin, gets back a 500% of 4950 USD payout, and the profit is 3960 USD.
In the exploit case, the attack will get an extra 2600+ USD profit than the normal case.
The test result
VS Code
Add a check for addToPosition() function, revert if PnL >= 500%, enforce users to close the order to take a limited profit.
TriHaz (Tigris Trade) confirmed, but disagreed with severity and commented:
KingNFT (warden) commented:
Alex the Entreprenerd (judge) commented:
GainsGoblin (Tigris Trade) commented:
