Submitted by gpersoon
In the token contract: batched_stakerNextTokenShiftIndex is indexed by marketIndex, so it can have separate (or the same) values for each different marketIndex.
stakerTokenShiftIndex_to_longShortMarketPriceSnapshotIndex_mapping and stakerTokenShiftIndex_to_accumulativeFloatIssuanceSnapshotIndex_mapping are not indexed by marketIndex.
So the values of stakerTokenShiftIndex_to_longShortMarketPriceSnapshotIndex_mapping and stakerTokenShiftIndex_to_accumulativeFloatIssuanceSnapshotIndex_mapping
can be overwritten by a different market, if batched_stakerNextTokenShiftIndex[market1]==batched_stakerNextTokenShiftIndex[market2]
This will lead to weird results in_calculateAccumulatedFloat, allocating too much or too little float.
Staker.sol L622
Recommend adding an index with marketIndex to the variables:
Also consider shortening the variable names, this way mistakes can be spotted easier.
Confirmed by Jason of Float Capital: Yes, you are totally right, it should use the marketIndex since they are specific per market!
JasoonS (Float) confirmed:
