Get account data
Get account data

Spark · Reads onchain state

Reads an address's overall position in a Spark market: collateral, debt, borrow capacity, and health factor. The pool aggregates every reserve the account uses into base-currency totals for collateral and debt, the amount still available to borrow, the position's weighted LTV and liquidation threshold, and the health factor at 18 decimals. This is the exact view the pool uses when it decides whether a borrow or withdraw is allowed and whether the position can be liquidated. Reach for it to gate any step that changes leverage: require the health factor stays above a floor, size a borrow from availableBorrows, or trigger a repay when debt drifts past a target.

On other protocols · 5