@0x/asset-swapper
: Fix fee schedule not being scaled by gas price.
This commit is contained in:
@@ -25,7 +25,11 @@
|
|||||||
{
|
{
|
||||||
"note": "Add `maxFallbackSlippage` option.",
|
"note": "Add `maxFallbackSlippage` option.",
|
||||||
"pr": 2513
|
"pr": 2513
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"note": "Fix fee schedule not being scaled by gas price.",
|
||||||
|
"pr": 2522
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -20,7 +20,7 @@ import {
|
|||||||
import { fillableAmountsUtils } from './fillable_amounts_utils';
|
import { fillableAmountsUtils } from './fillable_amounts_utils';
|
||||||
import { MarketOperationUtils } from './market_operation_utils';
|
import { MarketOperationUtils } from './market_operation_utils';
|
||||||
import { convertNativeOrderToFullyFillableOptimizedOrders } from './market_operation_utils/orders';
|
import { convertNativeOrderToFullyFillableOptimizedOrders } from './market_operation_utils/orders';
|
||||||
import { ERC20BridgeSource, OptimizedMarketOrder } from './market_operation_utils/types';
|
import { ERC20BridgeSource, GetMarketOrdersOpts, OptimizedMarketOrder } from './market_operation_utils/types';
|
||||||
import { ProtocolFeeUtils } from './protocol_fee_utils';
|
import { ProtocolFeeUtils } from './protocol_fee_utils';
|
||||||
import {
|
import {
|
||||||
isOrderTakerFeePayableWithMakerAsset,
|
isOrderTakerFeePayableWithMakerAsset,
|
||||||
@@ -132,9 +132,9 @@ export class SwapQuoteCalculator {
|
|||||||
|
|
||||||
{
|
{
|
||||||
// Scale fees by gas price.
|
// Scale fees by gas price.
|
||||||
const _opts = {
|
const _opts: GetMarketOrdersOpts = {
|
||||||
...opts,
|
...opts,
|
||||||
fees: _.mapValues(opts.feeSchedule, v => v.times(gasPrice)),
|
feeSchedule: _.mapValues(opts.feeSchedule, v => v.times(gasPrice)),
|
||||||
};
|
};
|
||||||
|
|
||||||
const firstOrderMakerAssetData = !!prunedOrders[0]
|
const firstOrderMakerAssetData = !!prunedOrders[0]
|
||||||
|
Reference in New Issue
Block a user