Calculate fee

This commit is contained in:
Aleksandr Kraiz
2023-08-01 21:27:17 +04:00
parent 7eebb2bb9e
commit f9605e3d1a
9 changed files with 212 additions and 50 deletions

View File

@@ -383,12 +383,11 @@ export default async function swapLimit({
const { serviceFeeInFeeAsset, networkFeeInFeeAsset, totalFeeInFeeAsset } = calculateFeeInFeeAsset(
swapInfo.orderInfo.amount,
feeAssetPriceInQuoteAsset,
baseAssetPriceInQuoteAsset,
baseCurrencyPriceInQuoteAsset,
gasPriceGwei,
feePercent,
feeAsset,
baseAssetAddress,
ethers.constants.AddressZero,
feeAssetAddress,
allPrices.prices,
);
@@ -405,7 +404,7 @@ export default async function swapLimit({
name: feeAsset,
address: feeAssetAddress,
},
amount: networkFeeInFeeAsset,
amount: networkFeeInFeeAsset.toString(),
spenderAddress: exchangeContractAddress,
sources: getAvailableSources('network_fee', feeAssetAddress, 'aggregator'),
});
@@ -416,7 +415,7 @@ export default async function swapLimit({
name: feeAsset,
address: feeAssetAddress,
},
amount: serviceFeeInFeeAsset,
amount: serviceFeeInFeeAsset.toString(),
spenderAddress: exchangeContractAddress,
sources: getAvailableSources('service_fee', feeAssetAddress, 'aggregator'),
});