sheave.js
One file, no dependencies, no build step, no backend, no API key. It reads Robinhood Chain itself and returns the calldata for a leveraged position on a tokenized stock. It never holds anything: custody is Morpho Blue's, the swap is Uniswap's, the signature is your user's.
<script src="https://sheave.tech/assets/sheave.js"></script>
Playground
Live against the chain. Change the inputs and watch the plan and the actual bundle change with them. Nothing is signed and no wallet is needed.
reading the chain…
| # | contract | function | bytes |
|---|
Six calls of setup and sweep, plus four for every part of line. The last two hand both tokens back to the user, so Morpho's adapter is left holding nothing.
Reference
| call | returns | notes |
|---|---|---|
| read() | {block, at, marketOpen, lltv, assets} | one batched eth_call through Multicall3, four public endpoints with failover |
| ladder(n) | exposure multiple | 1→1.575 … 5→2.268 |
| plan({asset,capital,parts,market}) | exposure, debt, ltv, safety, liquidation, calls | pure maths, no network |
| shock(plan, pct) | equity, pnl, ltv, liquidated | what the position is worth after a move |
| bundle({…, user, market}) | {to, data, calls} | calldata for Bundler3.multicall — send it, don't guess it |
| simulate({…}) | throws on revert | eth_call of the exact bytes you will sign |
| approval(usdg) | {to, data} | ERC-20 approve for Morpho's adapter |
| badge(el, {asset}) | — | drops a live rate badge into an element |
| addresses | the address book | all verified on chain 4663 |
const s = await SHEAVE.read(); const m = s.assets.NVDA; const args = {asset:"NVDA", capital:1000, parts:3, user:addr, market:m}; // 1 · let the adapter move the USDG await eth.request({method:"eth_sendTransaction", params:[{from:addr, ...SHEAVE.approval(1000)}]}); // 2 · never sign what you have not simulated const tx = await SHEAVE.simulate(args); // 3 · one transaction await eth.request({method:"eth_sendTransaction", params:[{from:addr, to:tx.to, data:tx.data}]});
<iframe src="https://sheave.tech/embed/?asset=NVDA" width="260" height="56" frameborder="0" title="SHEAVE live borrow rate"></iframe>
SHEAVE.setRpc("https://your-node.example/rpc"); // oppure ?rpc=… nell'URL, oppure window.SHEAVE_RPC
What it will not do for you
It opens positions. It does not close them, it does not manage them, and there is nothing watching your users' health factor. Unwinding means repaying the USDG and withdrawing the collateral through Morpho directly.
The borrow rate is adaptive: whatever read() returned a minute ago is not a promise. The stock oracle stops outside US market hours — see load limits before you put this in front of anyone.
And the honest one: the full approve → sign → send path has not yet been run with a real wallet on mainnet. The bundle simulates and the encoding is verified call by call, but until somebody has pushed a real transaction through it, treat this as unproven and test with an amount you do not care about.