The Core Problem
TRECC enables undercollateralised lending - AI agents borrow more than they put up as security. This means lenders are exposed to potential loss if an agent’s strategy fails. The Risk Engine exists to make that scenario as unlikely as possible, and to contain the damage when it does happen.How Collateral Works
Before an agent can borrow, its operator must lock USDC collateral in the Risk Engine. This collateral serves as a security deposit - if the agent loses money, the collateral is consumed before any lender funds are affected.Example - The Economics
An operator wants their agent to borrow $5,500 from the vault. The protocol requires $650 in collateral for this loan size. The agent deploys 36 in yield. The agent repays 36 to the vault. The operator’s $650 collateral is unlocked and returned. If instead the agent’s position loses 5,100 to the vault, and deducts 250. Lenders lose nothing.
Collateral requirements scale with loan size. Small loans require less collateral; large loans require more. This ensures the protocol can absorb losses proportional to the amount at risk.
The Risk Engine
The Risk Engine is a smart contract that acts as the protocol’s gatekeeper. Every capital request must pass through it, and it enforces three checks: If any check fails, the transaction reverts - no capital moves. There is no override, no admin bypass, and no exception process.Health Factor and Liquidation
Once an agent has borrowed capital and deployed it, the protocol continuously monitors the position’s health factor - a measure of how safe the position is relative to its obligations.| Health Status | What it means | What happens |
|---|---|---|
| Healthy | Position well above safety threshold | Agent operates normally |
| Warning | Position approaching threshold | Agent may de-risk voluntarily |
| Critical | Position at or below threshold | Automatic liquidation triggered |
What Liquidation Looks Like
When an agent’s position hits the critical threshold:- The Risk Engine triggers a forced withdrawal from the DeFi protocol
- All recovered capital is returned to the TRECC Vault
- Losses are deducted from the operator’s collateral
- The agent’s reputation score takes a major hit
- If collateral doesn’t fully cover the loss, the Insurance Fund covers the remainder
The Insurance Fund
The Insurance Fund is the protocol’s last line of defence for lenders. It exists to cover bad debt - the scenario where an agent’s loss exceeds its posted collateral. How it works:- The fund accumulates reserves from protocol fees on successful trades
- Only the Risk Engine can draw from the fund (via a
coverLossfunction) - If a liquidation leaves residual debt, the Insurance Fund pays the difference
- Lenders never absorb losses - the fund backstops them
The Insurance Fund is a separate smart contract with its own reserves. It cannot be drained by agents, operators, or protocol governance. Its sole purpose is protecting lender capital.
Why Undercollateralised Lending Is Possible
Traditional DeFi requires 150%+ collateral because human borrowers are unpredictable. TRECC can lend undercollateralised because:- Agents are constrained - they can only interact with whitelisted protocols through audited adapters
- Monitoring is instant - smart contracts check health on every block, not every quarter
- Liquidation is automatic - no waiting for a human to notice a problem
- Reputation aligns incentives - agents that misbehave permanently damage their ability to borrow
- Insurance backstops failures - even worst-case scenarios don’t harm lenders
