§ 01Model
One pool of USDG. Every agent's line is vouched for by exactly one backer, and every dollar of that line comes out of the backer's own stake. When a line defaults, the loss comes out of the stake of whoever vouched for it, and nobody else.
// accounting — MiraiPool
backing(r) = value of backer r's locked pool shares // also earns the lenders' share of fees
free(r) = backing(r) − vouchedOut(r) − feeLocked(r)
available(a) = line(a) − owed(a) // from its one backer; 0 without one
vouch(r → a, x) require x ≤ free(r) and the agent owner's signed consent
vouchedOut(r) += x ; line(a) += x // repaying grows the record, never the line
borrow(a, P) require minLoan ≤ P ≤ available(a)
owed(a) += P ; fee = P · 1% · term / 30d ; feeLocked(backer) += fee
repay(a, P+fee) fee → lenders 50% · backer 25% · reserve 25%
LenderDeposits USDG, holds pool shares and earns half of every base fee. Every line is fully covered by a backer's locked shares, and a default burns those shares, so no path we know of lets a loan loss reach lender principal. That rests on Robinhood Chain, the ERC-8004 registry and USDG working as they do today. Withdrawals never wait for agents. A 0.5% fee on leaving within 7 days of a deposit stays with the lenders who stay. Experimental contracts: capital is at risk.
BackerLocks USDG as pool shares and vouches lines out of them, each one only with the agent owner's signed consent. Its stake earns the lenders' share of fees and pays when a line it vouched defaults. Anyone can become one; stake that backs nothing can be unlocked.
AgentAn ERC-8004 identity. Borrows $5 to $500 for 1 to 30 days at 1% per 30 days, inside the line its backer vouched. The fee is fixed at borrow time and is due in full even if it repays early. With no loan open it can leave, or move to another backer it signs for.
ConsentAn EIP-712 signature from the agent's NFT owner naming one backer and the most premium it accepts. Only that backer can use it, and it stops working if the NFT changes hands. No agent gets a line it didn't sign for.
ReserveTakes a quarter of every base fee. Backers cover defaults, so the reserve only absorbs rounding dust and pays an optional keeper bounty for marking defaults (zero to start).
§ 02Loans and defaults
A loan is open, repaid or defaulted. The last one is where the backer pays.
markDefault(loan) require now > due + grace // grace is 3 days, fixed at borrow
burn ⌈(P + fee) · totalShares / totalAssets⌉ of the backer's locked shares
vouchedOut(backer) −= P ; line(a) −= P
backerDefaults(backer) += 1 // −75 on the backer's score
defaulted(a) = true // for good: score 0, never a new line
ownerDefaults(owner) += 1 // that wallet's agents can't borrow again
backer.onDefault(…) // vault hooks: a $MIRAI stake burns, stock lines keep owed + 20%
// the 5 USDG bond of a treasury line can then be sent to the Safe by anyone
share price: never falls · lenders untouched
§ 03Score
Five terms over the on-chain record, 0 to 1,000, computed by the lens contract. Nobody sets or edits it by hand. The two big terms are dollar-days and week-long loans, so the cheapest road to a high score is to hold real money for real time and give it back.
score(a) = defaulted ? 0 :
min(400, dollarDaysRepaid / $10) // Σ principal × time actually held, capped at the term
+ min(200, 20 · weekLongLoans) // loans held at least 7 days
+ min(150, line / $5) // someone's money at risk for you
+ min(150, 2 · daysEnrolled)
− 75 · loansItBackedThatDefaulted
− 10 · lateRepayments
Small, short loans repay fine but add little. Money held for weeks adds the most.
§ 04Invariants
Checked after every call by a stateful fuzzer driving deposits, withdrawals, stakes, consented vouches, borrows, repayments, defaults, failing hooks, parameter changes and time. Passing them does not prove the contracts safe.
I1 · SolvencybadDebt = 0
share price never fallsNo loan loss reaches lenders.
I2 · CashUSDG ≥ liquidity + reserve
+ unclaimed backer feesBacker stake is pool shares, not a separate balance.
I3 · Exposure∀a owed(a) ≤ line(a)
∀r vouchedOut(r) ≤ backing(r)An agent never owes more than its backer vouched.
Results are published with each contract release in the dev log.
§ 05Parameters
Read from getParams() on the deployed pool. The owner can adjust them only inside hard bounds written into the contract, and every change emits an event.
§ 06$MIRAI and the treasury
$MIRAI launches on Pons, the launchpad on Robinhood Chain. An agent's owner will be able to stake it behind the agent's own line in the seat vault (§ 08); the vault's own USDG backs the line in the pool.
The treasury is topped up by hand: anyone can send it USDG and call sweep(), which stakes all of it as pool shares under the treasury's own ERC-8004 identity. From that stake it gives each invited agent a $5 line, after the owner locks a 5 USDG bond. The bond comes back once the agent has no line, no open loan and no default, at least 4 days after it was posted. New treasury lines are capped per week. A default burns the treasury's shares, and the bond goes to the Safe.
TreasurySponsor
sweep() // anyone: stake every USDG it holds as pool shares
firstLine(agent, invite, consent) // once per agent, after a 5 USDG bond → vouch $5
raise(agent) // 3 week-long loans, 14 days, score ≥ 100 → $25
reclaim(agent) // anyone: idle 30 days, no loan open → line back
collect() // its backer fees → restaked
Σ new lines ≤ weekly cap
§ 07Interface
Everything an agent, a backer or a lender can do. The score is one view call on the lens. The record of any agent is free at /api/check; the ABIs are served at /abi/<Contract>.json.
deposit(assets, receiver, minShares) → shares lender
withdraw(shares, receiver, minAssets) → assets lender
enrollRoot(backerId, assets) backer
vouchWithConsent(backerId, agentId, amount, premiumBps, consent, sig) backer
borrow(agentId, amount, term, to, maxFee) → loanId agent
repay(loanId, agentId, maxDue) anyone
leave(agentId) agent
markDefault(loanId) anyone
claimSponsorFees(backerId, to) backer
lens.score(agentId) · lens.creditReport(agentId) view
GET /api/check?agent=:id free, no key
§ 08Vaults
Two vaults act as backers with their own USDG, so an owner can open a bigger line with collateral instead of a sponsor.
Stock vaultDeposit Robinhood stock tokens; the vault vouches a line of 25 to 70% of their Chainlink value, at most $500. Repay and close, and the tokens come back. On a default the vault keeps tokens worth what is owed plus 20% and returns the rest. A sharp move or a stale price holds new loans on that token.
Seat vaultThe owner stakes $MIRAI worth at least twice the line (three times when the price is volatile or stale). Lines climb in tiers; a late repayment drops one tier. A default burns three quarters of the stake and returns the rest. Opens when the token launches.
| Tier | Ceiling | To reach it |
| T1 | $50 | No record needed: never defaulted, the owner's wallet has no default, no loan open, stake posted. |
| T2 | $100 | 14 days at T1 and 3 counted loans of at least $25. |
| T3 | $175 | 14 days at T2 and 3 counted loans of at least $50. |
| T4 | $300 | 14 days at T3 and 3 counted loans of at least $87.50. |
| T5 | $500 | 14 days at T4 and 3 counted loans of at least $150. |
A counted loan lasts 8 to 10 days, is repaid on time at least 7 days after it was taken, and is at least half the tier's ceiling.
§ 09Addresses
The contracts this site reads, on Robinhood Chain.