DocumentationBuild on Note

Lend Against Legs

Documentation snapshot 28 October 2026. Deployment · Audit Status
On this page

fact LegWrap, LegOracle and LegWrapFactory are deployed on Robinhood Chain testnet (deployment 12). The mechanics are described in full under Protocol: Credit; this page is the integrator’s view.

Why Wrap

COUPON legs are ERC-1155 units. Lending markets take ERC-20 collateral with an oracle. LegWrap gives each struck series an ERC-20 share token that holds the COUPON units and the coupons they earn, and LegOracle prices one share in USDG. The factory opens a Morpho Blue market per series with USDG as the loan token.

fact Why Wrap
ContractYour call
LegWrapFactorycreate(seriesId) if no market exists; wrapOf, oracleOf, marketOf, marketParams(seriesId) to read one
LegWrapwrap(units, to), unwrap(shares, to), harvest(), exit(shares, to), previewWrap, previewUnwrap, pool
LegOracleprice() in the convention Morpho expects

Nothing here has an owner, a pause or a parameter.

Wrap

legs.setApprovalForAll(address(wrap), true);
// USDG owed so the new shares carry the same pool share as existing ones
uint256 buyIn = wrap.previewWrap(units);
usdg.approve(address(wrap), buyIn);
// pulls the units and the buy-in, mints `units` shares to `to`
wrap.wrap(units, to);

Each wrapper share corresponds to one raw COUPON unit. With six-decimal USDG, 1,000,000 raw units represent 1 USDG of matched notional; wrapper amounts use the same scale. The buy-in is zero while the pool is empty, which is the case for a freshly struck series.

Borrow

Post the shares to the series market through Morpho’s own interface with marketParams(seriesId). Coupons accrue to the wrapper while its shares are collateral. harvest() pulls accrued coupons into the pool. The oracle combines the underlying leg mark with pooled coupons, so total collateral value can fall despite coupon accrual.

Borrowing introduces liquidation risk. A falling leg mark can make a position eligible for liquidation under the lending market’s parameters; read those parameters before borrowing. An unavailable oracle price can also restrict market actions.

Unwind

// collects accrued coupons, burns the shares, releases the units and pays the pool share
wrap.unwrap(shares, to);

exit(shares, to) releases the units without a pool payout, the fallback when a coupon claim cannot go through. At autocall or maturity the released units are redeemed on NoteCore by whoever holds them.

What to Show a Borrower

fact What to Show a Borrower Reference
NumberSource
Collateral valueoracle.price() × shares
Coupons in the poolwrap.pool(), wrap.poolPerShareWad()
Barrier distancecore.getSeries(seriesId) and the series feed
Market stateMorpho market(id) for supply, borrow and utilisation

A breach changes the collateral from a par claim to stock delivered at s0. Market parameters (loan-to-value, rate model) are chosen with that in mind; read them from marketParams rather than assuming.

A little more clarity?

Keep exploring, or revisit this topic from the navigation.