When nothing breaks
The class of incidents in which every contract did exactly what it says — and the outcome is a loss anyway.
This lesson has had no expert review. It was written for this platform and against the evidence it cites; nobody has gone through it independently.
Learning objectives
- You can distinguish economic exploits from logic errors and name what follows for the examination.
- You can name the three ingredients such an incident needs.
- You can explain why an audit report covers this class only partly.
Check your prior knowledge
Answer these for yourself before reading on. Wherever you hesitate is where this lesson pays off.
- What does a code audit examine — and against what does it measure “correct”?
- Where does a protocol get the price it computes with?
- What does it cost to move a great deal of capital for the duration of one transaction?
Core concept
Correct and loss-making all the same
A logic error is a divergence between what the code does and what it should do. An economic exploit is something else: the code does what it should, but the assumptions under which that rule made sense do not hold at that moment. A logic error is checkable against a specification. An economic exploit is only checkable against a model of the circumstances — and that model is rarely written down anywhere.
Three ingredients
Almost every incident of this class needs the same things: a rule depending on an observed quantity (usually a price); a way to move that quantity briefly; and enough capital to do so. The third point is the one that changed: capital for the duration of a single transaction is available without collateral, because repayment is enforced within the same call.
The examination question shifts
Against logic errors, examining the code helps. Against this class, what helps is testing the rules for their assumptions: which observed quantity feeds a decision? How expensive would it be to move it for the duration of a block? And what happens if exactly that occurs? The third question is a modeling question, and it belongs in the analysis even when two audit reports exist.
What the research places here
That assurance services in this field are themselves the object of empirical research, and that an audit's existence is a finding about the process, is recorded in EVD-2026-0005; that smart contracts have nameable limits around external data, in EVD-2026-0004. Both sources place mechanisms in general. They say nothing about any particular contract or incident, and they replace no audit.
Definitions
- Economic exploit
- An incident in which contracts execute as specified while the assumptions behind the rules do not hold.
- Flash loan
- An uncollateralized borrowing whose repayment is enforced within the same call — otherwise the whole call counts as not having happened.
- Specification
- The description of what a program should do — the yardstick an audit checks against.
Model
Which observed quantity feeds a decision of the contract?
How deep is the market that quantity comes from?
How large is the sum decided on its basis?
If line three exceeds line two, the finding must be recorded
Formulas
Rough attack arithmetic
worthwhile if achievable_gain > cost_of_moving + fees- achievable_gain
- What the distorted quantity makes payable
- cost_of_moving
- Price impact and fees to shift the observed quantity briefly
- fees
- Execution costs including the in-transaction borrowing fee
Limit: The inequality describes when an attempt pays, not whether it is possible — and it knows the cost of moving only for the depth present today. If depth grows, the arithmetic flips without anything in the contract changing. It is a thinking tool, not a security assessment.
Worked example
A rule that is sensible taken on its own
- Rule
- collateral value follows the price in pool X
- Depth in pool X
- USD 1.4m in the tight band
- Borrowable at a distorted price
- up to USD 9m
- Cost of moving the price for one block
- roughly USD 300,000
Achievable gain well above the cost of moving: the rule takes its price from a market shallower than the sum it decides over. Every contract works correctly throughout.
No bug in the code, no rule broken — and a loss the size of the difference all the same.
Reading: The checkable finding is not “sloppy code” but: the price source is shallower than the sum depending on it. That is one number against another and can be established before an incident — so the question belongs in every examination of a collateralized position.
Retrieval
Exercise on real data
Check the guiding questions for those needing an audit report and those answerable from market data.
Dimension 9: security →Determine which of the figures named there says nothing at all about this class of failure.
Case study: audit present, question open →Application
Write the examination line covering this class of failure for a collateralized position.
Related case studies
- CASE-12 — What an audit study establishes
- CASE-09 — Audit present, question open
- CASE-04 — A dependency chain across four protocols
Institutional reading
- Bank
- Which of your controls would notice an incident in which no rule was broken?
- Insurance
- Under your wording, would an incident without a rule breach be a covered event?
Metrics in this lesson
Key takeaways
- Economic exploits breach no specification, only the assumptions behind it.
- The ingredients are a price-dependent rule, a movable source and short-term capital.
- Price-source depth against the dependent sum is measurable in advance — and belongs in every examination.
Evidence
- EVD-2026-0005
Review of Accounting Studies (Springer) — Decentralized Finance (DeFi) assurance: early evidence
- EVD-2026-0004
Annual Review of Financial Economics — Smart Contracts and Decentralized Finance