File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/loopring_v2/contracts/helper Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,19 @@ library ParticipationHelper {
109
109
}
110
110
111
111
if ((p.fillAmountS - p.feeAmountS) >= prevP.fillAmountB) {
112
- // The miner (or in a P2P case, the taker) gets the margin
113
- p.splitS = (p.fillAmountS - p.feeAmountS) - prevP.fillAmountB;
114
- p.fillAmountS = prevP.fillAmountB + p.feeAmountS;
112
+ // The taker gets the margin
113
+ // This is the old way of calculating the margin split. GET RID OF IT so the user wins, always :-)
114
+ // p.splitS = (p.fillAmountS - p.feeAmountS) - prevP.fillAmountB;
115
+
116
+ // Margin is given to the user
117
+ uint marginSplitS = (p.fillAmountS - p.feeAmountS) - prevP.fillAmountB;
118
+ p.fillAmountS = prevP.fillAmountB + p.feeAmountS + marginSplitS;
119
+ p.splitS = 0 ;
115
120
return true ;
116
121
} else {
117
122
return false ;
118
123
}
124
+
119
125
}
120
126
121
127
function checkFills (
You can’t perform that action at this time.
0 commit comments