Small committee reviewing governance proposals in a modern WeWork conference room, floor-to-ceiling glass walls, someone presenting on a screen, casual professional atmosphere.
Protocols

Emergency Shutdown and Recovery Procedures

Outlines the theoretical and practiced steps for an orderly shutdown of a Compound deployment, including the final state of asset recovery for suppliers and borrowers. A critical reference for institutional risk teams modeling worst-case scenarios and for integrators who need to build recovery paths into their systems.
introduction
PROTOCOL RESILIENCE AND RECOVERY

Introduction

A technical framework for understanding the operational procedures, governance controls, and recovery paths activated during a Compound market shutdown.

Emergency shutdown and recovery procedures define the last-resort operational playbook for a Compound deployment, transitioning the protocol from an active lending state to a final settlement state where suppliers can reclaim their underlying assets. Unlike a simple pause, a shutdown is an irreversible process that permanently disables borrowing, liquidations, and most other market functions, leaving only the withdrawal path open. For Compound III (Comet) deployments, this is governed by an emergency shutdown mechanism that can be triggered by governance or, in some configurations, a designated security authority, immediately halting all operations and fixing a final exchange rate for asset recovery.

The operational impact of a shutdown is absolute: all open borrow positions become under-collateralized in operational terms, as the ability to manage or liquidate them is removed. The protocol's solvency at the moment of shutdown determines whether suppliers can be made whole. Recovery is a manual, off-chain coordinated process where suppliers prove their ownership of cTokens or Comet shares to withdraw a pro-rata portion of the underlying assets held in the contract. Integrators, exchanges, and custodians must have pre-built recovery paths in their systems to handle this state, as standard deposit and withdrawal functions will no longer operate as expected.

For institutional risk teams modeling worst-case scenarios, the shutdown procedure is a critical dependency. The trust assumptions shift entirely from smart contract logic to the governance and multi-sig actors who control the shutdown trigger and any subsequent recovery contract. Chainscore Labs can review and stress-test these procedures against a team's specific integration architecture, identifying gaps in event monitoring, recovery transaction construction, and user communication plans before a real emergency exposes them.

EMERGENCY SHUTDOWN AND RECOVERY PROCEDURES

Quick Facts

Operational reference for the theoretical shutdown and asset recovery process in Compound deployments, highlighting affected actors and verification needs for institutional risk teams.

AreaWhat changesWho is affectedAction

Shutdown Trigger

Protocol enters a terminal state via a governance proposal or a critical vulnerability that halts all market operations (mint, borrow, transfer).

Governance delegates, Pause Guardian, Protocol architects

Verify the exact on-chain conditions and governance process that can trigger a full shutdown for the specific deployment.

Asset Recovery Path

Suppliers and borrowers must interact directly with the final contract state to withdraw underlying collateral or repay debts; the standard UI/API may be non-functional.

Institutional suppliers, Borrowers, Custodians, Wallets

Build and test a direct contract-interaction recovery path for each supported asset to ensure asset retrieval without the frontend.

Oracle Finalization

A shutdown likely requires a final, trusted price to determine account solvency and unlock withdrawals, potentially bypassing the standard oracle.

Risk teams, Oracle providers, Liquidators

Model the impact of a stale or governance-set final price on large positions and prepare a manual solvency verification script.

Liquidation Halt

Normal liquidation bots become non-functional, freezing the protocol's solvency state at the moment of shutdown.

Liquidation bot operators, Risk managers

Prepare a post-shutdown solvency analysis tool to assess bad debt crystallization without relying on live liquidation events.

Governance Control

The final shutdown and recovery sequence is likely controlled by the same governance timelock and multi-sig as normal operations.

Security engineers, Governance delegates

Audit the governance control surface for the shutdown path to identify any single points of failure or trust assumptions in the recovery process.

Comet vs. cToken Behavior

The shutdown and recovery procedure differs architecturally between Compound III (Comet) and Compound II (cToken) markets.

Integrators, Protocol architects

Do not assume a single recovery playbook; map the distinct contract entry points and state variables for each market version you support.

Cross-Chain Complexity

