ERC-TBA: Credit-Matched Liquidity

A holder of a token with a reliable price (a tokenized stock, ETH) could earn pool fees on it if someone supplied the other side. This draft lets a lender fund the quote side of a holder’s concentrated-liquidity position, held in an escrow the holder cannot withdraw from: fees repay the lender first, the holder closes by repaying, and anyone may unwind when the oracle price, never the pool’s own, says the position no longer covers the loan. It covers market sessions and weekend gaps for session-traded assets (no price is used while the market is closed, and an opening buffer covers the gap), assets whose transfer registry can block an address (an unwind pays the lender’s fallback address straight from the position manager), and exact accounting by balance changes.

Questions for lenders and AMM builders:

  1. Is the oracle-plus-market-session model enough for tokenized stocks, or should the draft read an asset-status interface directly?
  2. Who should bear a dead feed after the due date: the lender, or the holder through a timed hand-over?
  3. Is address pool with v3-style positions the right first scope, with v4 through a wrapper?

Nice draft, and good that the reference is upfront about not being audited. Two thoughts on your questions from reading the reference, plus one small thing.

On a dead feed after the due date: I’d go with the timed hand-over. Only the base leg of unwind needs a price; the quote leg doesn’t. So after dueAt plus a grace period, unwind could collect quote up to owed without reading the feed and send the position token to lenderFallback(). The holder had the whole term plus the grace period to close. Without that the holder holds a free option: close if the asset recovers, walk away if it doesn’t, while the lender waits on a feed that may never come back.

On oracle plus session vs reading an asset status interface: a weekend is bounded and gapBps can be sized for it. A halt isn’t, and right now a halt reads the same as a closed market. Halts, delistings and redemptions are exactly when the reopening price gaps the most, and some never reopen. So I’d have the draft read asset status, mainly to tell a terminal state apart from a session close, so terminal states go to the hand-over above instead of waiting.

Small one: once fees bring owed to zero, the position still counts as unwindable at dueAt, so anyone can unwind it. No funds go to the wrong place, but it pulls the holder’s liquidity and the position ends as Unwound instead of Closed. If agentId feeds a credit history, a holder who repaid in full would show an unwind. Skipping the due-date check when owed is zero fixes it.

Thanks, all three land, and they answer the first two questions in the post.

A dead feed after the due date. Agreed: a timed hand-over. After dueAt plus a hand-over delay the lender lists in its terms (so a holder knows it at open), unwind reads no price: it collects quote up to owed and sends the position token to lenderFallback(). The holder had the term and the delay to close, so the free option is gone, and the lender no longer waits on a feed that may not come back. Before that time a dead feed still blocks unwind, as now.

Asset status. Agreed that a halt cannot read as a closed market. The next revision replaces the session source with an asset status that tells three cases apart: a session break (wait for the reopening price, as now), a halt (also no price, but unbounded, so past dueAt plus the delay it goes to the hand-over), and a terminal state such as a delisting or a redemption, which goes to the hand-over at once, due date or not. A base traded continuously keeps no status source.

owed at zero. You’re right, that’s a bug in the reference: _unwindable returns true at dueAt before it looks at owed. In the next revision a position with nothing owed is never unwindable; its holder closes it, paying nothing, and gets the token back as Closed. A test will hold it.

All three go into the next revision of the draft. For the delay: would you put a floor in the text, or leave it to each lender’s listed terms?