RiskLens is view-only. It reads the core and never changes state.
Use Robinhood Chain testnet addresses from Addresses. The snippet keys match that table.
1
Point at the lens
Copy
riskLens and stockline from Addresses. Load RiskLens.json.2
Read power and the line
maxBorrow is sum of collateral × price × LTV across books, in USDG wei. liquidationPrice is 1e36, same convention as EquityOracle.price().3
Prefer snapshot in the app
One call returns health, max borrow, and every book the account is listed on, including
amountUi for display.What can go wrong
UnknownBookifbookIdwas never created.liquidationPriceis 0 when the account has no collateral in that book.- Health is WAD. 1e18 is the line. Below 1e18 the account is liquidatable in LIVE or DARK.
- Do not multiply by
uiMultiplierin your own risk math. The lens already keeps rawamountseparate. - Testnet book ids follow creation order. Do not hardcode production ids from this snippet.
liquidationPrice, 1e36, same convention as EquityOracle.price().
Health is WAD. 1e18 is the line. Below 1e18 the account is liquidatable in LIVE or DARK. HALTED, CA_WINDOW, SEQ_DOWN, and pause block liquidations. Repay still works.
Prefer snapshot in a frontend so you do not issue four RPCs per card. Cache by block. The Stockline app footer prints the block hash so a user can match the drawer to a chain read.
Return values
Next: Open a loan, Read the regime.