Summary
A single whale trader could open a position so large it dominates one side of the OI, making the pool highly directional and increasing the risk of insolvency. A per-trader max position size cap limits this concentration.
Proposed Design
Store max_position_size_usd_key(market, is_long) in data_store (admin-configurable per market side).
On every position increase, check:
current_position_size + size_delta <= max_position_size_usd
Revert with OrderError::MaxPositionSizeExceeded if violated.
A value of 0 means uncapped (default behaviour preserved).
Acceptance Criteria
Affected Contracts
order_handler, data_store
Summary
A single whale trader could open a position so large it dominates one side of the OI, making the pool highly directional and increasing the risk of insolvency. A per-trader max position size cap limits this concentration.
Proposed Design
Store
max_position_size_usd_key(market, is_long)indata_store(admin-configurable per market side).On every position increase, check:
current_position_size + size_delta <= max_position_size_usdRevert with
OrderError::MaxPositionSizeExceededif violated.A value of
0means uncapped (default behaviour preserved).Acceptance Criteria
0allows any size (no regression)Affected Contracts
order_handler,data_store