Skip to content

Commit

Permalink
bugfix: max aave withdraw balance
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Dec 16, 2024
1 parent b20b2d8 commit f909a54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/liquidity/lend/aave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ export class Aave extends LendMarket {
(asset == zeroAddress && dt.underlyingAddress == this.wrappedToken)
);
if (!debtToken) {
return { withdraw: availableAToken, borrow: BigInt(0) };
return { withdraw: aTokenBalance, borrow: BigInt(0) };
}
// withdraw aTokenBalance, others borrow
// (totalCollateralBase - aTokenBase) * ltv / BigInt(10000) / BigInt(this.healthFactorLimit) >= totalDebtBase + xBase
Expand Down

0 comments on commit f909a54

Please sign in to comment.