For deployments on L2s or sidechains, a shutdown must account for the bridge's liveness and the cross-chain governance relay's state.

Bridge operators, Chain infrastructure teams

Stress-test the recovery procedure under a bridge downtime scenario to identify cross-chain dependencies that could block asset recovery.

Procedure Testing

The shutdown and recovery procedure is a theoretical path that has not been fully exercised in a live, chaotic mainnet incident.

All operators and integrators

Conduct a tabletop exercise and a testnet dry-run of the shutdown and recovery flow to identify gaps in operational readiness and tooling.

technical-context
PROTOCOL CIRCUIT BREAKER

Shutdown Mechanism and Architecture

The operational design and governance-controlled process for an orderly global shutdown of a Compound deployment, enabling final asset recovery for suppliers and borrowers.

Compound's emergency shutdown mechanism is a governance-gated, multi-step procedure designed to transition the protocol into a final, frozen state where all users can withdraw their net asset share. This is not an automated kill switch; it requires a successful governance proposal to execute, making it a deliberate last-resort action against a critical, irrecoverable threat such as a fatal smart contract vulnerability, a catastrophic oracle failure, or a governance attack that cannot be countered by the Pause Guardian.

The architecture relies on a specific EmergencyShutdown function within the Comet (Compound III) contract. Once executed by the governance timelock, this function performs several irreversible actions: it pauses all primary market operations (supply, borrow, transfer, withdraw), sets the protocol's reserve factor to zero, and crucially, clears all outstanding debt. This debt clearance is an accounting operation that uses the protocol's reserves to offset all borrower liabilities, effectively socializing the bad debt across all suppliers. The final on-chain state reflects a pro-rata distribution of the remaining protocol assets, allowing each supplier to withdraw their entitled share of the underlying collateral.

For institutional risk teams, this mechanism defines the ultimate recovery scenario. The key operational assumption is that the value of protocol reserves is sufficient to cover all outstanding debt at the moment of shutdown. If liabilities exceed reserves, the shortfall is directly borne by suppliers through a permanent loss of principal. Integrators and wallet providers must build support for this terminal state, enabling users to claim their final pro-rata share of assets through a dedicated withdraw or claim function long after the protocol has ceased normal operations. Chainscore can stress-test these shutdown procedures against specific risk scenarios, modeling the reserve sufficiency and validating that integrator recovery paths function correctly under the final contract state.

SHUTDOWN IMPACT ANALYSIS

Affected Actors and Systems

Lending Integrators

Integrators such as wallets, aggregators, and institutional dashboards must build recovery paths into their systems. The primary operational requirement is to monitor for the ActionPaused event with a pauseAction that globally halts key functions like transfer, mint, and borrow.

Upon shutdown activation, integrators should immediately disable deposit and borrow UI flows. The critical long-term task is to surface a user's pro-rata share of the underlying assets for withdrawal, which requires reading the final exchange rate from the cToken contract after all reserves are distributed. Teams must ensure their indexing logic can handle the final state where only redeem and liquidate (if applicable) remain functional. Chainscore can review your integration's shutdown handling module to ensure it correctly interprets the protocol's terminal state and provides accurate user position data.

implementation-impact
SHUTDOWN DEPENDENCY ANALYSIS

Integration Impact and Recovery Paths

An orderly shutdown of a Compound deployment triggers a cascade of effects across wallets, exchanges, aggregators, and liquidators. Each integration point must be mapped to a specific recovery path to ensure users can reclaim assets and systems can gracefully deprecate support.

01

cToken and Comet Interface Freeze

Upon shutdown activation, the Comptroller or Comet contract will disable supply, borrow, and transfer functions. Integrators must immediately halt all user-facing transaction construction for the affected market. Wallets and interfaces should surface a clear 'withdraw-only' mode, as the core redeem and withdraw functions remain operational to allow asset recovery. Chainscore can audit your UI and backend logic to ensure it correctly interprets the paused state and prevents failed transactions that would degrade user trust during a critical event.

02

Exchange and Custodian Withdrawal Procedures

