---
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/ko/eip-7893/
lang: ko
tldr: DeFi 프로토콜이 자산, 부채, 지급 능력 비율(solvency ratio)을 공개하기 위한 표준 온체인 인터페이스. 이력과, 누구나 모니터링할 수 있는 위험 경보 이벤트를 갖춘다.
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:** DeFi 프로토콜이 자산, 부채, 지급 능력 비율(solvency ratio)을 공개하기 위한 표준 온체인 인터페이스. 이력과, 누구나 모니터링할 수 있는 위험 경보 이벤트를 갖춘다.

## 어떤 문제를 해결하나요?

DeFi 프로토콜마다 재무 건전성을 보고하는 방식이 다르고, 아예 보고하지 않는 곳도 있습니다. 사용자, 감사자, 리스크 대시보드는 포지션을 손으로 재구성할 수밖에 없고, 프로토콜이 지급 불능으로 기울어 갈 때 쓸 공통의 조기 경보 신호도 없습니다.

ERC-7893은 `ISolvencyProof`라는 인터페이스 하나를 정의해, 어떤 프로토콜이든 같은 데이터를 공개할 수 있게 합니다. 무엇을 보유하고 있는지, 무엇을 빚지고 있는지, 둘 사이의 비율, 그 비율이 시간에 따라 어떻게 변했는지, 그리고 위험 임계값을 넘었을 때의 이벤트입니다.

## 어떻게 동작하나요?

컨트랙트는 두 개의 스냅샷을 저장하며, 각각 병렬 배열과 타임스탬프로 구성됩니다.

- `ProtocolAssets`와 `ProtocolLiabilities`: `tokens[]`, `amounts[]`(토큰 decimals 기준), `values[]`(ETH 기준, 18 decimals), `timestamp`.

주요 규칙:

- `updateAssets` / `updateLiabilities`는 **승인된 오라클**만 호출할 수 있으며, 다른 호출자는 리버트되어야 합니다. 배열 길이는 같아야 하고 타임스탬프는 `block.timestamp`로 설정됩니다.
- 지급 능력 비율은 `totalAssets * 10000 / totalLiabilities`입니다(베이시스 포인트이므로 `10500` = 105 %).
- `verifySolvency()`는 구현의 최소 비율을 기준으로 `(isSolvent, healthFactor)`를 반환합니다.
- `getSolvencyHistory(start, end)`는 그 시간 범위(양 끝 포함)의 모든 스냅샷을 반환합니다.
- 업데이트마다 `SolvencyMetricsUpdated`를 emit하며, 임계값을 넘으면 `RiskAlert(riskLevel, currentValue, threshold, timestamp)`를 emit해야 합니다.
- 컨트랙트는 [ERC-165](/eip-165/)를 지원해야 하고 `ISolvencyProof` 인터페이스 ID에 대해 true를 반환해야 합니다.

명세가 권장하는 단계: 105 % 미만은 **CRITICAL**, 105–110 %는 **HIGH RISK**, 110–120 %는 **WARNING**, 120 % 이상은 **HEALTHY**입니다.

## 샘플 코드

프로토콜의 건전성을 읽고 경보를 지켜보기(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}`);
});
```

## 알아둘 점

- 상태는 **Final**입니다.
- 숫자의 신뢰도는 그것을 기록하는 오라클만큼입니다. 이 표준은 준비금을 암호학적으로 증명하지 않으며, 승인된 주체가 준비금을 온체인에 보고하는 방식을 표준화할 뿐입니다.
- 모든 값은 18 decimals의 ETH 기준이므로, 스테이블코인을 주로 보유한 프로토콜도 가격 피드로 환산해야 합니다.
- 총 부채가 0이면 구현은 "최대 지급 능력" 값을 반환하거나 리버트해야 하며, 사용하는 쪽은 둘 다 처리해야 합니다.
- `getSolvencyHistory`는 긴 범위에서는 비용이 클 수 있고, 구현은 보존 정책을 문서화하는 한 오래된 데이터를 만료시킬 수 있습니다.


---

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