Submitted by KingNFT, also found by Critical, chaduke, 0x52, noot, and orion
The current implementation uses _checkDelay() function to prevent profitable opening and closing in the same tx with two different prices in the valid signature pool. But the protection is not enough, an attacker can long with low price and short with high price at the same tx but two orders to lock profit and take risk free funds.
The following test case and comments show the details for how to exploit it:
How to run
Put the test case to a new BypassDelayCheck.js file of test directory, and run:
And the test result will be:
VS Code, Hardhat
Cache recent lowest and highest prices, open long order with the highest price and short order with the lowest price.
TriHaz (Tigris Trade) disputed and  commented:
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
GainsGoblin (Tigris Trade) commented:
