diff --git a/packages/dma-library/package.json b/packages/dma-library/package.json index 9fb3fc73..6451697f 100644 --- a/packages/dma-library/package.json +++ b/packages/dma-library/package.json @@ -1,6 +1,6 @@ { "name": "@oasisdex/dma-library", - "version": "0.5.21-dma-v2-workers.18", + "version": "0.5.21-dma-v2-workers.19-test.0", "typings": "lib/index.d.ts", "types": "lib/index.d.ts", "main": "lib/index.js", diff --git a/packages/dma-library/src/operations/aave/multiply/v3/close.ts b/packages/dma-library/src/operations/aave/multiply/v3/close.ts index b91a377d..5855414d 100644 --- a/packages/dma-library/src/operations/aave/multiply/v3/close.ts +++ b/packages/dma-library/src/operations/aave/multiply/v3/close.ts @@ -66,14 +66,14 @@ export const close: AaveV3CloseOperation = async ({ const withdrawCollateralFromAAVE = actions.aave.v3.aaveV3Withdraw(network, { asset: collateral.address, - amount: collateralAmountToBeSwapped, + amount: collateralAmountToBeSwapped.minus(1), to: proxy.address, }) const swapCollateralTokensForDebtTokens = actions.common.swap(network, { fromAsset: collateral.address, toAsset: debt.address, - amount: collateralAmountToBeSwapped || ZERO, + amount: collateralAmountToBeSwapped.minus(1) || ZERO, receiveAtLeast: swap.receiveAtLeast, fee: swap.fee, withData: swap.data, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts b/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts index 84ed71b8..35a8af41 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts @@ -128,7 +128,7 @@ async function getAaveSwapDataToCloseToDebt( addresses, ) - const swapAmountBeforeFees = dependencies.currentPosition.collateral.amount + const swapAmountBeforeFees = dependencies.currentPosition.collateral.amount.minus(1) const fromToken = { ...collateralToken, precision: collateralToken.precision || TYPICAL_PRECISION,