File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/swapService/strategies Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -144,9 +144,15 @@ export class StrategyRedirectDepositWrapper {
144
144
145
145
const swap = buildApiResponseSwap ( swapParams . from , newMulticallItems )
146
146
147
- let debtMax = swapParams . currentDebt - BigInt ( innerSwap . amountOutMin )
148
- if ( debtMax < 0n ) debtMax = 0n
149
- debtMax = adjustForInterest ( debtMax )
147
+ let debtMax
148
+ if ( swapParams . swapperMode === SwapperMode . TARGET_DEBT ) {
149
+ debtMax = swapParams . targetDebt || 0n
150
+ } else {
151
+ debtMax =
152
+ ( swapParams . currentDebt || 0n ) - BigInt ( innerSwap . amountOutMin )
153
+ if ( debtMax < 0n ) debtMax = 0n
154
+ debtMax = adjustForInterest ( debtMax )
155
+ }
150
156
151
157
const verify = buildApiResponseVerifyDebtMax (
152
158
swapParams . chainId ,
You can’t perform that action at this time.
0 commit comments