Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
03 · Multiplier-correct portfolio valuation
The correctness showpiece. Robinhood Stock Tokens carry an ERC-8056
uiMultiplier() corporate-action factor, and generic trackers get the math
wrong in two ways:
- Double-counting the multiplier. The Chainlink feed is already
multiplier-adjusted, so USD value is
balance × feedPrice— not× uiMultiplieron top. Applying it twice mis-states value after every split or reinvested dividend. - Reporting raw balance as "shares." The true share-equivalent is
balance × uiMultiplier ÷ 1e18. After a corporate action it diverges from the raw ERC-20 balance.
getPortfolio() returns both numbers per position, values only priced
holdings, and sweeps all 95 tokens in a single multicall. Reads only.
Prerequisites
- Node ≥ 20. No wallet or key. See example 02 for the
local
hoodchaininstall note.
Run
npm install && npm install ../../../robinhood-chain-sdk
npm start # a live default holder
node index.js 0xYourAddress # any address
Expected output
Stock Token portfolio — 0xA953CA88ff430e9487c60cA34d757414f4efdA07
SYMBOL BALANCE SHARE-EQUIV VALUE
----------------------------------------------------------
TSLA 0.027608 0.027608 $11.26
----------------------------------------------------------
Total priced value: $11.26
A multi-position address prices each holding independently:
AAPL 0.000854 0.000854 $0.27
AMD 0.000455 0.000455 $0.25
NVDA 0.001250 0.001250 $0.26
SPCX 0.001755 0.001755 $0.26
TSLA 0.000631 0.000631 $0.26
Total priced value: $1.30
Right now every uiMultiplier is 1e18 (the chain is new — no corporate
actions have happened yet), so SHARE-EQUIV equals BALANCE. The code path is
already correct: when a token's multiplier moves, the two columns diverge and
the row is flagged ← corporate-action adjusted. The SDK's live test cross-
checks shareEquivalent against the token's own on-chain balanceOfUI().