Skip to content

Conversation

@mgrabina
Copy link
Contributor

@mgrabina mgrabina commented Jul 22, 2025

E-Mode just limits borrow-side. So when asking for market reserves, canBeCollateral (allowing users to set new supplies as collateral) is not affected by active e-mode and specific reserve's e-mode's config is only used in borrow-side for HF (and collateral amount calculation).

Example:
A user supplies ETH and activates e-mode ETH-correlated. the user can now only borrow ETH-correlated assets, and his HF is calculated based on collateral from reserves in ETH-Correlated, but he still can supply USDC and set it as collateral.
Not useful in terms of improving custom HF, but he can still earn rewards from it and leave it ready in case he turns e-mode off.

Now both related tests are passing
image

Closes AAVE-857, AAVE-858

@mgrabina mgrabina marked this pull request as draft July 23, 2025 12:56
@mgrabina mgrabina marked this pull request as ready for review July 23, 2025 14:10
@cesarenaldi
Copy link
Contributor

But the flag you are changing the assertion on is about if the user can use the given supply as collateral, not if they can supply it.

@mgrabina
Copy link
Contributor Author

@cesarenaldi yeah, by supply i meant supply + using as collateral

@cesarenaldi
Copy link
Contributor

cesarenaldi commented Jul 23, 2025

what's the implication of activating a collateral on a supply reserve that is not part of the emode?

@linear
Copy link

linear bot commented Jul 23, 2025

AAVE-868 [BUG] when fetching borrowAPY or supplyAPY history for windows more than a day is not working

working request:

const result = await supplyAPYHistory(client, {
  market: ETHEREUM_MARKET_ADDRESS,
  chainId: ETHEREUM_FORK_ID,
  underlyingToken: WETH_ADDRESS,
  window: TimeWindow.LastDay,
});

when changing the timeWindow form "lastDay" to "lastMonth" I am not getting any result.

AAVE-858 [BUG] E-Mode not reflected in MarketUserReserveSupplyPosition

The specific e-mode category reserves settings (e.g., canBeCollateral, canBeBorrowed) are not reflected on the MarketUserReserveSupplyPosition for any user supply position.

  • supply position for tokens not listed in the e-mode category reserves should be considered as not be usable as collateral
  • supply position for tokens included in the e-mode category reserves should follow the specified e-mode category settings
## First Setup

nvm use
pnpm install
pnpm build

## Run Test Scenario
pnpm run test:858

@linear
Copy link

linear bot commented Jul 23, 2025

AAVE-857 [BUG] E-Mode not reflected in Reserve.userState

The specific e-mode category reserves settings (e.g., canBeCollateral, canBeBorrowed) are not reflected on the Reserve.userState for a user that enabled the specific e-mode category.

## First Setup

nvm use
pnpm install
pnpm build

## Run Test Scenario
pnpm run test:857

categoryId: ETHEREUM_MARKET_ETH_CORRELATED_EMODE_CATEGORY,
}),
canBeCollateral: eModeCategoryReserve?.canBeCollateral ?? false,
canBeCollateral: reserve.userState?.canBeCollateral ?? false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this line altogether then, this is the same as not checking it.

@mgrabina mgrabina requested review from cesarenaldi July 24, 2025 12:12
@cesarenaldi cesarenaldi merged commit 0ca03c8 into main Jul 24, 2025
1 of 2 checks passed
@cesarenaldi cesarenaldi deleted the fix/emode-tests branch July 24, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants