Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article covers ERC7893, a proposal for a standard interface through which DeFi protocols can disclose their assets and liabilities on-chain and allow their solvency to be verified and monitored in real time.
The explanation below is based on the following resources.
I have also written about other EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.
Overview
ERC7893 defines a standard interface for DeFi protocols to implement solvency proofs that can be verified through smart contracts.
Being able to demonstrate that the assets a DeFi protocol holds cover its liabilities to users is fundamental to trust. Traditionally, however, reporting methods have varied between protocols, making it difficult to assess their financial health in real time. ERC7893 defines structured data types for assets and liabilities and combines them with oracle price feeds. It standardizes the calculation of solvency ratios, the retention of historical data, and the emission of risk alert events when thresholds are breached. A minimum solvency ratio of 105% can be configured, and anyone can query the protocol's financial position on-chain.
The following diagram shows the overall architecture of ERC7893.

Motivation
Several problems motivated this proposal.
Lack of standardized financial reporting
In the DeFi ecosystem, each protocol reports its financial health in its own way. Some protocols disclose their asset positions through off-chain dashboard data, while others use custom smart contracts. Reporting methods are inconsistent. This makes it difficult to compare protocols and prevents investors and users from accurately assessing risk.
Insufficient real-time monitoring
Traditional methods often rely on periodic manual reports to track a protocol's financial position, which may miss significant changes during rapid market movements. Crypto asset prices can be particularly volatile, and a report that is even a few hours late may arrive too late for an effective response.
Absence of early warning systems
There has been no standardized early warning mechanism for detecting deteriorating protocol financial health. If users and monitoring systems cannot detect dangerous conditions in a protocol promptly, they lack a means of intervening before events such as the Terra/LUNA collapse or FTX insolvency occur.
Complexity of the audit process
On-chain audits require an understanding of each protocol's distinct data structures and calculation methods, making the reconstruction of historical positions labor-intensive. A standardized interface would allow common audit tooling and substantially improve efficiency.
Difficulty of cross-protocol risk assessment
Because protocols use their own reporting formats, assessing systemic risk across multiple protocols has been practically impossible. A common interface would allow risk data from multiple protocols to be aggregated, making systemic risk monitoring possible in a way today's fragmented reporting systems cannot support.
How the proposal addresses these problems
ERC7893 addresses these problems by defining a common interface called ISolvencyProof.
It provides a uniform representation of assets and liabilities, a standard formula for calculating the solvency ratio, and events that signal breaches of risk thresholds.
This allows the financial health of different protocols to be compared and aggregated using the same criteria, enabling systemic risk monitoring as well.
Alternatives included off-chain reporting, protocol-specific standards, and more sophisticated and complex risk models. Off-chain reporting cannot guarantee verifiability or trustlessness, protocol-specific standards miss the benefits of interoperability, and complex risk models compromise the balance between comprehensiveness and feasibility. A common on-chain interface was therefore selected as the preferred approach.
Specification
An ERC7893 implementation must implement the ISolvencyProof interface.
It must also implement the ERC165 supportsInterface function and return true for the interface ID of ISolvencyProof.
For more about ERC165, see the following article.
[ERC165] How to Check Whether a Contract Supports a Specific Interface
Core requirements
Implementations must meet the following requirements.
- Store the token addresses, quantities, and ETH-denominated values of assets and liabilities in contract state variables, and update them through
updateAssetsandupdateLiabilities. - Record the timestamp of each update.
- Calculate the solvency ratio as
(total assets / total liabilities) × 10000. - Support queries for historical solvency metrics over a specified time range. Set a retention period of approximately one year and document the retention policy.
- Emit a
SolvencyMetricsUpdatedevent when financial metrics are updated. Emitting aRiskAlertevent when a risk threshold is breached is recommended. - Ensure all arrays within the
ProtocolAssetsandProtocolLiabilitiesstructs have the same length. - Express all prices in ETH with 18 decimal places.
Interface definition
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;
interface ISolvencyProof {
struct ProtocolAssets {
address[] tokens;
uint256[] amounts;
uint256[] values;
uint256 timestamp;
}
struct ProtocolLiabilities {
address[] tokens;
uint256[] amounts;
uint256[] values;
uint256 timestamp;
}
event SolvencyMetricsUpdated(
uint256 totalAssets,
uint256 totalLiabilities,
uint256 healthFactor,
uint256 timestamp
);
event RiskAlert(
string riskLevel,
uint256 currentValue,
uint256 threshold,
uint256 timestamp
);
function getProtocolAssets() external view returns (ProtocolAssets memory);
function getProtocolLiabilities() external view returns (ProtocolLiabilities memory);
function getSolvencyRatio() external view returns (uint256);
function verifySolvency() external view returns (bool isSolvent, uint256 healthFactor);
function getSolvencyHistory(uint256 startTime, uint256 endTime)
external view returns (
uint256[] memory timestamps,
uint256[] memory ratios,
ProtocolAssets[] memory assets,
ProtocolLiabilities[] memory liabilities
);
function updateAssets(
address[] calldata tokens,
uint256[] calldata amounts,
uint256[] calldata values
) external;
function updateLiabilities(
address[] calldata tokens,
uint256[] calldata amounts,
uint256[] calldata values
) external;
}The interface consists of four main components: data structures (structs), events, query functions (view functions), and update functions. Each is described below.
Structs
ProtocolAssets
struct ProtocolAssets {
address[] tokens;
uint256[] amounts;
uint256[] values;
uint256 timestamp;
}This struct represents the assets held by the protocol.
Its arrays are parallel: tokens[i], amounts[i], and values[i] describe the same token.
For example, if the protocol holds 100 WETH and 50,000 USDC, tokens contains their respective token addresses, amounts contains their quantities using each token's native precision, and values contains their converted ETH-denominated values with 18 decimal places.
| Field | Type | Description |
|---|---|---|
tokens |
address[] |
Array of contract addresses of the tokens being tracked. |
amounts |
uint256[] |
Array of quantities held for each token, expressed using the token's native decimals. |
values |
uint256[] |
Array of ETH-denominated values of the holdings of each token, expressed with 18 decimal places. |
timestamp |
uint256 |
Unix timestamp of the last update, in seconds. Used to verify data freshness. |
ProtocolLiabilities
struct ProtocolLiabilities {
address[] tokens;
uint256[] amounts;
uint256[] values;
uint256 timestamp;
}This struct represents the protocol's liabilities, such as repayment obligations to users.
It has the same structure as ProtocolAssets. A lending protocol might record outstanding loans as liabilities, while a DEX might record obligations to return assets to LP token holders.
| Field | Type | Description |
|---|---|---|
tokens |
address[] |
Array of contract addresses of tokens associated with liabilities. |
amounts |
uint256[] |
Array of liability quantities, expressed using each token's native decimals. |
values |
uint256[] |
Array of ETH-denominated values of the liabilities, expressed with 18 decimal places. |
timestamp |
uint256 |
Unix timestamp of the last update, in seconds. |
Events
SolvencyMetricsUpdated
event SolvencyMetricsUpdated(
uint256 totalAssets,
uint256 totalLiabilities,
uint256 healthFactor,
uint256 timestamp
);This event is emitted when the protocol's financial metrics are updated.
Off-chain monitoring systems and dashboards can listen for it to track the protocol's financial position in real time.
It must be emitted after each successful call to updateAssets or updateLiabilities.
| Parameter | Type | Description |
|---|---|---|
totalAssets |
uint256 |
Total asset value, denominated in ETH. |
totalLiabilities |
uint256 |
Total liability value, denominated in ETH. |
healthFactor |
uint256 |
Solvency ratio, calculated as (totalAssets / totalLiabilities) × 10000. A value of 10500 represents 105%. |
timestamp |
uint256 |
Unix timestamp of the update. |
RiskAlert
event RiskAlert(
string riskLevel,
uint256 currentValue,
uint256 threshold,
uint256 timestamp
);This event is emitted when a risk threshold is breached.
For example, when the solvency ratio falls below 105%, an event can be emitted with the "CRITICAL" risk level, allowing monitoring systems and automation tools to detect the condition and respond immediately.
| Parameter | Type | Description |
|---|---|---|
riskLevel |
string |
String indicating the severity of risk: "CRITICAL", "HIGH_RISK", or "WARNING". |
currentValue |
uint256 |
Current value that triggered the alert. |
threshold |
uint256 |
Risk threshold that was breached. |
timestamp |
uint256 |
Unix timestamp of the alert. |
Functions
getProtocolAssets
function getProtocolAssets() external view returns (ProtocolAssets memory);Retrieves the protocol's current asset position.
External monitoring tools, dashboards, and other smart contracts call this function to inspect the protocol's holdings in real time.
It returns a ProtocolAssets struct containing all token addresses, quantities, ETH-denominated values, and the last update timestamp.
Return value
ProtocolAssets memory — Struct containing the complete current asset position.
getProtocolLiabilities
function getProtocolLiabilities() external view returns (ProtocolLiabilities memory);Retrieves the protocol's current liability position.
This is the counterpart to getProtocolAssets. Comparing the results of both functions allows callers to assess the protocol's financial health.
Return value
ProtocolLiabilities memory — Struct containing the complete current liability position.
getSolvencyRatio
function getSolvencyRatio() external view returns (uint256);Calculates and returns the current solvency ratio.
The formula is (totalAssets * 10000) / totalLiabilities. A return value of 10500 means that assets equal 105% of liabilities.
If totalLiabilities is 0, the function returns a value representing maximum solvency or reverts with an appropriate error.
For example, if total assets are 100 ETH and total liabilities are 80 ETH, the solvency ratio is (100 * 10000) / 80 = 12500, representing 125%.
Return value
uint256 — Solvency ratio, scaled by 10000.
verifySolvency
function verifySolvency() external view returns (bool isSolvent, uint256 healthFactor);Returns a Boolean indicating whether the protocol remains solvent.
Unlike getSolvencyRatio, which returns the raw solvency ratio, this function returns both whether the minimum requirement is met and the current health factor in a single call.
This is useful for integrations between DeFi protocols that need to verify the financial health of a counterparty protocol.
Return values
bool isSolvent — true if the solvency ratio meets or exceeds the minimum requirement.
uint256 healthFactor — Current solvency ratio.
getSolvencyHistory
function getSolvencyHistory(uint256 startTime, uint256 endTime)
external view returns (
uint256[] memory timestamps,
uint256[] memory ratios,
ProtocolAssets[] memory assets,
ProtocolLiabilities[] memory liabilities
);Returns historical solvency metrics within a specified time range.
This allows past financial positions to be examined for purposes such as auditing, risk trend analysis, and regulatory reporting.
All recorded snapshots with timestamps from startTime through endTime, inclusive, are returned.
Because this operation can consume substantial gas, implementations are advised to cap the number of results.
| Parameter | Type | Description |
|---|---|---|
startTime |
uint256 |
Start of the time range (Unix timestamp in seconds). |
endTime |
uint256 |
End of the time range (Unix timestamp in seconds). |
Return values
uint256[] memory timestamps — Array of historical update timestamps.
uint256[] memory ratios — Array of historical solvency ratios, scaled by 10000.
ProtocolAssets[] memory assets — Array of historical asset positions.
ProtocolLiabilities[] memory liabilities — Array of historical liability positions.
updateAssets
function updateAssets(
address[] calldata tokens,
uint256[] calldata amounts,
uint256[] calldata values
) external;Updates the protocol's asset data.
Only authorized oracles can call this function. It reverts if msg.sender is not an authorized oracle.
The tokens, amounts, and values arrays must have the same length; the function also reverts if they differ in length.
After the update, the timestamp is automatically set using block.timestamp, and a SolvencyMetricsUpdated event is emitted.
| Parameter | Type | Description |
|---|---|---|
tokens |
address[] calldata |
Array of token addresses to update. |
amounts |
uint256[] calldata |
Array of quantities of each token. |
values |
uint256[] calldata |
Array of ETH-denominated values of each token. |
updateLiabilities
function updateLiabilities(
address[] calldata tokens,
uint256[] calldata amounts,
uint256[] calldata values
) external;Updates the protocol's liability data.
The same validation rules as updateAssets apply, and only authorized oracles can call it.
The recommendation is to update liabilities only when positions change, leaving liability data unchanged during price updates.
| Parameter | Type | Description |
|---|---|---|
tokens |
address[] calldata |
Array of liability token addresses to update. |
amounts |
uint256[] calldata |
Array of quantities of each liability. |
values |
uint256[] calldata |
Array of ETH-denominated values of each liability. |
Oracle management
Calls to updateAssets and updateLiabilities must be restricted to authorized addresses.
Calls from unauthorized addresses must revert.
Providing oracle management functions is optional. If they are provided, emitting an event when authorization changes is recommended.
event OracleUpdated(address indexed oracle, bool authorized);
function setOracle(address oracle, bool authorized) external;Implementing this pattern makes it possible to track the addition and removal of oracles on-chain. The protocol selects its own oracles and can integrate any price feed solution, including Chainlink, API3, or a custom oracle.
Additional considerations
Design philosophy
ERC7893 prioritizes reliability, efficiency, flexibility, and transparency.
Data structure design
The ProtocolAssets and ProtocolLiabilities structs manage token information using arrays rather than mappings.
There are three reasons for this array-based design.
First, monitoring systems can retrieve all data in a single call, making state retrieval more efficient.
Second, arrays suit historical tracking requirements because snapshots can be stored as they are.
Finally, arrays simplify batch updates in highly volatile market conditions.
Recording both the amount and the value of each token is intended to improve resilience to sudden market movements, detect oracle manipulation by comparing value-to-quantity ratios over time, and provide a clear audit trail for retrospective analysis.
Embedding the timestamp directly in each struct allows data updates to be performed atomically and prevents partially updated data from remaining during price fluctuations.
Mathematical model for solvency calculations
The core solvency ratio (SR) is calculated using the following formula.
Here, (Total Assets) is the sum of all asset values, and (Total Liabilities) is the sum of all liability values.
In this mathematical representation, 105 represents 105%.
Smart contract implementations use (totalAssets * 10000) / totalLiabilities, scaling the ratio by × 10000 to retain two decimal places of percentage precision using integer arithmetic. In this case, 10500 represents 105%. These are two representations of the same ratio at different scales.
These values are calculated as and , respectively.
is the quantity of asset i, is the quantity of liability i, and is the price of asset or liability i.
A risk-adjusted health factor (HF) is also defined for more advanced risk assessment.
is the risk weight of asset i (). For example, stablecoins can be assigned a weight close to 1.0, while highly volatile tokens can be assigned a lower weight such as 0.5. is the risk factor of liability i (), with higher values assigned to liabilities that are closer to maturity.
Risk thresholds
Based on testing, the following risk thresholds are recommended.
| Risk level | Solvency ratio | Required response |
|---|---|---|
| CRITICAL | Below 105% | Emergency pause |
| HIGH RISK | 105%–110% | Risk alert |
| WARNING | 110%–120% | Enhanced monitoring |
| HEALTHY | 120% or above | Normal operation |
The critical threshold is set at 105% because market crash simulations (an 80% drop in ETH prices and a 70% drop in BTC prices) indicated that recovery becomes difficult below this level. The 110% and 120% thresholds define the high-risk and warning levels, respectively, allowing early warnings to escalate in stages.
The following diagram shows how the risk thresholds relate to one another.

The following diagram shows the threshold levels in greater detail.

Liquidity coverage ratio and system health index
In addition to the core solvency ratio, the liquidity coverage ratio (LCR) and the system health index (SI) are defined.
The LCR is calculated as follows.
stands for High Quality Liquid Assets, and stands for Total Net Cash Outflows over 30 days. This metric indicates whether the protocol can withstand short-term liquidity stress.
The system health index (SI) evaluates overall health using a weighted average of multiple metrics.
are weighting coefficients, and is system volatility. It scores the protocol's overall health from three perspectives: solvency, liquidity, and stability.
Value at Risk and probability of default
The ERC7893 risk assessment framework also defines additional metrics, including Value at Risk (VaR) and the probability of default.
VaR is calculated as and estimates the maximum loss at a specified confidence level . is the expected return, is the standard deviation, and is the z-value corresponding to the confidence level.
The probability of default (PD) is calculated as . (Distance to Default) is calculated as , where T is the time horizon and is the standard normal distribution. This metric provides a quantitative estimate of the probability that the protocol will default on its obligations.
Oracle integration patterns
The standard deliberately leaves oracle implementation flexible. Protocols can integrate price feeds in several ways.
- Direct integration with existing oracle networks such as Chainlink and API3.
- Price aggregation from multiple oracle sources.
- Use of Uniswap V3's TWAP (Time-Weighted Average Price).
- Median-based price feeds.
The following diagram illustrates oracle integration patterns.

