Agents: underwriting the limit
The reference underwriter turns a repayment record into a recommended limit off-chain. A single default restricts the agent to collateral only.
Underwriting the limit
The credit limit is the owner's argument to open. Nothing on-chain consults an underwriter. The contract keeps a repayment record for every agent, readable with agentStats(agent): liens opened with this agent, liens settled, liens defaulted, liens closed after being late, total repaid, and total bad debt.
An off-chain underwriter can read that history. The reference underwrite function turns it into a recommended limit. The owner still chooses the limit it passes to open.
- In the reference underwriter, an agent that settles cleanly gets a larger recommended line, eventually one that exceeds its collateral.
- A single default puts the agent in the Restricted tier, a collateral-only line. The reference underwriter never lifts it, even after later clean settlements.
- A default that left bad debt is penalized harder.
- New50%No clean settlements yet: a conservative 50% loan-to-value.
- Established90% baseOne or two clean settlements: a 90% base loan-to-value. An optional external reputation multiplies it by up to 1.3, which is about 117%.
- Trusted110%Three or four clean settlements: 110%, mildly beyond collateral.
- Prime150%Five or more clean settlements: 150%, genuine under-collateralized credit.
- Restrictedcollateral onlyAny prior default: collateral-only. In the reference function there is no way back out: any
liensDefaultedabove zero stays Restricted indefinitely. It sets the limit at 30% of collateral value, or 20% if the default left bad debt, and does not apply external reputation.
import { underwrite } from "./underwriter.ts";
const stats = await encumbra.agentStats(agentAddress);
const collateralValue = await encumbra.collateralValue(lienId);
const rec = underwrite({ stats, collateralValue });
// rec.creditLimit, rec.ltvBps, rec.tier, rec.rationale
// A recommendation only. The owner still passes its own limit to open().An optional external reputation score between 0 and 1 (for example an ERC-8004 signal) multiplies the base loan-to-value by (1 + 0.3 × reputation). That adds up to 30% more headroom, so the Established tier reaches about 117%. It is not applied to the Restricted tier.
agentStats. The contract itself notes that the record is sybil-forgeable. Do not drive real credit limits from it without off-chain consent checks.