Centralized exchanges and custodians holding cTokens or Comet collateral must execute withdrawal transactions to recover the underlying asset. This requires pre-signed governance actions or multi-sig coordination to call redeem or withdraw on behalf of omnibus accounts. The operational bottleneck is often internal signer availability, not on-chain congestion. Teams should stress-test this recovery path with a tabletop exercise. Chainscore can design and validate these procedures, ensuring transaction construction is correct and gas parameters are optimized for timely execution.

03

Liquidation Engine Shutdown

Liquidation bots must be immediately deactivated upon shutdown to prevent them from attempting to seize collateral that is no longer liquidatable. The protocol's pause state will revert liquidateBorrow calls, but bots that continue to spam the network waste gas and risk reputational damage. Operators should implement a circuit breaker that monitors the ActionPaused event for the liquidation function and gracefully shuts down the bot. Chainscore can review your bot's event monitoring and shutdown logic to ensure a clean, automated response.

04

DeFi Aggregator and Vault Unwinding

Yield aggregators and meta-vaults that have deposited into Compound markets must execute multi-step withdrawals to return assets to their users. This may involve unwinding complex share logic and handling potential slippage if the underlying market has become illiquid. Aggregator teams need a pre-defined emergency script that can be executed by a multisig or governance timelock. Chainscore can perform a code review of your unwinding logic and simulate the withdrawal flow against a forked mainnet state to identify edge cases before a real shutdown occurs.

05

Oracle Price Finalization Risk

The final withdrawal value for cToken holders is determined by the exchange rate at the time of redemption, which depends on the underlying oracle price. If the shutdown is triggered by an oracle failure or manipulation event, the final price snapshot may be inaccurate, leading to unfair asset distribution. Integrators should monitor the oracle's reported price against multiple independent sources and be prepared to challenge it through governance if a post-shutdown correction mechanism exists. Chainscore can help you build a cross-oracle validation dashboard for this scenario.

06

Post-Shutdown Communication Protocol

A pre-drafted, multi-channel communication plan is essential for an orderly shutdown. This should include templates for notifying users via Twitter, Discord, and in-app banners, as well as direct outreach to major integrators like exchanges and wallet providers. The message must clearly state which functions are paused, which remain active for withdrawals, and the expected timeline for asset recovery. Ambiguity during a crisis leads to panic and support overload. Chainscore can help you develop and tabletop-test this communication playbook as part of a comprehensive incident response plan.

OPERATIONAL READINESS ASSESSMENT

Risk Matrix for Shutdown Scenarios

Evaluates failure modes, affected actors, and required actions across different Compound shutdown scenarios to help risk teams and integrators build recovery paths.

ScenarioFailure ModeAffected ActorsSeverityMitigation / Action

Governance-ordered deprecation

Market enters orderly wind-down; collateral factor set to zero, borrows paused

Suppliers, borrowers, liquidators, front-end operators

Medium

Integrators must support withdrawal-only mode; monitor governance for deprecation proposals

Critical oracle failure

Price feed returns zero or stale value, enabling unfair liquidations or borrows

Borrowers, liquidators, risk managers

Critical

Verify oracle redundancy and circuit breaker logic; Chainscore can review oracle adapter resilience

Pause Guardian emergency action

Mint, borrow, or transfer functions paused unilaterally for specific markets

All market users, exchanges, custodians

High

Implement real-time monitoring for Pause Guardian events; prepare user communication templates

Cross-chain governance bridge exploit

Malicious proposal executed on a non-mainnet deployment via compromised bridge

Multi-chain users, governance delegates

Critical

Audit cross-chain timelock and bridge trust assumptions; validate proposal execution latency

Smart contract vulnerability

Exploit drains protocol reserves or user collateral; bad debt crystallizes

Suppliers, COMP holders, integrators

Critical

Pre-deploy incident response plan; Chainscore can perform pre-mortem stress tests on upgrade paths

Chain consensus failure or reorganization

Deep reorg invalidates finality, corrupting protocol state and positions

Node operators, all market participants

Critical

Define finality assumptions per deployment chain; build reconciliation procedures for state disputes

Liquidity cascade and bad debt spiral

Rapid asset depeg triggers mass liquidations exceeding market liquidity

Borrowers, liquidators, protocol solvency

High

