Skip to content
SpendTheBits

DeFi Circuit Breaker: Treasury Auto-Defense Explained

By , Founder, SpendTheBits ·

In short

A DeFi circuit breaker is code that exits a position the moment a monitored risk signal crosses a line. It does the same job a stock exchange's circuit breaker does. Both react to a move too fast for a person to evaluate in time. Hackers stole $1.1 billion from DeFi protocols in 2023, across 231 separate incidents [1]. The single largest loss was the March 2023 Euler Finance exploit. It drained $197 million in under an hour, before anyone at the protocol had read an alert [2]. Treasury Auto-Defense is SpendTheBits' own DeFi circuit breaker. It watches each Earn vault's Yield Safety Score. On a breach, it moves the position to liquid USDC and tells you why, using a grant bounded on-chain to withdraw-to-owner only. It reacts to what has already gone wrong. It cannot see an exploit coming.

$1.1B
stolen from DeFi protocols in 2023 across 231 incidents, per ChainalysisSource: Chainalysis

Stock exchanges have used a circuit breaker since 1988 [3]. Regulators added the rule after the Dow Jones Industrial Average fell 22.6% in one session, on October 19, 1987 [3]. The rule is simple: once a price falls past a set line, trading halts automatically. The drop is moving faster than a human trading desk can weigh it. DeFi has no market-wide version of that rule. Each protocol is its own market. Each treasury holds a different mix of vaults. Nobody rings a bell for you.

This piece looks at what a DeFi circuit breaker actually means. It walks through the Euler Finance hack as a case study in how fast an exploit moves. Then it explains how SpendTheBits' Treasury Auto-Defense applies the same pattern inside a self-custody wallet. We built it, so we have an obvious interest in making it sound good. We have tried to be just as clear about what it does not do.

A gold circuit-breaker switch caught mid-flip with sparks, representing an automatic safety cutoff for yield positions.

What a circuit breaker watches, and what it cannot predict

A circuit breaker is not a forecast. It does not try to spot an exploit before it happens. Nobody has a reliable way to do that across hundreds of contracts, some newly audited, some not audited at all. What a circuit breaker does is narrower: watch a small number of measurable signals, set a threshold in advance, and act the moment that threshold breaks, without waiting for a person to review the situation first.

In SpendTheBits Earn, that signal is the Yield Safety Score, our 0 to 100 rating built from five inputs: track record, liquidity depth, audit history, the operator behind the vault, and observed yield measured against what the vault advertises. The score updates continuously, and it exists specifically so a single number can drive automation. A vague sense that something feels off is not a DeFi circuit breaker. A rule needs a number to compare itself against, and the number needs to be watched constantly, not checked once a week.

March 13, 2023: how Euler Finance lost $197 million in one function call

The clearest case study for why speed matters is the Euler Finance exploit. On March 13, 2023, an attacker found a gap in the protocol's donateToReserves function. It let a user donate collateral to the protocol's reserves without a health check confirming the user could still cover their own debt afterward [2]. The attacker donated collateral to push their own account underwater on purpose, then self-liquidated it and claimed an oversized liquidation bonus. Repeating that pattern drained roughly $197 million in assets, most of it staked ether [2].

The exploit itself took minutes once the attack transaction was ready. What followed took three weeks. Euler Labs negotiated directly with the attacker, and eventually offered a bounty. The attacker returned the funds. By April 3, 2023, the team confirmed recovery of roughly $240 million in total assets [2]. That outcome is unusually good for DeFi. Most exploited funds are never returned, and a treasury cannot plan around getting this lucky. Nobody watching Euler on March 13 could have known in advance that this particular attacker would negotiate.

A smaller total in 2023 hides a faster, more automated attacker

Total DeFi losses actually fell sharply in 2023. They dropped from more than $3.1 billion in 2022 to $1.1 billion, a decline of roughly 64% [1]. That sounds like the danger receding. Read the second number instead. The count of individual hacking incidents rose in the same period, from 219 in 2022 to 231 in 2023 [1]. Fewer dollars, more attempts. Exploits are getting cheaper to run and easier to automate. That is exactly the environment a manual, human-in-the-loop response is worst suited to.

A treasury holding funds across several vaults cannot realistically assign a person to watch each one around the clock. Nobody can read every audit disclosure the moment it posts and still act inside the minutes an exploit like Euler's takes to run. That gap, between how fast an exploit moves and how fast a human notices, is exactly the gap a DeFi circuit breaker is built to close.

How Treasury Auto-Defense applies the pattern

Treasury Auto-Defense reuses the same owner-signed session grant that powers SpendTheBits' auto-sweep feature for idle balances. It scopes that grant narrower on-chain: the grant can only withdraw funds back to the account's own address, never to any other destination. When a vault's Yield Safety Score drops past the threshold you set, the position exits to liquid USDC, and you get an alert explaining why. No grant means no automatic exit. The feature falls back to alert-only, which still tells you something is wrong even when it cannot act on your behalf.

The full mechanics of how Treasury Auto-Defense works live in the help article. The short version: it reuses the same bounded-grant model already used for Earn withdrawals, so adding this feature does not open a new custody surface. Everything sits inside the Earn screen alongside the vaults it protects, and the security page covers how the underlying session key is stored and revoked.

What a DeFi circuit breaker cannot do

