Get account data
Get account data

Aave V4 · Reads onchain state

Reads an address's overall position on an Aave V4 spoke: collateral, debt, collateral factor, risk premium and health factor. The spoke aggregates every reserve the account uses into base-currency totals for collateral and debt, the value-weighted collateral factor governing the position at 18 decimals, the risk premium its collateral mix adds to the borrow rate in basis points, and the health factor at 18 decimals. It is the exact view the spoke evaluates when it decides whether a borrow or withdraw is allowed and whether the position can be liquidated, computed under the dynamic config keys the position is actually bound to rather than the reserves' latest. The raw totals come back in the spoke's own units and are rescaled on-chain to 8-decimal money as totalCollateral and totalDebt. Reach for it to gate any step that changes leverage: require the health factor stays above a floor, size a borrow from the collateral factor, or trigger a repay when debt drifts past a target.

On other protocols · 5