Fix rounding bug in marketUtils
This commit is contained in:
@@ -17,10 +17,17 @@
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Rename `resultOrders` to `resultFeeOrders` for object returned by `findFeeOrdersThatCoverFeesForTargetOrders` in `marketUtils` api"
|
||||
"Rename `resultOrders` to `resultFeeOrders` for object returned by `findFeeOrdersThatCoverFeesForTargetOrders` in `marketUtils` api",
|
||||
"pr": 954
|
||||
},
|
||||
{
|
||||
"note": "Make `sortFeeOrdersByFeeAdjustedRate` in `sortingUtils` generic"
|
||||
"note": "Make `sortFeeOrdersByFeeAdjustedRate` in `sortingUtils` generic",
|
||||
"pr": 954
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Update `findFeeOrdersThatCoverFeesForTargetOrders` to round the the nearest integer when calculating required fees",
|
||||
"pr": 954
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -123,7 +123,7 @@ export const marketUtils = {
|
||||
const makerAssetAmountAvailable = remainingFillableMakerAssetAmounts[index];
|
||||
const feeToFillMakerAssetAmountAvailable = makerAssetAmountAvailable
|
||||
.mul(order.takerFee)
|
||||
.div(order.makerAssetAmount);
|
||||
.dividedToIntegerBy(order.makerAssetAmount);
|
||||
return accFees.plus(feeToFillMakerAssetAmountAvailable);
|
||||
},
|
||||
constants.ZERO_AMOUNT,
|
||||
|
||||
Reference in New Issue
Block a user