Skip to main content
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

  • UnknownBook if bookId was never created.
  • liquidationPrice is 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 uiMultiplier in your own risk math. The lens already keeps raw amount separate.
  • Testnet book ids follow creation order. Do not hardcode production ids from this snippet.
Borrowing power is the sum of collateral times price times LTV across books, in USDG wei. The line for one book is 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.