---
eip: 7893
label: ERC-7893
title: DeFi Protocol Solvency Proof Mechanism
status: Final
type: Standards Track
category: ERC
created: 2025-01-30
requires: 20, 165
official: https://eips.ethereum.org/EIPS/eip-7893
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7893.md
canonical: https://eips.huatuo.xyz/eip-7893/
lang: en
tldr: A standard on-chain interface for DeFi protocols to publish their assets, liabilities and solvency ratio, with history and risk-alert events that anyone can monitor.
tags: [defi, solvency, risk, oracle, interface]
---

# ERC-7893: DeFi Protocol Solvency Proof Mechanism

> Verifiable solvency proofs and financial health monitoring for DeFi protocols

**TL;DR:** A standard on-chain interface for DeFi protocols to publish their assets, liabilities and solvency ratio, with history and risk-alert events that anyone can monitor.

## What problem does it solve?

Every DeFi protocol reports its financial health differently, if at all. Users, auditors and risk dashboards end up reconstructing positions by hand, and there is no common early-warning signal when a protocol drifts toward insolvency.

ERC-7893 defines one interface, `ISolvencyProof`, so any protocol can expose the same data: what it holds, what it owes, the ratio between the two, how that ratio changed over time, and an event when it crosses a risk threshold.

## How it works

The contract stores two snapshots, each made of parallel arrays plus a timestamp:

- `ProtocolAssets` and `ProtocolLiabilities`: `tokens[]`, `amounts[]` (in token decimals), `values[]` (in ETH, 18 decimals), `timestamp`.

Key rules:

- Only **authorized oracles** may call `updateAssets` / `updateLiabilities`; other callers must be reverted. The arrays must have equal length, and the timestamp is set to `block.timestamp`.
- The solvency ratio is `totalAssets * 10000 / totalLiabilities` (basis points, so `10500` = 105 %).
- `verifySolvency()` returns `(isSolvent, healthFactor)` against the implementation's minimum ratio.
- `getSolvencyHistory(start, end)` returns all snapshots in that inclusive time range.
- Every update emits `SolvencyMetricsUpdated`; breaching a threshold should emit `RiskAlert(riskLevel, currentValue, threshold, timestamp)`.
- The contract must support [ERC-165](/eip-165/) and return true for the `ISolvencyProof` interface ID.

The spec recommends tiers: **CRITICAL** below 105 %, **HIGH RISK** 105–110 %, **WARNING** 110–120 %, **HEALTHY** at 120 % and above.

## Sample code

Reading a protocol's health and watching for alerts (ethers v6):

```ts
import { Contract, JsonRpcProvider, formatEther } from "ethers";

const abi = [
  "function verifySolvency() view returns (bool isSolvent, uint256 healthFactor)",
  "function getProtocolAssets() view returns (tuple(address[] tokens, uint256[] amounts, uint256[] values, uint256 timestamp))",
  "event RiskAlert(string riskLevel, uint256 currentValue, uint256 threshold, uint256 timestamp)",
];

const provider = new JsonRpcProvider(process.env.RPC_URL);
const proof = new Contract(process.env.SOLVENCY_CONTRACT!, abi, provider);

const [ok, hf] = await proof.verifySolvency();
console.log(`solvent=${ok} ratio=${Number(hf) / 100}%`);

const assets = await proof.getProtocolAssets();
const total = assets.values.reduce((a: bigint, v: bigint) => a + v, 0n);
console.log("assets (ETH):", formatEther(total));

proof.on("RiskAlert", (level, value, threshold) => {
  console.warn(`${level}: ratio ${value} below ${threshold}`);
});
```

## Things to know

- Status is **Final**.
- The numbers are only as good as the oracle that writes them. The standard does not prove reserves cryptographically; it standardizes how an authorized party reports them on-chain.
- All values are in ETH with 18 decimals, so a protocol holding mostly stablecoins still has to convert via a price feed.
- If total liabilities are zero, implementations should either return a "max solvency" value or revert; consumers should handle both.
- `getSolvencyHistory` can be expensive over long ranges, and implementations may expire old data as long as they document their retention policy.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7893
