diff --git a/src/Unit/Exchange/getSwapInfo.ts b/src/Unit/Exchange/getSwapInfo.ts index 4077fec..e6c0f9e 100644 --- a/src/Unit/Exchange/getSwapInfo.ts +++ b/src/Unit/Exchange/getSwapInfo.ts @@ -121,12 +121,6 @@ export default async function getSwapInfo({ if (baseAssetAddress === undefined) throw new Error(`No asset address for ${baseAssetName}`); // Fee calculation - const baseAssetPriceInQuoteAsset = allPrices.prices[baseAssetAddress]; - if (baseAssetPriceInQuoteAsset === undefined) throw new Error(`Base asset price ${baseAssetName} in ${allPrices.quoteAsset} not found`); - const baseCurrencyPriceInQuoteAsset = allPrices.prices[ethers.constants.AddressZero]; - if (baseCurrencyPriceInQuoteAsset === undefined) throw new Error(`Base currency price in ${allPrices.quoteAsset} not found`); - const feeAssetPriceInQuoteAsset = allPrices.prices[feeAssetAddress]; - if (feeAssetPriceInQuoteAsset === undefined) throw new Error(`Fee asset price ${feeAsset} in ${allPrices.quoteAsset} not found`); const feePercent = feeAssets[feeAsset]; if (feePercent === undefined) throw new Error(`Fee asset ${feeAsset} not available`); diff --git a/src/Unit/Exchange/swapLimit.ts b/src/Unit/Exchange/swapLimit.ts index 741af96..3b62706 100644 --- a/src/Unit/Exchange/swapLimit.ts +++ b/src/Unit/Exchange/swapLimit.ts @@ -372,12 +372,6 @@ export default async function swapLimit({ }); // Fee calculation - const baseAssetPriceInQuoteAsset = allPrices.prices[baseAssetAddress]; - if (baseAssetPriceInQuoteAsset === undefined) throw new Error(`Base asset price ${baseAssetName} in ${allPrices.quoteAsset} not found`); - const baseCurrencyPriceInQuoteAsset = allPrices.prices[ethers.constants.AddressZero]; - if (baseCurrencyPriceInQuoteAsset === undefined) throw new Error(`Base currency price in ${allPrices.quoteAsset} not found`); - const feeAssetPriceInQuoteAsset = allPrices.prices[feeAssetAddress]; - if (feeAssetPriceInQuoteAsset === undefined) throw new Error(`Fee asset price ${feeAsset} in ${allPrices.quoteAsset} not found`); const feePercent = feeAssets[feeAsset]; if (feePercent === undefined) throw new Error(`Fee asset ${feeAsset} not available`); diff --git a/src/Unit/Exchange/swapMarket.ts b/src/Unit/Exchange/swapMarket.ts index af6996c..2ac8e2f 100644 --- a/src/Unit/Exchange/swapMarket.ts +++ b/src/Unit/Exchange/swapMarket.ts @@ -330,12 +330,6 @@ export default async function swapMarket({ }); // Fee calculation - const baseAssetPriceInQuoteAsset = allPrices.prices[baseAssetAddress]; - if (baseAssetPriceInQuoteAsset === undefined) throw new Error(`Base asset price ${baseAssetName} in ${allPrices.quoteAsset}not found`); - const baseCurrencyPriceInQuoteAsset = allPrices.prices[ethers.constants.AddressZero]; - if (baseCurrencyPriceInQuoteAsset === undefined) throw new Error(`Base currency price in ${allPrices.quoteAsset} not found`); - const feeAssetPriceInQuoteAsset = allPrices.prices[feeAssetAddress]; - if (feeAssetPriceInQuoteAsset === undefined) throw new Error(`Fee asset price ${feeAsset} in ${allPrices.quoteAsset} not found`); const feePercent = feeAssets[feeAsset]; if (feePercent === undefined) throw new Error(`Fee asset ${feeAsset} not available`); diff --git a/src/services/Aggregator/schemas/swapInfoSchema.ts b/src/services/Aggregator/schemas/swapInfoSchema.ts index 26b7947..cc2166e 100644 --- a/src/services/Aggregator/schemas/swapInfoSchema.ts +++ b/src/services/Aggregator/schemas/swapInfoSchema.ts @@ -39,7 +39,7 @@ const swapInfoBase = z.object({ orderInfo: orderInfoSchema, isThroughPoolOrCurve: z.boolean(), }).array(), - anm: z.record(z.string()).optional(), // address to ERC20 names + assetNameMapping: z.record(z.string()).optional(), // address to ERC20 names }); const swapInfoByAmountIn = swapInfoBase.extend({