Get account data
Get account data

Arcadia · Reads onchain state

Reads an Arcadia Margin account's margin as the account itself values it when the plug runs: its collateral value, its liquidation value, its used margin and its health factor. The account values everything it holds through Arcadia's Registry with its lending pool's oracles and risk factors. The collateral value is what it can borrow against, the liquidation value is what an auction would recover from it after slippage and fees, and the used margin is its open debt to the pool plus the pool's minimum margin; all three are in the account's numeraire, the asset its pool lends. The health factor is the liquidation value over the used margin at 18 decimals, computed in the plug from those same reads: below 1 is exactly when the account's own isAccountLiquidatable answers true, and an account that owes nothing reads the largest value a word holds, since nothing can liquidate it. Only a Margin account keeps a margin; a Spot account borrows nothing and has none to read. Reach for it to repay the moment the health factor dips below a floor, to require the health factor stays above a floor after a borrow or a withdrawal in the same run, or to size a repayment from the gap between the used margin and the liquidation value.

On other protocols · 6