Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
1 similar comment
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
|
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A CoW simple order delivers the bought aTokens by transfer, which never auto-enables collateral (v3.4+), so a newly bought asset doesn't count. The flash-loan adapter supplies on the user's behalf, so first-supply auto-enable applies. An existing position keeps its collateral flag in both flows. The flow selector now picks the flow before computing HF. Also use the e-mode liquidation threshold for swap assets only when the asset is collateral in that category. Co-Authored-By: Claude Opus 5.5 <[email protected]>
grothem
force-pushed
the
fix/hf-supply-existing-collateral
branch
from
November 19, 2026 16:12
557d66a to
a650d1e
Compare
grothem
changed the base branch from
main
to
samm/zero-ltv-collateral-actions
November 19, 2026 16:12
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Without a flash loan, ParaSwap collateral swaps run as aToken -> aToken Augustus routes (since #2581), not through the adapter's swapAndDeposit. Augustus or its executor receives the bought aTokens and transfers them to the user, so a newly bought asset is never auto-enabled as collateral, same as a CoW simple order. getCollateralSwapReceivedVia now only depends on whether a flash loan is used. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Isolation mode (debt ceilings) is removed in v3.7 and all pools are upgraded, so the isolation gates in calculateHFAfterSupply and calculateHFAfterSwap no longer apply. Isolated e-mode handling is kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The health factor "after" numbers in the Supply modal and the collateral swap modal didn't follow the Pool's collateral rules. The reported case: supplying more of a 0 LTV asset that's already enabled as collateral showed the HF staying the same, when on-chain it goes up.
The rule the interface now follows everywhere: the Pool only decides the collateral flag when a position is first created. An existing position keeps its flag. A newly received asset is auto-enabled only if it's supplied and eligible (effective LTV > 0). An aToken transfer never auto-enables collateral for the receiver (v3.4+).
Supply modal
setUserEMode+supplyin one multicall): now uses the same rules, evaluated under the target e-mode, sincesetUserEModeruns first. Previously it ignored LTV and the user's existing flag.Shared helpers:
supplyCountsAsCollateralandgetReserveLiquidationThresholdInEmodeinhfUtils.ts.Collateral swap (CoW and ParaSwap)
How the bought asset arrives depends on the flow, and both providers behave the same way:
SwapActionsViaParaswap), where Augustus or its executor is thePool.supplyrecipient and then transfers the aTokens to the user. Either way the user receives them by transfer.CollateralSwapAaveV3Adapter->Pool.supply, ParaSwapParaSwapLiquiditySwapAdapter->Pool.depositviaflashLoanSimple), then pulls the sold aTokens.calculateHFAfterSwaptakes a newtoAssetReceivedVia: 'supply' | 'transfer'(default'supply').getCollateralSwapReceivedVia(useFlashloan)returns'transfer'whenever no flash loan is used.useFlowSelectornow picks the flow (simple order or flash loan) first, then computes the HF for that flow, so theIS_LIQUIDATABLEblock matches what will run. Picking the flow only uses the withdraw side, so there's no loop.transferFromof the sold aTokens runsvalidateHFAndLtvzero. It reverts only if HF drops below 1 (or the ltvzero rule fires), and the existingIS_LIQUIDATABLEcheck catches that.Isolation mode removed from HF
Legacy isolation mode (debt ceilings) is gone in v3.7 and every pool is upgraded, so the isolation checks in
calculateHFAfterSupplyandcalculateHFAfterSwapare removed. Isolated e-mode (v3.7) handling stays.Testing
src/utils/__tests__/hfUtils.test.ts: supply cases, e-mode switch helpers, and the 4 × 2 swap table above. The new swap tests fail on fix: align zero-LTV collateral guards and swap HF with on-chain rules #3189 without this change.tscis clean and Prettier passes. ESLint shows one existingreact-hooks/exhaustive-depswarning inuseFlowSelector.ts, on a line this PR doesn't change.Not covered
swapAndDeposit, which supplies, so a newly bought asset with LTV > 0 became collateral. Since Collateral Swaps using CoW when available #2581 it's an Augustus aToken swap, so it arrives disabled, while the flash-loan path still enables it. This PR makes the preview match today's behavior. Bringing backswapAndDepositwould be a product decision.🤖 Generated with Claude Code