Submitted by gpersoon, also found by 0xImpostor, cmichel, shw, hack3r-0m, jonah1005, loop and pauliax
The functions initializeMarket and _seedMarketInitially use the variable latestMarket.
If these functions would be called seperately from createNewSyntheticMarket, then latestMarket would have the same value for each call of initializeMarket and _seedMarketInitially
This would mean that the latestMarket is initialized multiple times and the previous market(s) are not initialized properly.
Note: the call to addNewStakingFund could have prevented this issue, but also allows this, see separate issue.
Note: the functions can only be called by the admin, so if createNewSyntheticMarket and initializeMarket are called in combination, then it would not lead to problems,
but in future release of the software the calls to createNewSyntheticMarket and initializeMarket might get separated.
LongShort.sol #L304
Recommend replacing latestMarket with marketIndex in the functions initializeMarket and _seedMarketInitially.
p.s. confirmed by Jason of float capital: Definitely an issue, luckily both of those functions are adminOnly. But that is definitely not ideal!
JasoonS (Float) confirmed:
DenhamPreen (Float) patched:
