Track collateral configuration after an Aave v3 aToken transfer

An aToken transfer can trigger pool-level account validation and collateral flag changes. Indexing only ERC-20 balances can leave an account displayed as collateralized after its entire position moved.

Follow finalizeTransfer for both parties

At the transfer point inspect the reserve ID, transfer amount and both pre-transfer balances. In the reference path an outgoing full balance can disable collateral for the sender, subject to the transaction passing its health checks. A receiver’s first balance can trigger collateral enablement when eligible.

A transfers its full aToken balance to B
pre-transfer collateral flags: A on, B off
inspect post-transfer flags and pool events for both accounts

In the example, verify the actual reserve-used-as-collateral events and user configuration for A and B. Do not assume B inherited A’s configuration: receiver eligibility depends on the reserve and the receiver’s existing position.

Distinguish attempted from committed changes

A sender using the position as collateral can fail a health validation, reverting the transfer. Also handle self-transfers and zero-amount cases according to the deployed implementation. Reconcile successful receipts rather than pending token transfer intentions. github.com SupplyLogic.sol