Alterscope Launch app

Reading dependency and contagion risk across DeFi

DeFi protocols are not isolated. They share collateral, liquidity, and oracle feeds in ways that make a problem in one market a potential problem in several. Understanding how contagion travels requires mapping the dependency graph, not just reading individual protocol metrics.

A position in a lending market is not just exposed to the lending market. It is exposed to every protocol the lending market depends on, every asset that provides its collateral liquidity, and every oracle that feeds its prices. The dependency is not metaphorical. It is structural.

Reading that structure is the starting point for contagion risk analysis.

What a dependency graph is

A dependency graph maps the relationships between on-chain protocols, assets, and feeds. Each node is a protocol, asset, or oracle. Each edge is a dependency: a lending market depends on the oracle that prices its collateral, a vault depends on the DEX it uses for rebalancing, an LP position depends on the stability of both underlying assets.

The graph has two properties that matter for risk.

Depth. A shallow dependency is a direct relationship: market A uses oracle O. A deep dependency is transitive: market A uses vault V, vault V uses market B, market B uses oracle O. Market A’s exposure to oracle O exists but is not visible from market A’s documentation alone.

Width at critical nodes. Some nodes in the graph are dependencies for many other nodes. A widely used stablecoin, a dominant oracle provider, or a deeply integrated liquidity venue that stops functioning does not create one problem. It creates as many problems as it has dependents.

How contagion travels

Contagion is the mechanism by which a stress event at one node propagates to others. It travels through three main channels.

Collateral devaluation. When a collateral asset loses value quickly, every lending market that accepts it as collateral is exposed simultaneously. Forced liquidations across all those markets create sell pressure on the collateral, which depresses prices further, which creates more liquidation triggers. This is a feedback loop, not a one-time event.

The Terra/Luna collapse in May 2022 propagated through collateral channels. Markets accepting LUNA or UST as collateral or holding them as yield-bearing assets faced simultaneous liquidation pressure. Protocols that were not directly invested in LUNA were affected if their collateral assets or liquidity providers had LUNA exposure (Chainalysis 2022 DeFi Report).

Liquidity withdrawal. Under stress, liquidity providers exit. AMM pools become shallower. Lending market suppliers withdraw. Borrowers who need to exit face worse prices and slower execution precisely when conditions make exit most urgent. Protocols that rely on the same liquidity sources compound the withdrawal pressure.

Oracle path contamination. If multiple protocols share an oracle feed or use a common reference price from a single DEX pool, a manipulation attempt or a liquidity event at that pool affects all of them simultaneously. The contamination is invisible from any single protocol’s perspective.

Reading the graph

Three practical steps give you a working view of your dependency exposure.

Identify the collateral dependency chain. For each asset backing your market position, trace which other markets and vaults also hold or are exposed to that asset. The set of markets that share collateral with you defines your first-order contagion neighbourhood.

Map shared oracle dependencies. Identify which oracle feeds your market uses and which other markets use the same feeds. A feed failure or staleness event affects all of them. Some feeds are dependencies for dozens of markets simultaneously.

Trace liquidity venue dependencies. Identify where your market’s liquidations would route if triggered. If the exit liquidity is concentrated in one or two DEX pools, and those pools are also the liquidity source for several other markets’ liquidation paths, a large simultaneous liquidation would drain the pool before all markets can exit.

The concentration problem

Contagion risk is higher when the dependency graph has high-degree nodes: single points that many protocols depend on. When those nodes are stressed, the contagion is not linear. It is proportional to the number of dependents.

Evaluating concentration means asking not just what a protocol depends on, but how many other protocols depend on the same things. A market that looks structurally sound in isolation may be in a highly connected neighbourhood in the dependency graph, giving it elevated contagion exposure through no fault of its own design.

Lag and detection

Contagion events move faster than manual analysis. Cascade liquidations on Ethereum happen over blocks, not hours. By the time a stress event is visible in headline metrics, the critical phase is often already resolved or already past the point of orderly exit.

Continuous dependency mapping, combined with real-time monitoring of the metrics at critical nodes (oracle freshness, liquidity depth, large position distributions), gives earlier signal. The goal is not to predict specific events, it is to know in advance which nodes in your dependency graph require the closest watching.


FAQ

How large are typical DeFi dependency graphs? Large. A mid-tier lending market on Ethereum may have direct dependencies on 3 to 5 oracle feeds, 2 to 4 liquidity venues, and several collateral assets each with their own downstream dependencies. The full transitive closure of the graph for a single market position frequently exceeds 20 distinct nodes. Alterscope maps these dependencies across Ethereum and Stellar, spanning 20+ protocols and 11,000+ yield opportunities, so the connections behind any position are visible before you commit to it.

Are all dependency chains equally risky? No. The risk weight of a dependency depends on three factors: the probability of a stress event at that node, the protocol’s direct exposure if that node fails, and the speed at which the impact would propagate. Deep dependencies through low-volatility nodes with high liquidity are less concerning than shallow dependencies on high-volatility, concentrated nodes.

Can a protocol reduce its contagion exposure? Partially. Diversifying oracle sources, avoiding collateral assets with concentrated on-chain liquidity, and setting conservative liquidation parameters all reduce exposure. Complete isolation from the dependency graph is not achievable in a composable ecosystem. The realistic goal is understanding and bounding the exposure, not eliminating it.

How is contagion risk different from protocol-specific risk? Protocol-specific risk is the risk that a particular contract has a bug, is misconfigured, or is governed adversarially. Contagion risk is the risk that a protocol operates exactly as designed but is damaged by events in connected protocols. The two require different analysis methods and different monitoring approaches.