listed-book README

The project's README from github.com/kinexbtdev/listed-book. As one markdown file: README.md.

morpho-stock-vault — Morpho Blue USDG Loans Against Robinhood Stock Tokens

Foundry (Solidity) helper for Morpho Blue on Robinhood Chain (chain ID 4663). It computes health factor and liquidation math for borrowing USDG against Robinhood Stock Token collateral (for example NVDA, AAPL, SPY).

What this repo does

Robinhood Earn is built around Morpho and USDG. This repository is the protocol-level view of that stack:

  1. HealthMath.sol implements Morpho Blue’s collateral value, max borrow, health factor, and liquidation incentive factor (LIF) in WAD math.
  2. StockMarketHelper.sol is a read-only wrapper: it inspects a user’s Morpho position (collateral, borrow shares, oracle price) and previews how much collateral a USDG repay would seize.
  3. The helper reverts unless block.chainid == 4663 and the market’s loanToken is USDG. It does not custody tokens or originate a new lending market.

Use it to understand USDG borrowing against tokenized equities, test liquidation numbers, or fork-read live Morpho markets on 4663.

Stock Tokens are not DTCC shares. See Stock Token documentation.

Keywords

Morpho Blue Robinhood Chain, USDG lending, Stock Token collateral, health factor, liquidation incentive, Foundry fork 4663, Robinhood Earn, Paxos USDG.

Contracts

Contract Address Source
Morpho Blue 0x9D53d5E3bd5E8d4Cbfa6DB1ca238AEA02E651010 Morpho addresses
Adaptive Curve IRM 0x2BD3d5965B26B51814AC95127B2b80dD6CcC0fa1 Morpho registry; live irm_address on API markets
USDG 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168 Token contracts

Do not use Ethereum mainnet Morpho (0xBBBB…FFCb) on 4663. Listed Blue markets here lend USDG, typically at 91.5% LLTV. Curated vaults are Morpho Vault V2 (MetaMorpho V1 lists are empty).

collateralValue = collateral * oraclePrice / 1e36
maxBorrow       = collateralValue * lltv / 1e18
healthFactor    = maxBorrow / borrowAssets          // WAD; < 1e18 is liquidatable
LIF             = min(1.15e18, 1e18 / (1e18 - 0.3e18 * (1e18 - lltv)))
seized          = repaidUSDG * LIF * 1e36 / oraclePrice

Quick start

forge install foundry-rs/forge-std --no-commit
forge test -vv
forge test --fork-url $RH_RPC_URL --fork-chain-id 4663

Local unit tests cover HealthMath. Use a 4663 fork to exercise inspect.

References

Contact

Telegram: kinexbtdev

listed-book (kinexbtdev/listed-book)

Searching Database…

What is this?A Foundry (Solidity) helper for Morpho Blue on Robinhood Chain (chain ID 4663) that computes health factor and liquidation math for borrowing USDG against Robinhood Stock Token collateral such as NVDA, AAPL or SPY.
Is this a lending app I can deposit into, or a set of contracts for my own project?It is two Solidity contracts for your own Foundry work: HealthMath.sol covers collateral value, max borrow, health factor and LIF math, while StockMarketHelper.sol is a read-only wrapper for inspecting positions. It holds no funds and creates no market.
How do I run it against a real market?Run the local unit tests to exercise HealthMath, then call StockMarketHelper.inspect on a fork of Robinhood Chain (chain 4663) to read a live position and preview a USDG repay.
Do I need Foundry installed to use this?Yes, the repo is built as a Foundry (Solidity) project, so you need the forge toolchain, and the code only works against Robinhood Chain (chain ID 4663) with USDG as the loan token.
What happens if I point it at the wrong chain or the wrong market?It reverts unless block.chainid is 4663 and the market's loan token is USDG, and it stays read-only — no custody, no new markets. Keep in mind Stock Tokens are not DTCC shares but tokenized wrappers.
Who is this meant for — Robinhood users or Solidity developers?Developers: it exists to help you understand USDG borrowing against tokenized equities, test liquidation numbers and fork-read live Morpho markets on 4663, not to serve as a retail investing app.
Which tokens and contract addresses does it revolve around?Collateral is Robinhood Stock Tokens like NVDA, AAPL or SPY and the loan asset is Paxos USDG. The README lists Morpho Blue at 0x9D53d5E3bd5E8d4Cbfa6DB1ca238AEA02E651010 with the Adaptive Curve IRM, and markets typically lend USDG at 91.5% LLTV.
What exactly can I inspect on a live position?StockMarketHelper reads a user's Morpho position — collateral, borrow shares and oracle price — and previews how much collateral a USDG repay would seize. It is read-only and never moves funds.
Which addresses should I avoid pointing it at?Do not use the Ethereum mainnet Morpho address (0xBBBB...FFCb) on chain 4663. Also note curated vaults there are Morpho Vault V2, while MetaMorpho V1 lists are empty.
Creator
kinexbtdev
Size
<0.1 MB
Stars
151
Updated
CommitSep 15
Age
1mo
Commits · 90 Days