Skip to content
Reading depth

Each view includes the earlier layers; the complete engineer or auditor page is shown by default.

Accounting risk is the possibility that balances, shares, debts, fees, profits, losses, or valuations no longer represent the system's actual assets and obligations.

Warning cross category cue

Accounting risk is the possibility that the numbers used to move value no longer represent the system’s actual assets, obligations, and user entitlements.

DeFi repeatedly converts assets into claims and back again. Deposits, withdrawals, borrows, repayments, interest, fees, rewards, losses, donations, rebases, queues, and cross-chain positions must be recognized at explicit times and units. A small rounding or recognition error can compound or be deliberately repeated.

Financial reporting, valuation, and reconciliation risk are useful analogies. In a smart contract, accounting often controls an immediate asset transfer. An error is therefore not merely a misstated report; it can create a permissionless extraction path before a later close or audit.

reconciliationDifference = recognizedAssets
- recognizedLiabilities
- attributableNetValue

The target difference and tolerated rounding must be defined by the accounting model. A zero difference is not meaningful if assets or liabilities were omitted or valued under inconsistent units and timestamps.

  1. A state transition observes balances and recognized positions.
  2. It converts units and calculates shares, debt, fees, profit, or loss.
  3. It transfers assets and records new claims or liabilities.
  4. Later events update value, liquidity, impairment, and pending operations.
  5. Reconciliation identifies whether every unit remains attributable exactly once.

Capital flow is the actual balance change. Claim flow is mint, burn, debt, or queue accounting. Return flow records named income and fees without confusing deposits or token donations with profit. Risk flow transfers any mismatch to users who mint, redeem, borrow, repay, or remain in the system at the wrong value.

Accounting creates no external return. It allocates income from borrowers, traders, networks, issuers, or incentives and allocates costs and losses. A mismatch transfers value between users, fee recipients, reserves, or claim classes rather than creating value.

OpenZeppelin’s ERC-4626 guide demonstrates how share price, rounding, donations, and inflation attacks interact in tokenized vaults. The mitigation is specific to an implementation and parameterization; ERC-4626 conformance alone does not certify accounting safety. The guide was reviewed 2026-08-10.

An engineer or auditor should specify recognition time, price source, units, decimals, rounding direction, fee base, pending-state treatment, impairment, actual balance deltas, and the invariant reconciling assets, liabilities, and claim supply after every operation and adversarial sequence.

  • “The contract balance is total assets.” Assets can be deployed or owed, while liabilities and pending claims may not appear in token balance.
  • “Rounding dust is harmless.” A favorable direction can be repeated, amplified, or concentrated around empty and near-empty states.
  • “A preview is the executable value.” Price movement, fees, limits, queues, and liquidity can make execution differ.

Continue with net asset value, vault share, and solvency risk.

Machine-readable model

Key equations

Canonical expressions come from the structured concept record. KaTeX renders the notation, while the plain-text expression and variable table keep its meaning and units inspectable without JavaScript. Read the narrative above for the model's domain, assumptions, and rounding rules.

  1. Equation 1

    Plain-text equation: reconciliationDifference = recognizedAssets - recognizedLiabilities - attributableNetValue

Assurance contract

Security properties

These structured statements define desired behavior. Their stable IDs can bind tests, invariants, specifications, audit findings, or proof results without turning descriptive review advice into an assurance claim.

Desired · not evaluated: No test, audit, or proof result is implied until scoped evidence is linked to this property.

  1. Controlled assets, deployed positions, receivables, liabilities, reserves, fees, losses, and claim supply reconcile after every state transition

  2. Deposits, withdrawals, borrows, repayments, profits, losses, fees, donations, and rebases use explicit recognition times and rounding directions

  3. No user can create valuable claims without contributing or becoming entitled to equivalent net value under the selected model

  4. Preview, accounting, executable, and market values remain separately named and cannot be substituted without stated slippage, liquidity, and timing assumptions

Knowledge check

Quiz

Answer in your own words, then open the model answer.

What problem does Accounting risk exist to address?

Model answer

DeFi repeatedly converts between assets and claims, so small recognition, rounding, timing, or reconciliation errors can transfer value and compound across deposits, withdrawals, and integrations.