[FIX] asset-swapper liquidity breakdown (#2472)

* changed divided

* added changelog

* prettier

Co-authored-by: Jacob Evans <dekz@dekz.net>
This commit is contained in:
David Sun 2020-02-06 00:09:39 -05:00 committed by GitHub
parent 4a62e80967
commit befc22d718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,10 @@
{
"version": "4.1.1",
"changes": [
{
"note": "Fix bug with liquidity source breakdown",
"pr": 2472
},
{
"note": "Prune orders before creating a dummy order for the Sampler",
"pr": 2470

View File

@ -426,7 +426,9 @@ export class SwapQuoteCalculator {
return {
...acc,
...{
[source]: (!!acc[source] ? acc[source].plus(assetAmount) : assetAmount).dividedBy(totalAssetAmount),
[source]: !!acc[source]
? acc[source].plus(assetAmount.dividedBy(totalAssetAmount))
: assetAmount.dividedBy(totalAssetAmount),
},
};
}, breakdown);