Goal
Verify the complete lifecycle of a short position where the collateral and PnL are denominated in the short token (USDC).
Scenario
- LP deposits 20,000 USDC into the ETH/USD market short side
- Trader opens 5 ETH short at 2000 USD with 1000 USDC collateral
- Price moves to 1800 USD — position has 1000 USD unrealised profit
- Trader closes the position
- Trader receives 1000 USDC collateral + 1000 USDC PnL = 2000 USDC
Assertions
- USDC pool decreases by exactly 1000 (the PnL paid out)
- Short OI decreases to 0
- Position removed from storage
- No ETH pool balance changes (short uses only USDC)
Acceptance Criteria
Goal
Verify the complete lifecycle of a short position where the collateral and PnL are denominated in the short token (USDC).
Scenario
Assertions
Acceptance Criteria
execute_orderflow, not mocked PnLtests/short_position_lifecycle.rs