Implementation recommendations
Recommendations based on the test results include leaving liabilities unchanged during price updates and updating them only when actual positions change. Validating that liabilities are not zero also prevents division by zero.
Fixed-point arithmetic is recommended for solvency ratio calculations to obtain consistent results.
function calculateRatio(uint256 assets, uint256 liabilities) pure returns (uint256) {
if (liabilities == 0) {
return assets > 0 ? RATIO_DECIMALS * 2 : RATIO_DECIMALS;
}
return (assets * RATIO_DECIMALS) / liabilities;
}In this code, if liabilities are zero and assets are nonzero, the function returns a maximum solvency value (RATIO_DECIMALS * 2, or 200%). If assets are also zero, it returns 100%.
Otherwise, it calculates the ratio using (assets * 10000) / liabilities.
Recommended gas optimizations include efficient historical storage, batch updates for multiple tokens, and limits on array sizes during updates.
Reference implementation
The reference implementation includes comprehensive security features intended for production environments.
Security constants
uint256 private constant RATIO_DECIMALS = 10000;
uint256 private constant MIN_SOLVENCY_RATIO = 10500; // 105%
uint256 private constant CRITICAL_RATIO = 10200; // 102%
uint256 private constant WARNING_RATIO = 11000; // 110%
uint256 private constant MAX_PRICE_DEVIATION = 500; // 5%
uint256 private constant MAX_TOKENS_PER_UPDATE = 50;
uint256 private constant STALENESS_THRESHOLD = 3600; // 1 hour
uint256 private constant CIRCUIT_BREAKER_THRESHOLD = 2000; // 20%
uint256 private constant UPDATE_COOLDOWN = 5; // 5 blocks
uint256 private constant MAX_HISTORY_ENTRIES = 8760; // Approximately 1 year of data
uint256 private constant MIN_ENTRY_INTERVAL = 3600; // 1 hour
bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE");
bytes32 public constant EMERGENCY_ROLE = keccak256("EMERGENCY_ROLE");
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");Each constant serves a specific purpose.
RATIO_DECIMALS is the scaling factor used to preserve precision in solvency ratio calculations with integer arithmetic.
MIN_SOLVENCY_RATIO (10500 = 105%) defines the minimum solvency level, while CRITICAL_RATIO (10200 = 102%) defines a more severe liquidation threshold.
MAX_PRICE_DEVIATION (500 = 5%) is the permitted price deviation between oracles. Updates exceeding this limit are rejected because they may indicate manipulation.
MAX_TOKENS_PER_UPDATE (50) caps the number of tokens processed in a single update to prevent DoS attacks.
STALENESS_THRESHOLD (3600 seconds = 1 hour) defines the validity period of price data and prevents calculations based on outdated data.
CIRCUIT_BREAKER_THRESHOLD (2000 = 20%) is the circuit breaker threshold for automatically pausing the system if asset values move by 20% or more within one block.
UPDATE_COOLDOWN (5 blocks) restricts consecutive updates from the same oracle to prevent spam.
Access control
modifier onlyOracle() {
require(
assetOracles[msg.sender] || hasRole(ORACLE_ROLE, msg.sender),
"Not authorized oracle"
);
require(!emergencyPaused || block.timestamp > pauseEndTime,
"Emergency paused");
_;
}
modifier rateLimited() {
require(
block.number >= lastUpdateBlock[msg.sender] + UPDATE_COOLDOWN,
"Update too frequent"
);
lastUpdateBlock[msg.sender] = block.number;
emit RateLimitTriggered(msg.sender, block.number);
_;
}The onlyOracle modifier supports both legacy oracle management through the assetOracles mapping and newer role-based access control through hasRole.
Oracle updates are also blocked during an emergency pause but resume automatically once the pause period ends.
The rateLimited modifier prevents the same oracle from making consecutive updates within 5 blocks (approximately one minute), protecting against spam and gas exhaustion attacks.
Circuit breaker
function _checkCircuitBreaker(uint256 previousTotal, uint256 newTotal) internal {
if (previousTotal > 0) {
uint256 assetChange = newTotal > previousTotal
? ((newTotal - previousTotal) * 10000) / previousTotal
: ((previousTotal - newTotal) * 10000) / previousTotal;
if (assetChange > CIRCUIT_BREAKER_THRESHOLD) {
emergencyPaused = true;
pauseEndTime = block.timestamp + 3600;
emit CircuitBreakerTriggered("Large asset change",
assetChange, CIRCUIT_BREAKER_THRESHOLD);
emit EmergencyPaused(address(this), pauseEndTime);
}
}
}If the asset value changes by 20% or more compared with the previous update, the circuit breaker triggers and automatically pauses the system for one hour. This mechanism protects the protocol against oracle manipulation attacks and abnormal market movements. It draws on the circuit breaker criteria of the New York Stock Exchange (NYSE).
Multi-oracle consensus
function _validatePriceConsensus(address token, uint256 proposedPrice)
internal returns (bool) {
address[] memory activeOracles = _getActiveOracles();
if (activeOracles.length < 3) return true;
uint256[] memory prices = new uint256[](activeOracles.length);
uint256 validPrices = 0;
for (uint256 i = 0; i < activeOracles.length; i++) {
if (oraclePrices[activeOracles[i]][token] > 0) {
prices[validPrices] = oraclePrices[activeOracles[i]][token];
validPrices++;
}
}
if (validPrices < 2) return true;
uint256 median = _calculateMedian(prices, validPrices);
uint256 deviation = proposedPrice > median
? ((proposedPrice - median) * 10000) / median
: ((median - proposedPrice) * 10000) / median;
if (deviation > MAX_PRICE_DEVIATION) {
emit PriceDeviationAlert(token, deviation, activeOracles);
return false;
}
return true;
}When at least 3 oracles are active, the proposed price is compared with the median, and the update is rejected if the deviation is 5% or more. This protects against attacks in which a single oracle injects fraudulent price data. When fewer than 3 oracles are active or fewer than 2 valid prices are available, validation is skipped and the update is permitted.
Historical data management
function getSolvencyHistory(uint256 startTime, uint256 endTime)
external view returns (uint256[] memory, uint256[] memory,
ProtocolAssets[] memory, ProtocolLiabilities[] memory) {
uint256 count = 0;
for (uint256 i = 0; i < metricsHistory.length; i++) {
if (metricsHistory[i].timestamp >= startTime &&
metricsHistory[i].timestamp <= endTime) {
count++;
if (count >= 100) break;
}
}
uint256[] memory timestamps = new uint256[](count);
uint256[] memory ratios = new uint256[](count);
ProtocolAssets[] memory assets = new ProtocolAssets[](count);
ProtocolLiabilities[] memory liabilities = new ProtocolLiabilities[](count);
uint256 index = 0;
for (uint256 i = 0; i < metricsHistory.length && index < count; i++) {
if (metricsHistory[i].timestamp >= startTime &&
metricsHistory[i].timestamp <= endTime) {
timestamps[index] = metricsHistory[i].timestamp;
ratios[index] = metricsHistory[i].solvencyRatio;
assets[index] = metricsHistory[i].assets;
liabilities[index] = metricsHistory[i].liabilities;
index++;
}
}
return (timestamps, ratios, assets, liabilities);
}Historical data retrieval uses a two-pass approach. The first pass counts matching records so that arrays of the exact size can be allocated. The second pass populates those arrays with the data. To avoid exceeding gas limits, each query is capped at 100 entries. Up to 8760 entries are retained, equivalent to approximately one year of hourly records.
Emergency response system
function emergencyPause() external onlyEmergencyGuardian {
emergencyPaused = true;
pauseEndTime = block.timestamp + 4 * 3600;
emit EmergencyPaused(msg.sender, pauseEndTime);
}
function emergencyUnpause() external onlyEmergencyGuardian {
emergencyPaused = false;
pauseEndTime = 0;
emit EmergencyUnpaused(msg.sender);
}An emergency guardian can also pause the system manually.
emergencyPause pauses the system for four hours by default, and emergencyUnpause can lift the pause immediately.
Unlike the automatic circuit breaker pause (one hour), the longer four-hour pause reflects a human decision to intervene.
Liquidation system
The reference implementation also defines an optional liquidation system.
struct LiquidationConfig {
uint256 maxLiquidationRatio;
uint256 liquidationBonus;
uint256 minHealthFactor;
uint256 maxSlippage;
bool isActive;
}| Field | Description |
|---|---|
maxLiquidationRatio |
Maximum proportion of debt that can be liquidated in a single transaction. |
liquidationBonus |
Reward (bonus) paid to liquidators for executing a liquidation. |
minHealthFactor |
Minimum health factor at which liquidation is triggered. |
maxSlippage |
Maximum slippage permitted during liquidation. |
isActive |
Flag indicating whether the liquidation system is active. |
The liquidation system is separate from core solvency monitoring. Protocols can implement it as an extension when required.
Compatibility
ERC7893 is compatible with existing DeFi protocols and requires no changes to existing token standards. It is designed to integrate with ERC20 tokens, using addresses of ERC20-compliant tokens for assets and liabilities.
For more about ERC20, see the following article.
[ERC20] A Beginner's Guide to ERC20
Security
Oracle security
Price feed security is fundamental to solvency calculations. Relying on a single oracle exposes the entire protocol to risk if that oracle is compromised. Using at least 3 independent oracle sources and aggregating their prices by the median is recommended. Updates must be rejected when the price deviation between sources exceeds 5%, and price data that is one hour old or older must be treated as stale.
Aave V3's AaveOracle and Chainlink's Feed Registry provide examples of practical integration patterns.
When using a TWAP (Time-Weighted Average Price), a window of at least 30 minutes and a minimum of $1 million–$5 million in liquidity in the reference pool are recommended to resist manipulation.
Access control
A 3-of-5 multisig is recommended for parameter changes, and a 4-of-7 multisig for critical upgrades. Emergency pause authority should be separate from primary governance. A design based on Aave's Guardian model is one approach.
A cooldown of at least one hour between pause activations prevents abuse.
Risk management parameters
The following table lists security parameters that have been validated in production environments.
| Parameter | Value | Reference protocol |
|---|---|---|
| Critical ratio | 102% | Aave V3 WBTC liquidation threshold |
| Minimum solvency ratio | 105% | Compound V3 Close Factor trigger |
| Warning ratio | 110% | MakerDAO emergency shutdown threshold |
| Permitted price deviation | 5% | Chainlink deviation criteria |
| Staleness threshold | 1 hour | Chainlink ETH/USD heartbeat |
| Circuit breaker | 20% | NYSE criteria |
| Rate limit | 5 blocks | DoS prevention |
| Maximum number of tokens | 50 per update | Accounts for the 30M gas block limit |
Circuit breakers and emergency response
The automatic circuit breaker is triggered when asset values move by more than 20% or liquidity falls by 50% or more within one hour. The initial pause lasts 1–4 hours, with exponential backoff applied if the circuit breaker is triggered repeatedly. Recovery proceeds in stages, restoring capacity to 25%, 50%, 75%, and then 100%, with 30 minutes of monitoring at each stage.
Critical operations are subject to time delays. The recommended delays are 7 days (604,800 seconds) for protocol upgrades, 48 hours (172,800 seconds) for threshold parameter changes, and 24 hours (86,400 seconds) for oracle authorization changes. In emergencies, however, these delays can be overridden immediately.
DoS attack prevention
Recommendations include a maximum of 50 tokens per update, pagination with up to 100 entries per historical query, rejection of empty arrays and validation of matching array lengths, and reentrancy protection using OpenZeppelin's ReentrancyGuard.
Liquidation protection patterns
A staged approach to liquidation integration is recommended: a health factor of at least 120% is considered healthy, 110%–120% triggers a WARNING alert, 105%–110% triggers a HIGH RISK alert, and below 105% triggers CRITICAL (emergency pause and liquidation). Limiting the debt processed in a single liquidation to 50% and setting a maximum automated liquidation slippage tolerance of 3% minimize the market impact of liquidations.
References
Conclusion
This article covered how ERC7893 provides solvency proofs for DeFi protocols. I hope it helped clarify the mechanism.
If you have questions, feel free to reach out via Twitter DM.
I also publish on the following platforms.




