SHEAVE

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.

Install
<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.

Inputs
asset
capital · USDG
parts
leverage
ltv
safety
calls
SHEAVE.plan(…)
reading the chain…
SHEAVE.bundle(…) · every call, decoded
#contractfunctionbytes

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

callreturnsnotes
read(){block, at, marketOpen, lltv, assets} one batched eth_call through Multicall3, four public endpoints with failover
ladder(n)exposure multiple1→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, liquidatedwhat 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 reverteth_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
addressesthe address bookall verified on chain 4663
Open a position, end to end
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}]});
Embed the rate, no JS
<iframe src="https://sheave.tech/embed/?asset=NVDA"
        width="260" height="56" frameborder="0"
        title="SHEAVE live borrow rate"></iframe>
Point it at your own node
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.