Model liquidity depth for collateral assets; Chainscore can simulate cascade scenarios to test caps

Timelock bypass or admin key compromise

Unauthorized immediate upgrade changes core protocol logic

All users, integrators, governance participants

Critical

Verify timelock configuration and multi-sig threshold; monitor admin key activity continuously

POST-SHUTDOWN RECOVERY PROCEDURES

Operator Recovery Checklist

A step-by-step operational checklist for integrators, exchanges, and institutional users to recover assets and reconcile positions after a Compound deployment enters emergency shutdown. This checklist assumes the shutdown has been executed, the final price oracles have been set, and the withdrawal phase is active. Teams should validate each step against the specific deployment's governance-executed shutdown parameters.

What to check: Verify that the emergencyShutdown transaction has been executed on the Comptroller or Comet contract and that the protocol is in the withdrawal-only phase. Check for the ActionPaused or equivalent event confirming that mint, borrow, and transfer functions are globally paused.

Why it matters: Premature withdrawal attempts before the shutdown is final can lead to transaction failures or, worse, interacting with a contract in an unexpected intermediate state. The final oracle price must be set to determine the recovery value for each asset.

Confirmation signal: Query the pauseGuardian or isShutdown state variable on the target contract. Monitor the governance timelock and executor contracts for the final emergencyShutdown execution event. Cross-reference the transaction hash with the official governance proposal to ensure it was the intended action.

Chains We Build On

Looking to build on a specific blockchain?

We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.

EVM ecosystems

  • Ethereum logo
    Ethereum
  • Arbitrum logo
    Arbitrum
  • Optimism logo
    Optimism
  • Polygon logo
    Polygon
  • Avalanche logo
    Avalanche
  • Cronos logo
    Cronos

Non-EVM ecosystems

  • Solana logo
    Solana
  • Sui logo
    Sui
  • Aptos logo
    Aptos
  • Hedera logo
    Hedera
  • Stellar logo
    Stellar
  • NEAR logo
    NEAR

Additional ecosystems

  • Polkadot logo
    Polkadot
  • Cosmos logo
    Cosmos
  • TON logo
    TON
  • Cardano logo
    Cardano
  • Algorand logo
    Algorand
  • Tempo logo
    Tempo

Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.

EMERGENCY SHUTDOWN AND RECOVERY

Frequently Asked Questions

Practical answers for risk teams, integrators, and protocol operators modeling worst-case scenarios and building recovery paths for Compound deployments.

An orderly shutdown is a multi-step process designed to return assets to suppliers while minimizing bad debt. The theoretical sequence involves:

  1. Pause all market operations: The Pause Guardian or governance would invoke pauseAll() on the Comptroller or Comet contract to halt new supplies, borrows, transfers, and liquidations.
  2. Freeze the state: All positions become static. Interest accrual may be halted or continue depending on the implementation. The final state of each account's supply and borrow balance is captured.
  3. Activate recovery mode: A recovery contract or mechanism would be deployed to manage the orderly withdrawal of assets. This is not a standard feature of Compound and would require a custom governance proposal.
  4. Process withdrawals: Suppliers would be able to withdraw their pro-rata share of available liquidity. Borrowers with over-collateralized positions could repay their debt and reclaim their collateral.
  5. Handle residual bad debt: Any under-collateralized positions would result in a shortfall. The protocol's reserves would absorb losses first, followed by a pro-rata haircut on all suppliers if reserves are insufficient.

Why this matters: Institutional risk teams must model this sequence to understand their loss-given-default in a tail-risk event. The absence of a pre-deployed, audited recovery contract means the process relies on governance speed and technical execution during a crisis.

Trusted by Industry Leaders

Delivering blockchain solutions for 5+ years.

We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.

Selected Partners & Clients

ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
I've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.
L
Lee Erswell
CEO, Telos Foundation
how to get started

How to get started?

If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.

01

Exploration & Strategy

Define your product goals and choose the right blockchain architecture for your use case.

02

Architecture & Design

Design the smart contracts, tokenomics, and security parameters of your system.

03

Development & Integration

Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.

04

Security & Launch

Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.

Start a build

Need a blockchain engineering team?

Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.