Market with ID = 0 can be created. Market with zero id is a special input passed to getAccountMarginRequirementUsdAndUnrealizedPnlUsd
to get that account's required margin and P&L.
As we can see while creating a new market the set id must be 0. It means that market was not created before. However there is no check that params.marketId
is not zero. Without the knowladge of how the id is being generated and whether the market is created via a script or manual transaction there is a scenario where admin creates a market with zero id.
When market with id = 0 is created it will create incompatibilities in calculations or transaction flow. As this issue is caused by admin input, I think, that low is a reasonable severity.
Do not allow a market with zero id to be created. Ensure that params.marketId != 0
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.