fix: asset-swapper depth buy scale (#2659)
This commit is contained in:
parent
c03f1586e6
commit
71cde281b9
@ -37,6 +37,10 @@
|
|||||||
{
|
{
|
||||||
"note": "Fix optimization of buy paths",
|
"note": "Fix optimization of buy paths",
|
||||||
"pr": 2655
|
"pr": 2655
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Fix depth buy scale",
|
||||||
|
"pr": 2659
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -454,7 +454,11 @@ export class SwapQuoter {
|
|||||||
return [
|
return [
|
||||||
...dexQuotes,
|
...dexQuotes,
|
||||||
nativeOrders.map((o, i) => {
|
nativeOrders.map((o, i) => {
|
||||||
const scaleFactor = orderFillableAmounts[i].div(o.takerAssetAmount);
|
// When sell order fillable amount is taker
|
||||||
|
// When buy order fillable amount is maker
|
||||||
|
const scaleFactor = orderFillableAmounts[i].div(
|
||||||
|
side === MarketOperation.Sell ? o.takerAssetAmount : o.makerAssetAmount,
|
||||||
|
);
|
||||||
return {
|
return {
|
||||||
input: (side === MarketOperation.Sell ? o.takerAssetAmount : o.makerAssetAmount)
|
input: (side === MarketOperation.Sell ? o.takerAssetAmount : o.makerAssetAmount)
|
||||||
.times(scaleFactor)
|
.times(scaleFactor)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user