It cannot restore funds already lost before the score dropped. Euler's attacker moved $197 million before any external signal existed to react to [2]. It cannot substitute for diligence on which vaults you deposit into in the first place. A newly listed vault with a thin track record starts with a lower score for a reason, and no automation replaces reading why. It is also opt-in. Without an active session grant, Treasury Auto-Defense can only notify you, not move funds, because the whole design deliberately avoids giving any party standing custody over your assets.

A DeFi circuit breaker also cannot outrun every exploit shape. It reacts well to a slow-building risk, like a vault losing liquidity depth over several days. It reacts more slowly to a single-block flash-loan attack that finishes before the next score recalculation runs. Euler's own exploit fits that second, harder case. The drain happened inside one transaction, faster than any external monitor, ours included, could plausibly intervene mid-attack.

Building defense in depth around a circuit breaker

A circuit breaker is one layer, not the whole strategy. Preferring vaults with a higher Yield Safety Score in the first place removes exposure before a breaker is ever needed. Spreading a treasury across more than one vault means a single exploit, even a total loss like Euler's, caps the damage to one slice of the balance rather than all of it. Reviewing the score's five inputs on a regular basis, rather than only after an alert fires, catches the slow decline a threshold trigger is built to catch anyway, just earlier.

None of this is unique to crypto. Every risk framework in finance layers a fast, blunt, automated response underneath slower, more deliberate human judgment: position sizing, diversification, due diligence. DeFi just runs at a different clock speed. That is why Euler's $197 million moved in under an hour [2], and why any tooling built to watch for the next one has to run at machine speed too. A stock exchange's circuit breaker halts trading for fifteen minutes at a time [3]. A DeFi circuit breaker does not get even that long.

The honest limit of an automated defense

A DeFi circuit breaker changes what a bad afternoon looks like. It does not change the base rate of exploits happening across DeFi, and it will never be able to guarantee that. What it can promise is narrower and more useful: given a measurable signal and a threshold, it reacts faster than a person checking Discord ever will, every single time, without needing to be awake.

That is the entire pitch. Treasury Auto-Defense will not have saved Euler Finance from a single-transaction exploit that outran every external monitor watching it. It will catch the slower, more common failure mode: a vault's fundamentals deteriorating over days while nobody happens to be looking. Most losses look like the second case, not the first. That is reason enough to build the circuit breaker, even knowing exactly what it cannot do.

In the app · 5 steps

Put a circuit breaker on your yield in SpendTheBits

Auto-Defense watches every Earn position. It works in two modes: it can alert you, or, with a session grant you sign, it can also exit the position.

  1. Deposit through Earn

    Every vault you hold is listed under Your positions. Auto-Defense watches each position's Yield Safety Score from the moment it exists.

    The Earn screen in SpendTheBits listing a USDC position in Aave v3 on Polygon
  2. Review the defence threshold

    Open Earn settings, using the gear on the Earn screen, and check the score at which a position counts as breached.

  3. Choose alert-only or automatic exits

    The automatic exit needs a signed auto-sweep session that can only withdraw to you. On mainnet today the app runs alert-only and labels the sweep armed but not live yet, so plan to act on the alert yourself.

  4. Make sure the alert can reach you

    Keep notifications on for SpendTheBits. Suggestions and warnings also collect on the Insights screen, so nothing is lost if you miss a push.

    The Insights screen in SpendTheBits listing suggestions such as setting up social recovery and spending guardrails
  5. Confirm the exit in Activity

    A withdrawal, whether triggered by you or by a session, shows in Activity as a normal Earn transaction with its own on-chain hash.

    The Activity screen in SpendTheBits with Earn transactions filterable

Hold your own keys, keep the yield, skip the middleman.

SpendTheBits is a fully non-custodial wallet for 13 chains, free on iOS and Android.

Frequently asked

It is an automated rule that exits a position the moment a monitored risk signal, such as a safety score, crosses a preset threshold, without waiting for a person to review the situation first.

It acts on the next score recalculation after a breach, using the same bounded session grant as Earn's auto-sweep, provided that grant is active. Without it, the feature can only alert you.

No. It uses an owner-signed session grant that is bounded on-chain to withdraw funds only back to your own address, never to any third party.

The attacker returned roughly $240 million in total assets after Euler Labs negotiated directly and offered a bounty, with recovery confirmed by April 3, 2023 [2], an unusually favorable outcome for a DeFi exploit.

No. It reduces exposure to a slow-building risk it can measure in advance, but it cannot undo losses from an exploit that completes within a single transaction before any external signal changes.

Sources

  1. 1.Stolen Crypto Falls in 2023, but Hacking Remains a Threat · Chainalysis · accessed 2026-09-07
  2. 2.War & Peace: Behind the Scenes of Euler's $240M Exploit Recovery · Euler Finance · accessed 2026-09-07
  3. 3.Circuit Breakers Are Doing Their Job, but Don't Close the Markets · NYSE · accessed 2026-09-07

This article is educational and reflects observed data and public sources on the date shown. It is not financial, legal or tax advice. Digital assets can lose value; yields shown are observed, not promised.

STB Weekly, every tuesday

The short version of pieces like this one, plus what moved in AI in finance and agent payments. What you get

Product updates and release notes. No price calls, no spam, unsubscribe in one click. We email you once to confirm before anything else is sent.