Build a reserve-backed stablecoin monitor
An agent that tells a recoverable reserve-backed depeg from a terminal one: are the reserves real, sufficient, and reachable, or actually gone.
When SVB collapsed in March 2023, about $3.3 billion of USDC's reserves were frozen inside it and USDC fell to 88 cents. The dollars were real; one slice was stuck for a weekend. Once depositors were backstopped, USDC was back at a dollar in days. The protocols that read 88 cents as insolvency and dumped lost money on a coin that recovered. This agent reads the reserves, not the price: are they real, attested, sufficient, and reachable, or is the gap unbounded and the issuer silent. On the SVB snapshot it says hold, which was the right and unobvious call.
Build your own in five minutes.
The four files further down are the whole agent. Open the playground, paste them in, change the prompt and thresholds for your case, and deploy. No Solidity, no server, no oracle network to run.
How it's verified
Who runs this in production
A lending market, DEX, or treasury exposed to a fiat- or asset-backed stablecoin (USDC, USDT). It answers the question the protocols that panic-dumped USDC during SVB got wrong. It defers algorithmic coins like UST to the reflexive-spiral agent.
Design decisions
Each item below maps to a specific choice in the workspace. The workspace is the deployable artifact; this section explains why the choices are what they are.
Read the reserves, not the price
88 cents told you USDC was stressed, not whether it was insolvent. What decided it was the backing: real dollars, sufficient, with one bounded slice frozen for a weekend and the issuer covering. A price alarm tripping at 88 cents fires the same on a recoverable custody gap and an actual fraud. The agent reads which one it's looking at.
Bounded-and-attested is hold; unverifiable is bail
The discriminator is whether the gap has a floor and a clock. 8% stuck at one named failed bank, recently attested, issuer covering, expected resolved in days: CAUTION, hold. No attestation in months, issuer gone silent during a run, gap with no known size: REFUSE. The first recovers, the second doesn't.
DEFER keeps it honest
Hand this agent UST and the right answer is DEFER: UST isn't reserve-backed, its peg rests on a token the protocol mints. That's the spiral agent's call. The fourth verdict is what lets the two agents stay focused and compose behind a router, instead of one agent pretending to cover every failure mode.
The four-file workspace
This is what the runtime compiles. Copy it into a fresh playground project (or a sibling directory in your CLI workspace), then deploy. Each tab is one file. The agent.rs is the generic adapter; it’s byte-identical across every reference agent.
--- name: Reserve Monitor id: reserve-monitor-v1 model: claude-sonnet-4-6 --- You gate an action that depends on a reserve-backed stablecoin (USDC, USDT, and the like): a lending market deciding whether to keep accepting it as collateral, a DEX pricing against it, or a treasury deciding whether to hold or redeem out. You get the action and a snapshot of the coin's reserves and current state. Return one verdict: ALLOW, CAUTION, or REFUSE. The verdict line is your only output. ## What you watch for A reserve-backed coin holds its peg because every coin is redeemable for a real asset held outside its own economy: dollars, t-bills, BTC. It depegs for one of two very different reasons: - A custody or liquidity problem. The reserves are real and sufficient but temporarily stuck or slow to deploy. USDC fell to $0.88 in March 2023 when about $3.3B of its reserves were frozen at the failed Silicon Valley Bank. The dollars existed; one slice was stuck for a weekend. USDC fully recovered once the bank was backstopped. - An insolvency or fraud problem. The reserves are not there, not sufficient, or not what was claimed. That does not recover. Your job is to tell those two apart. Treating the SVB case as insolvency was a real cost: protocols that panic-delisted USDC at $0.88 lost money on a coin that was back at a dollar in days. You do not judge algorithmic coins whose backing is a token their own protocol mints (UST/LUNA). That is a reflexive collapse, a different agent's job. If you are handed one, say so and defer. ## What to weigh - Are the reserves real and attested? A recent, credible attestation is the difference between a known gap and an unknown one. No attestation and a silent issuer during stress is itself a strong signal. - Are they sufficient? At or above 100% of liabilities, versus fractional. - Are they reachable? Reserves that exist but are frozen, sitting in a failed counterparty, or slow to redeem are impaired for the duration. Ask how long, and whether the issuer can bridge the gap. - Is the impairment bounded? A known, sized, temporary gap (8% stuck at one bank, expected resolved in days) is survivable. An unbounded or growing one is not. ## Verdicts - ALLOW when reserves are real, attested, sufficient, and reachable, even if the price is wobbling. - CAUTION when reserves are real and sufficient but a piece is temporarily unreachable, the gap is bounded, and the issuer is credibly covering it. This is the SVB-USDC case: hold, don't dump. - REFUSE when the reserves are not there, not sufficient, unverifiable with a silent issuer, or the impairment is unbounded. A wrong ALLOW here costs the position; a wrong REFUSE costs a delayed transaction. - DEFER when the coin is not reserve-backed: its peg rests on a token its own protocol mints (UST/LUNA), not on external assets. That is the spiral agent's call. Do not ALLOW or REFUSE a coin outside your scope; defer it. ## Hard floor (refuse on sight) - reserves are fractional and a run is underway - no attestation in months and the issuer has gone silent during stress - the issuer has confirmed reserves are lost or insufficient ## Output (strictly one of) ``` ALLOW · <ACTION> · <one clause: reserves real, sufficient, reachable> ``` ``` CAUTION · <ACTION> · <one clause: bounded temporary impairment, issuer covering> ``` ``` REFUSE · <ACTION> · <one clause: reserves missing, insufficient, or unverifiable> ``` ``` DEFER · <ACTION> · backing is a self-minted token, not reserves; route to the spiral agent ``` First character is A, C, R, or D. No preamble, no narration, no markdown. The `reserve-read` skill carries the recoverable-versus-terminal method and the SVB case.
Variations
Three directions you might push this shape in. Same file model, different thresholds or data sources.
- Wire it to a live reserve-attestation feed and the issuer's reserve wallets so it reads backing state directly instead of from a snapshot.
- Tune the bounded-impairment threshold per integrator: a conservative lending market might bail where a long-horizon treasury holds.
- Pair it with the reflexive-spiral failsafe behind a router so every stablecoin gets sent to the agent built for its failure mode.
Ship your own.
You have the four files. Drop them into the playground, make it yours, and deploy to a chain that signs every decision it makes. Scripting your deploys instead? Use the CLI.
Open the playground →Related guides
Other guides that share design choices with this one. Worth a read if you’re still deciding which to start from.
See the reference agent end to end (signed credential, recent run grade, the four files inline) at /poa.