Fix exchangeProxyGasOverhead used to compute fallback orders (#215)
* Fix exchangeProxyGasOverhead used to compute fallback orders * update changelog
This commit is contained in:
parent
9bede5d331
commit
4be4a1a30b
@ -14,6 +14,10 @@
|
|||||||
{
|
{
|
||||||
"note": "Add LUSD Curve pool",
|
"note": "Add LUSD Curve pool",
|
||||||
"pr": 218
|
"pr": 218
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Fix exchangeProxyGasOverhead for fallback path",
|
||||||
|
"pr": 215
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -560,7 +560,12 @@ export class MarketOperationUtils {
|
|||||||
// We create a fallback path that is exclusive of Native liquidity
|
// We create a fallback path that is exclusive of Native liquidity
|
||||||
// This is the optimal on-chain path for the entire input amount
|
// This is the optimal on-chain path for the entire input amount
|
||||||
const nonNativeFills = fills.filter(p => p.length > 0 && p[0].source !== ERC20BridgeSource.Native);
|
const nonNativeFills = fills.filter(p => p.length > 0 && p[0].source !== ERC20BridgeSource.Native);
|
||||||
const nonNativeOptimalPath = await findOptimalPathAsync(side, nonNativeFills, inputAmount, opts.runLimit);
|
const nonNativeOptimalPath = await findOptimalPathAsync(side, nonNativeFills, inputAmount, opts.runLimit, {
|
||||||
|
...penaltyOpts,
|
||||||
|
exchangeProxyOverhead: (sourceFlags: number) =>
|
||||||
|
// tslint:disable-next-line: no-bitwise
|
||||||
|
penaltyOpts.exchangeProxyOverhead(sourceFlags | optimalPath.sourceFlags),
|
||||||
|
});
|
||||||
// Calculate the slippage of on-chain sources compared to the most optimal path
|
// Calculate the slippage of on-chain sources compared to the most optimal path
|
||||||
if (
|
if (
|
||||||
nonNativeOptimalPath !== undefined &&
|
nonNativeOptimalPath !== undefined &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user