Skip to content

Commit

Permalink
chore: fix minus 1
Browse files Browse the repository at this point in the history
  • Loading branch information
halaprix committed Feb 19, 2024
1 parent 63f057b commit 8a3ef37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/dma-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oasisdex/dma-library",
"version": "0.5.21-dma-v2-workers.19-test.0",
"version": "0.5.21-dma-v2-workers.19-test.3",
"typings": "lib/index.d.ts",
"types": "lib/index.d.ts",
"main": "lib/index.js",
Expand Down
8 changes: 6 additions & 2 deletions packages/dma-library/src/operations/aave/multiply/v3/close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,18 @@ export const close: AaveV3CloseOperation = async ({

const withdrawCollateralFromAAVE = actions.aave.v3.aaveV3Withdraw(network, {
asset: collateral.address,
amount: collateralAmountToBeSwapped.minus(1),
amount: shouldExit ? collateralAmountToBeSwapped.minus(1) : collateralAmountToBeSwapped,
to: proxy.address,
})

const swapCollateralTokensForDebtTokens = actions.common.swap(network, {
fromAsset: collateral.address,
toAsset: debt.address,
amount: collateralAmountToBeSwapped.minus(1) || ZERO,
amount: collateralAmountToBeSwapped
? shouldExit
? collateralAmountToBeSwapped.minus(1)
: collateralAmountToBeSwapped
: ZERO,
receiveAtLeast: swap.receiveAtLeast,
fee: swap.fee,
withData: swap.data,
Expand Down

0 comments on commit 8a3ef37

Please sign in to comment.