The exact contents of citations.db main_text.text for this paper — one flattened LaTeX string, title through conclusion, appendix excluded, unmodified except for removing email addresses. This is what our citation measures are computed over.
74,618 characters
DeXposure-FM: A Time-series, Graph Foundation Model for Credit Exposures and Stability on Decentralised Financial Networks
\begin{frontmatter}
\title{DeXposure-FM: A Time-series, Graph Foundation Model for Credit Exposures and Stability on Decentralised Financial Networks}
\author[label1]{Aijie Shu}
\author[label2]{Wenbin Wu}
\author[label4]{Gbenga Ibikunle}
\author[label3]{Fengxiang He}\ead{[email removed]}
\affiliation[label1]{organization={Independent Scholar},
city={Edinburgh},
country={United Kingdom}}
\affiliation[label2]{organization={Cambridge Centre for Alternative Finance, Judge Business School, University of Cambridge},
city={Cambridge},
country={United Kingdom}}
\affiliation[label4]{organization={Business School, University of Edinburgh},
city={Edinburgh},
country={United Kingdom}}
\affiliation[label3]{organization={School of Informatics, University of Edinburgh},
city={Edinburgh},
country={United Kingdom}}
\begin{abstract}
Credit exposure in Decentralized Finance (DeFi) is often implicit and token-mediated, creating a dense web of inter-protocol dependencies. Thus, a shock to one token may result in significant and uncontrolled contagion effects. As the DeFi ecosystem becomes increasingly linked with traditional financial infrastructure through instruments, such as stablecoins, the risk posed by this dynamic demands more powerful quantification tools. We introduce DeXposure-FM, as the first time-series, graph foundation model for measuring and forecasting inter-protocol credit exposure on DeFi networks. Employing a graph-tabular encoder, with pre-trained weight initialization, and multiple task-specific heads, DeXposure-FM is trained on the DeXposure dataset that has 43.7 million data entries, across 4,300+ protocols on 602 blockchains, covering 24,300+ unique tokens. The training is operationalized for credit-exposure forecasting, predicting the joint dynamics of (1) protocol-level flows, and (2) the topology and weights of credit-exposure links.
The DeXposure-FM is empirically validated on two machine learning benchmarks; it consistently outperforms the state-of-the-art approaches, including a graph foundation model and temporal graph neural networks. {DeXposure-FM further produces financial economics tools that support macroprudential monitoring and scenario-based DeFi stress testing, by enabling
protocol-level systemic-importance scores, sector-level spillover and concentration measures via a forecast-then-measure pipeline.} Empirical verification fully supports our financial economics tools. The model and code have been publicly available.
\noindent\textit{Model:} \url{https://huggingface.co/EVIEHub/DeXposure-FM}.
\noindent\textit{Code:} \url{https://github.com/EVIEHub/DeXposure-FM}.
\end{abstract}
\begin{highlights}
\item Financial economics foundation model: We build DeXposure-FM, the first time-series, graph foundation model for decentralized finance.
\item Empirical verification on machine learning benchmarks: DeXposure-FM significantly outperforms strong competitors in machine learning benchmarks of multi-step forecasts of edge-level exposures and network-level statistics, such as concentration, density, and sector-to-sector links.
\item {Financial economics tools:
DeXposure-FM produces tools that support macroprudential monitoring and scenario-based DeFi stress testing, by enabling
protocol-level systemic-importance scores, sector-level spillover, and concentration measures via a forecast-then-measure pipeline.}
\item Open-source efforts and reproducibility: Both model and code have been publicly available. We will continue our open-source efforts in future developments.
\end{highlights}
\begin{keyword}
Time-Series Analysis \sep Graph Tabular Model \sep Foundation Model \sep Credit Exposures \sep Financial Stability \sep Decentralized Finance \sep Financial Networks
\end{keyword}
\end{frontmatter}
\section{Introduction}
Decentralized finance (DeFi) has emerged as an important and fast-evolving financial ecosystem, offering lending, trading, derivatives, and payment-like services via smart contracts deployed across multiple blockchains \cite{Schar2021DeFi,gogol2024sokdecentralizedfinancedefi}. A defining feature of DeFi is composability: protocols routinely hold, lock, or accept tokens issued by other protocols as collateral, liquidity, or reserves. As a result, credit exposure is often implicit and token-mediated rather than expressed as bilateral contracts, creating a dynamic network of inter-protocol dependencies \cite{wu2025dexposuredatasetbenchmarksinterprotocol,BERTOMEU2024105321}. When a token that is widely used as collateral or liquidity experiences a shock, through a price collapse, governance failure, exploit, or liquidation event, losses can propagate to protocols that rely on that token, potentially generating amplification and contagion across chains \cite{gogol2024sokdecentralizedfinancedefi,aufiero2025mappingmicroscopicsystemicrisks}.
Policy authorities have highlighted the vulnerabilities of DeFi networks
and underscored persistent gaps in quantitative tools that limit effective monitoring for the DeFi ecosystem {\cite{BIS2025TVL}}. This measurement gap is increasingly salient as links between crypto markets and the broader financial system deepen \cite{ESRB2025}.
Despite the importance, empirical work has been constrained by limited data and tools.
DeFi exposures are not reported in standardized balance sheets; they must be reconstructed from on-chain states and transactions. Even when exposures can be estimated, they are (1) \emph{high-dimensional}: there are millions of potential directed links, (2) \emph{nonstationary}, in terms of protocol upgrades, new assets, changing incentives, and (3) \emph{strongly heteroskedastic}: regime shifts are frequent between calm and crisis. Classical time-series tools such as vector autoregression (VAR) \citep{Sims1980} and low-rank factor methods \citep{StockWatson2002} provide strong baselines, but they suffer from restricted capacity to represent data features, and struggle to represent the coupled evolution of \emph{node-level states} (e.g., total locked value in a protocol), \emph{edge-level exposures} (e.g., who is economically linked to whom, and with what weight), and \emph{meso-structure} (e.g., sectoral organization and its rewiring under stress). Meanwhile, modern graph neural networks (GNNs) \citep{KipfWelling2017,veličković2018graphattentionnetworks} and temporal graph models for dynamic interaction data \citep{rossi2020temporalgraphnetworksdeep} have shown impressive performance in wide areas
; yet they are typically trained for a narrow task on a limited dataset, rather than serving as reusable infrastructure across multiple tasks.
To address this gap, we train {DeXposure-FM}, the first time-series, graph foundation model for measuring and forecasting inter-protocol credit exposures in global decentralized financial networks, to the best of our knowledge. The model is trained on more than 43.7 million weekly inter-protocol exposure data entries from 2020-2025, stored in the {DeXposure} dataset, which constructs credit exposures across over 4,300 protocols on 602 blockchains and covers 24,300+ unique tokens \cite{wu2025dexposuredatasetbenchmarksinterprotocol}. DeXposure constructs inter-protocol exposures by linking protocol-level balance-sheet proxies (e.g., total value locked, TVL \cite{BIS2025TVL}) to token- and sector-level structure, enabling a unified view of volumes, topology, and compositional risk. The dataset captures an evolving, weighted, directed multigraph whose nodes are protocols and whose edges represent economically meaningful exposure links inferred from token composition and valuation dynamics. DeXposure-FM follows the foundation-model paradigm: it pretrains a general representation on large-scale data and reuses it across diverse downstream tasks, a strategy that has proven effective in wide areas \cite{BommasaniEtAl2021FoundationModels}.
DeXposure-FM employs a large-size graph-tabular encoder (GraphPFN {\cite{eremeev2025turningtabularfoundationmodels} in this paper) to extract representations from input data, followed by multiple heads
to forecast (1) edge existence and edge weights on the graph, and (2) node-level TVL changes at multiple horizons. In optimization, the encoder is initialized by open-source pre-trained weights, while the heads are initialized randomly. Time-based walk-forward splits {\cite{BergmeirBenitez2012CVTS}}, early stopping {\cite{Prechelt1998EarlyStopping}}, and gradient clipping {\cite{PascanuEtAl2013RNNTraining}} are employed to improve robustness under non-stationary environments.
In training,
DeXposure-FM is optimized by Adam {\cite{KingmaBa2015Adam}} for the joint tasks of (1) edge existence classification, (2) edge weight regression, and (3) node-level TVL-change prediction. These outputs map naturally to policy-relevant statistics: concentration, density, sector connectivity, and directional spillovers. In crises, the relevant question is not only ``what is the expected TVL tomorrow?'', but ``which parts of the network amplify shocks, and along which pathways does distress travel?'' as well.
We evaluate DeXposure-FM on two machine learning benchmarks, tailored for economic measurement and risk analytics: (1) multi-step forecasting of edge-level exposures and network-level statistics (e.g., concentration, density, and sector connectivity), and (2) predictive stress testing, where we forecast a future exposure network and compare simulated system losses on predicted versus realized graphs under fixed counterfactual shock definitions. Across tasks, we benchmark against strong competitors, including GraphPFN, ROLAND {\cite{YouEtAl2022ROLAND}} (a temporal graph neural network), and {a persistence baseline that directly uses the current values as prediction}.
DeXposure-FM provides a range of financial economics tools for macroprudential monitoring in decentralized financial infrastructure. We use the trained model to construct dynamic measures of protocol-level systemic importance, sector level spillover, and early-warning indicators based on shifts in network concentration and dependence on fragile collateral. These model-based measurements support DeFi-specific stress testing under counterfactual shocks.
These tools are all validated in experiments.
As the first time-series, graph foundation model for measuring and forecasting inter-protocol credit exposure on DeFi networks, DeXposure-FM advances the measurement toolkit needed to understand systemic risk in DeFi and its interaction with the wider financial system.
DeXposure-FM will be continuously updated and extended along five directions: (1) enlarging the training data pool; (2) improving exposure measurement by moving beyond raw TVL; (3) addressing the continuous model drift through periodic retraining on new data, drift monitoring by sector/chain, and versioned releases tied to specific data vintages; (4) innovating the architecture; and (5) fostering an open-source community by maintaining public code and model weights, running competitions, etc.
\section{Related Works}
This section reviews the literature in relevant areas.
\subsection{Credit Risk Modeling in Financial Markets}
In traditional finance, credit risk modeling spans both individual-default models and systemic network approaches. Classical structural models and reduced-form models quantify default probabilities of single entities, while network contagion models examine how defaults propagate through financial institutions. For example, Dolfin et al. apply network epidemic models to credit contagion, highlighting how interconnected portfolios can amplify systemic credit risk \cite{math7080713}.
In decentralized finance, credit risk manifests differently, as loans are typically over-collateralized and mediated by smart contracts. Bertomeu et al. propose simple aggregate risk measures for DeFi lending protocols, using only total deposits and borrowings, and report that systemic fragility surged around mid-2021 during crypto market turmoil \cite{BERTOMEU2024105321}. Conceptual studies have begun to map TradFi and DeFi risks together: Aufiero et al. review systemic risk mechanisms, finding that while basic risk types (leverage, liquidity shocks, correlated exposures) are common to both systems, DeFi's algorithmic execution and composability lead to unique propagation channels \cite{aufiero2025mappingmicroscopicsystemicrisks}.
\subsection{Machine Learning for Systemic Risk, Contagion, and Network Analysis}
Machine learning techniques are increasingly applied to systemic risk detection and contagion modeling {\cite{BALMASEDA2023200240, gonon2025computingsystemicriskmeasures}}. Graph neural networks (GNNs) in particular leverage network structure to improve risk prediction {\cite{KipfWelling2017, veličković2018graphattentionnetworks}}. Balmaseda et al. show that a GNN-based model dramatically outperforms traditional ML for classifying systemic importance of banks in simulated networks \cite{BALMASEDA2023200240}. Gonon et al. integrate GNNs with explicit interbank liability networks, computing systemic risk measures as the minimum capital needed to secure the system \cite{gonon2025computingsystemicriskmeasures}. Their framework effectively learns contagion channels (e.g., Eisenberg-Noe clearing) by incorporating graph-structured data into the risk aggregation function.
\subsection{Foundation Models in Finance and Economics}
Foundation models are increasingly penetrating into financial and economic domains by shifting the workflow from task-specific tools toward reusable representations learned from broad data. Instead of fitting a separate model for each target, recent approaches pretrain large neural networks, mostly using an architecture of transformer {\cite{VaswaniEtAl2017Attention}} and its variants, on massive data; and then transfer the pre-trained model across domains and tasks via prompting or light adaptation \citep{AnsariEtAl2024Chronos,RasulEtAl2023LagLlama,DasEtAl2024TimesFM}. In parallel, an emerging policy-facing literature uses large language models to extract quantitative signals from narrative text (e.g., reports, releases, and news) and incorporate them into nowcasting pipelines, suggesting that relatively small but information-dense text sources can improve real-time prediction when combined with standard indicators \citep{deBondtSun2025ChatGPTNowcast,KwonEtAl2024BISLLMprimer,CarrieroEtAl2024MacroLLM}.
These models are also adapted to graph inputs, which augment self-attention with graph structural encodings, demonstrating the feasibility of large pretrained models on networks that resemble webs of financial contracts or cross-asset relationships; a good example is Graphormer \citep{Ying2021Graphormer}. For tabular data, the Graph Prior-data Fitted Network (GraphPFN) \citep{eremeev2025turningtabularfoundationmodels} is pretrained on millions of synthetic tabular tasks and reports strong out-of-the-box performance on diverse benchmarks.
\section{Formalizing Credit-Exposures on Decentralized Financial Networks}
This section formally defines terminologies and notations.
\subsection{Credit Exposure in DeFi Networks}
Let $X_G(q)$ denote the set of all tokens issued or generated by protocol $q$, and let $X_p(t)$ denote the set of tokens held (or locked) by protocol $p$ at time $t$. We call that protocol $p$ has {credit exposure} to protocol $q$ at time~$t$ if the tokens it holds include at least one that was issued by $q$:
\begin{equation}
X_p(t)\cap X_G(q)\neq \varnothing.
\label{eq:credit-exposure-definition}
\end{equation}
In other words, $p$ holds a liability of $q$; if the tokens issued by $q$ lose value or become illiquid, then $p$ faces a corresponding loss. This token‑mediated dependence generalizes the notion of counterparty credit risk in traditional finance to decentralized platforms, where exposures arise not from explicit bilateral contracts but from the possession of tokenized claims. The dynamics of these relationships can be measured by reconstructed total value locked (TVL) time series for each protocol and tracking how the composition of tokens held by each protocol evolves over time \cite{wu2025dexposuredatasetbenchmarksinterprotocol}.
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[node distance=2.5cm, auto, scale=0.85, transform shape]
\tikzstyle{entity} = [rectangle, draw, fill=Apricot, minimum width=2.2cm, minimum height=0.9cm, font=\small]
\tikzstyle{balance} = [rectangle, draw, fill=SpringGreen, minimum width=3.2cm, minimum height=2.4cm, font=\footnotesize]
\tikzstyle{exposure} = [->, thick, dashed, red!70!black]
\node[entity] (user) at (0,3) {User};
\node[entity] (lido) at (-5,0) {Lido};
\node[entity] (wrapper) at (0,0) {wstETH Wrapper};
\node[entity] (pendle) at (5,0) {Pendle};
\node[balance] (balanceLido) at (-5,-2.8) {
\begin{tabular}{lr}
\textbf{Lido} & \\
\underline{Assets} & \\
Staked ETH & \$100 \\
\underline{Liabilities} & \\
stETH & \$100
\end{tabular}
};
\node[balance] (balanceWrapper) at (0,-2.8) {
\begin{tabular}{lr}
\textbf{wstETH Wrapper} & \\
\underline{Assets} & \\
stETH & \$100 \\
\underline{Liabilities} & \\
wstETH & \$100
\end{tabular}
};
\node[balance] (balancePendle) at (5,-2.8) {
\begin{tabular}{lr}
\textbf{Pendle} & \\
\underline{Assets} & \\
wstETH & \$100 \\
\underline{Liabilities} & \\
PT-wstETH & \$95 \\
YT-wstETH & \$5
\end{tabular}
};
\draw[->, thick] (user) -- node[left, font=\footnotesize] {ETH} (lido);
\draw[->, thick] (lido) -- node[above, font=\footnotesize] {stETH} (wrapper);
\draw[->, thick] (wrapper) -- node[above, font=\footnotesize] {wstETH} (pendle);
\draw[->, thick] (pendle) to[bend left=20] node[right, font=\footnotesize] {PT + YT} (user);
\draw[exposure] (pendle.south west) to[bend right=15] node[below, font=\footnotesize, text=red!70!black] {exposure} (wrapper.south east);
\draw[exposure] (wrapper.south west) to[bend right=15] node[below, font=\footnotesize, text=red!70!black] {exposure} (lido.south east);
\end{tikzpicture}
\caption{Multi-layer credit exposure in DeFi. A user stakes ETH with Lido, receiving stETH, which is wrapped into wstETH and deposited into Pendle. Each protocol holds the liability of the preceding one, creating a chain of credit exposures from Pendle to Lido.}
\label{fig:exposure_example}
\end{figure}
Figure~\ref{fig:exposure_example} illustrates how a single-user transaction creates a multi-layer chain of credit exposures in DeFi. A user deposits ETH into Lido, a liquid staking protocol, and receives stETH, a rebasing token that accrues staking rewards. The stETH is then wrapped into wstETH, a non-rebasing representation that is more compatible with DeFi protocols. Finally, wstETH is deposited into Pendle, a yield-tokenization protocol that splits the asset into a principal token PT-wstETH and a yield token YT-wstETH, allowing users to trade fixed and variable yield separately.
In balance-sheet terms, Lido holds staked ETH with validators and issues stETH as liabilities, the wstETH wrapper holds stETH and issues wstETH, and Pendle holds wstETH and issues the PT and YT pair. Because each protocol's assets consist of tokens issued by the preceding protocol, a chain of credit exposures emerges: Pendle has exposure to the wstETH wrapper, which in turn has exposure to Lido. If Lido experienced a slashing event or stETH de-pegged from ETH, the losses would cascade through wstETH and into Pendle, affecting PT and YT holders. This example demonstrates that DeFi exposures are inherently multi-layered, as liquid staking, wrapping, and yield tokenization compound into complex dependency structures that the DeXposure dataset aims to capture.
\subsection{Mapping Tokens to Issuing Protocols}
To operationalize eq. \eqref{eq:credit-exposure-definition}, we must determine which protocol issues each token and thus identify the direction of exposure. Let $\mathcal{P}$ denote the set of all protocols and $\mathcal{C}$ the set of blockchains. For each token $\sigma$ appearing in protocol $p$, a {mapping function} $M(\sigma)$ returns the protocol $q$ that issues or manages $\sigma$. We can construct $M$ using a fallback procedure:
\begin{enumerate}
\item \emph{Metadata lookup:} Tokens are directly matched to issuing protocols using metadata from DefiLlama \citep{DefiLlama2026} when available.
\item \emph{Manual mapping:} For tokens with high TVL that lack metadata links, researchers manually assign the issuing protocol based on documentation and expert knowledge.
\item \emph{Text‑vector similarity:} For remaining tokens, the text descriptions of tokens and protocols are vectorized via the term frequency–inverse document frequency (TF-IDF) representation \cite{Qaiser2018}. Cosine similarity scores between token and protocol vectors determine the best match, and tokens are mapped to the protocol with the highest similarity score exceeding a threshold $\theta$.
\item \emph{Primary market tokens:} If none of the above methods yields a mapping, the token is treated as its own protocol (e.g., WETH).
\end{enumerate}
This mapping ensures that token flows between protocols can be attributed to changes in credit exposure with respect to the correct issuing protocol, even when tokens are bridged across chains or wrapped by multiple platforms. This procedure was implemented to curate the DeXposure dataset.
\subsection{Network Representation and Value Flows}
Credit exposures over a discrete time interval $\tau = t_2 - t_1$ are represented by a weighted directed graph $G_\tau = (P_\tau, E_\tau)$, where $P_\tau$ is the set of active protocols and $E_\tau$ is the set of directed edges. Each vertex $p\in P_\tau$ is assigned a {node weight} equal to the value of assets it holds at the end of the interval:
\begin{equation}
w_\tau(p) = \sum_{\sigma\in X_p(t_1)\cap X_p(t_2)} v_{t_2,\sigma},
\label{eq:node-weight}
\end{equation}
where $v_{t_2,\sigma}$ is the USD value of token $\sigma$ at time $t_2$. Nodes with negligible weight (below a threshold $\theta$) can be pruned for clarity. To define the {edge weight} from protocol $p$ to protocol $q$, we first compute the value flow for each token $\sigma$:
\begin{equation}
F^{\sigma}_{p q,\tau} =
\begin{cases}
\max\bigl(0,\, -\Delta S^{\sigma}_{p,\tau}\bigr), & \text{if } \Delta S^{\sigma}_{p,\tau} < 0,\\
\max\bigl(0,\,\Delta S^{\sigma}_{q,\tau}\bigr), & \text{if } \Delta S^{\sigma}_{q,\tau} \ge 0,
\end{cases}
\label{eq:value-flow}
\end{equation}
where $\Delta S^{\sigma}_{p,\tau}=v_{p,t_2}^{\sigma}-v_{p,t_1}^{\sigma}$ is the change in the USD value of token $\sigma$ held by protocol $p$ over the interval. Eq.~\eqref{eq:value-flow} reflects the intuition that if $p$ decreases its holdings of $\sigma$ and $q$ increases theirs, then $\sigma$ has flowed from $p$ to $q$; negative flows are reversed so that all flows are non‑negative. The {edge weight} $w_\tau(e_{p q})$ is the sum of flows for all tokens that map to the issuing protocol $q$:
\begin{equation}
w_\tau(e_{p q}) = \sum_{\sigma \in X_{p q, \tau}} F^{\sigma}_{p q,\tau},
\label{eq:edge-weight}
\end{equation}
where $X_{p q,\tau}$ denotes the set of tokens with issuing protocol $q$ that move from $p$ to $q$ over $\tau$. A positive edge weight indicates increasing exposure from $p$ to $q$. For single‑token protocols, the flow of that token equals the edge weight.
In summary, one aggregates token holdings at the start and end of the interval, computes node weights, discards nodes below a threshold, and then computes edge weights by summing positive flows; negative flows are reversed to ensure all weights are non‑negative. The resulting time‑indexed sequence of graphs captures the evolving structure of credit dependencies in the DeFi ecosystem. The curation of the DeXposure dataset follows this setting.
\begin{comment}
\subsection{Discussion and links to systemic‑risk theory}
The above formalism bridges decentralized finance with established theories of financial networks. Modeling credit exposures as weighted directed graphs derived from token flows enables the application of systemic‑risk measures, such as centrality metrics, contagion indices, and stress tests, developed for interbank networks to DeFi.
In the DeFi context, our graph formalization reveals trade-offs: diversifying collateral across multiple protocols may reduce reliance on any single issuer, yet highly interconnected protocols could become conduits for contagion if a stablecoin or wrapped token suffers a de‑peg or exploit.
This mathematical framework provides the foundation for the downstream tasks tackled by DeXposure‑FM. Forecasting future node and edge weights, stress‑testing scenarios under shocks to token values, and imputing missing TVL data all rely on accurate representations of credit exposure. Moreover, the network perspective aligns with macroprudential policy goals: regulators can monitor systemic importance and spillover risks by examining the temporal evolution of $G_\tau$, and researchers can evaluate how proposed protocol designs or regulatory interventions would reshape the exposure network. As decentralised finance continues to grow and integrate with the broader financial system, rigorous formalisation and measurement of credit exposure will be essential for safeguarding stability and fostering responsible innovation.
\end{comment}
\section{DeXposure-FM: Architecture and Optimization}
This section introduces the DeXposure-FM, including its architecture and the training process.
\subsection{Model Architecture}\label{subsec:model-arch}
DeXposure-FM is a time-series graph foundation model designed to forecast the evolution of inter-protocol credit exposures. The architecture
employs a graph-tabular encoder (GraphPFN in this case) to produce protocol embeddings from the input weekly snapshots, followed by task heads that process embeddings for tasks of (1) edge existence classification, (2) edge weight regression, and (3) node-level TVL changes prediction. Network-level statistics are then obtained by applying deterministic functionals to the predicted graph.
\subsubsection{Input and Features}
Let $t\in\mathcal{T}$ be discrete observation times and $\tau=(t_1,t_2)$ be a weekly interval. For each $\tau$, we construct a weighted directed exposure graph
\begin{equation}
G_\tau=(\mathcal{P}_\tau,\mathcal{E}_\tau),
\end{equation}
where nodes $p\in\mathcal{P}_\tau$ are protocols and edges $(p,q)\in\mathcal{E}_\tau$ represent token-mediated exposure from $p$ to issuing protocol $q$. Node weights encode protocol size (TVL) and edge weights encode the weekly change in exposure induced by token flows and valuation updates. Each node $p$ additionally has a tabular descriptor vector $ x^{\text{tab}}_{p,\tau}$ including log-scaled TVL and token-composition summaries (e.g., number of token types held, concentration measures, entropy) and a sector/category one-hot encoding.
\subsubsection{Pretrained Graph-Tabular Encoder}
We adopt {GraphPFN} as the encoder $E(\cdot)$ in our model, which is a transformer-based graph-tabular foundation model that fuses graph structure with tabular node features via multi-head self-attention augmented with structural information \citep{eremeev2025turningtabularfoundationmodels}. Given $(G_\tau,\{ x^{\text{tab}}_{p,\tau}\}_{p\in\mathcal{P}_\tau})$, the encoder produces
$d$-dimensional node representations
\begin{equation}
\{h_{p,\tau}\}_{p\in\mathcal{P}_\tau}
= E_{\text{GraphPFN}}\!\left(G_\tau,\{ x^{\text{tab}}_{p,\tau}\}_{p\in\mathcal{P}_\tau}\right),
\qquad h_{p,\tau}\in\mathbb{R}^d .
\end{equation}
\subsubsection{Edge-Level Prediction Head}
For each forecast horizon $h\in\{1, 4, 8, 12\}$ weeks, DeXposure-FM predicts both edge existence and edge weight (i.e., exposure change) for ordered protocol pairs $(p,q)$. We form a pairwise feature vector using a standard symmetric composition of embeddings:
\begin{equation}
f_{pq,\tau}=\Big[ h_{p,\tau};\, h_{q,\tau};\, h_{p,\tau}\odot h_{q,\tau};\,\lvert h_{p,\tau}- h_{q,\tau}\rvert\Big],
\end{equation}
and pass it through a multi-layer perceptron (MLP) head to obtain
\begin{equation}
(\widehat{y}^{\mathrm{exist}}_{pq}, \widehat{r}_{pq,\tau,h}) = \mathrm{MLP}_{\mathrm{link}}({f}_{pq,\tau}),
\end{equation}
where $\widehat{y}^{\mathrm{exist}}_{pq}\in(0,1)$ is the predicted probability of edge existence and $\widehat{r}_{pq,\tau,h}\in\mathbb{R}$ is a residual term. In our implementation, we adopt residual learning for edge weights: let $\tilde{w}_{\tau}(e_{pq})=\log(1+w_{\tau}(e_{pq}))$; then, we reconstruct the predicted log-weight as
\begin{equation}
\widehat{\tilde{w}}_{\tau+h}(e_{pq})=\tilde{w}_{\tau}(e_{pq})+\widehat{r}_{pq,\tau,h},
\end{equation}
with $\tilde{w}_{\tau}(e_{pq})=0$ when the edge is absent at time $\tau$.
\subsubsection{Node-Level Prediction Head and Network Statistics}
To capture protocol-level dynamics, we predict the log-change in protocol TVL using a node head:
\begin{align*}
\widehat{\Delta}_{p,\tau+h} = &\mathrm{MLP}_{\mathrm{node}}\!\Big([h_{p,\tau};\,h^{\mathrm{in}}_{p,\tau};\,h^{\mathrm{out}}_{p,\tau}]\Big),\\
\widehat{\Delta}_{p,\tau+h} =& \log(1+w_{\tau+h}(p)) - \log(1+w_{\tau}(p)),
\end{align*}
for any protocol $p\in\mathcal{P}_{\tau}\cap\mathcal{P}_{\tau+h}$, where $h^{\mathrm{in}}_{p,\tau}$ and $h^{\mathrm{out}}_{p,\tau}$ denote simple weighted aggregations of incoming/outgoing neighbor embeddings at time $\tau$ (using the current-week edge weights), which inject local flow context into the TVL-change prediction.
Network-level statistics (e.g., density, concentration measures, and sector connectivity) are computed as deterministic functionals of the predicted graph $\widehat{G}_{\tau+h}$, enabling evaluation of the model both at the edge level and at the level of aggregate stability indicators.
\subsection{Training Pipeline}\label{subsec:training-pipeline}
This section describes how we construct supervised training pairs from weekly DeXposure snapshots, define the multi-task learning objective, and optimize DeXposure-FM.
\subsubsection{Data Preparation}\label{subsubsec:data-prep}
DeXposure provides weekly snapshots of the inter-protocol exposure network. For each discrete time index $\tau$, we construct a weighted directed graph
$G_{\tau}=(\mathcal{P}_{\tau},\mathcal{E}_{\tau})$ with node weights $w_{\tau}(p)$ (protocol TVL) and edge weights $w_{\tau}(e_{pq})$ (exposure from $p$ to $q$).
Training examples are formed by an \emph{anchor} snapshot and a forecast horizon:
\begin{equation}
G_{\tau} \;\longrightarrow\; G_{\tau+h},
\qquad
h\in\{1,4,8,12\},
\label{eq:train-pairs}
\end{equation}
so that the model predicts the future graph state at horizon $h$ conditional on the current snapshot.
For each protocol $p\in\mathcal{P}_{\tau}$ we provide tabular node features $x^{\text{tab}}_{p,\tau}$ (including log-scaled TVL, token counts, concentration measures, and sector/category indicators) together with the graph structure $G_{\tau}$.
Table~\ref{tab:data-stats} summarizes the dataset characteristics. The network exhibits high edge persistence (mean overlap ratio 98.5\%), reflecting the stable nature of DeFi protocol interconnections.
\begin{table}[t]
\centering
\caption{DeXposure dataset statistics.}
\label{tab:data-stats}
\small
\begin{tabular}{lr}
\hline
\textbf{Statistic} & \textbf{Value} \\
\hline
Total snapshots & 283 weeks \\
Time range & 2020-03-23 $\sim$ 2025-08-18 \\
Mean nodes per week & 5,676 \\
Mean edges per week & 30,424 \\
Mean edge overlap ratio & 98.5\% \\
Protocol categories & $\sim$ 15 classes \\
\hline
\end{tabular}
\end{table}
\textbf{Time-based expanding window splits.}
We adopt an expanding-window walk-forward evaluation protocol to prevent look-ahead bias: all validation and test targets occur strictly after the corresponding training window, and the training window expands over time while validation and test windows remain fixed.
\textbf{Negative sampling.}
Edge existence is highly imbalanced. For each horizon $h$, we construct a labeled edge set $\mathcal{S}_{\tau+h}$ consisting of all positive edges in $\mathcal{E}_{\tau+h}$ plus uniformly sampled negative edges from the complement, using a negative-to-positive ratio of $5{:}1$.
This sampled set is used for the edge existence loss, while the edge weight loss is computed only on positive edges.
\subsubsection{Loss Functions}\label{subsubsec:loss}
DeXposure-FM is trained with a multi-task objective combining (1) edge existence classification, (2) edge weight regression, and (3) node-level TVL-change prediction.
\textbf{Edge existence (link prediction).}
For each candidate pair $(p,q)\in\mathcal{S}_{\tau+h}$ we predict $\widehat{y}^{\text{exist}}_{pq}\in(0,1)$ and minimize a weighted binary cross-entropy loss:
\begin{equation}
\mathcal{L}_{\text{exist}}
=
\sum_{(p,q)\in\mathcal{S}_{\tau+h}}
\mathrm{BCE}\!\left(\widehat{y}^{\text{exist}}_{pq},\,y^{\text{exist}}_{pq};\,w_{\text{pos}}\right),
\label{eq:loss-exist}
\end{equation}
where $w_{\text{pos}}$ upweights positives to match the negative sampling ratio. Here, binary cross-entropy is defined as below.
\begin{definition}[binary cross-entropy (BCE)]
For a binary label $y\in\{0,1\}$ and a predicted probability $\hat{y}\in(0,1)$, the binary cross-entropy loss is
\begin{equation}
\mathrm{BCE}(\hat{y},y)
= -\Big(y\log(\hat{y}) + (1-y)\log\big(1-\hat{y}\big)\Big).
\label{eq:bce}
\end{equation}
Equivalently, if $\hat{y}=\sigma(z)$ is produced from a logit $z\in\mathbb{R}$ via the sigmoid $\sigma(z)=1/(1+e^{-z})$, then
\begin{equation}
\mathrm{BCE}(\sigma(z),y)
= \log\!\big(1+e^{z}\big) - yz,
\label{eq:bce-logit}
\end{equation}
which is numerically stable and is often referred to as the logistic loss.
\end{definition}
\textbf{Edge weights (residual learning).}
For positive edges $(p,q)\in\mathcal{E}_{\tau+h}$, we predict a residual term
relative to the previous observed week. Let $\tilde{w}_{\tau}(e_{pq})=\log(1+w_{\tau}(e_{pq}))$ and $\tilde{w}_{\tau+h}(e_{pq})=\log(1+w_{\tau+h}(e_{pq}))$. The link head outputs $\widehat{r}_{pq,\tau,h}$ and we apply a robust Smooth~L1 loss:
\begin{equation}
\mathcal{L}_{\text{weight}}
=
\sum_{(p,q)\in\mathcal{E}_{\tau+h}}
\mathrm{SmoothL1}\!\Big(
\widehat{r}_{pq,\tau,h}
-
\big(\tilde{w}_{\tau+h}(e_{pq})-\tilde{w}_{\tau}(e_{pq})\big)
\Big).
\label{eq:loss-weight}
\end{equation}
{
Equivalently, we reconstruct $\widehat{\tilde{w}}_{\tau+h}(e_{pq})=\tilde{w}_{\tau}(e_{pq})+\widehat{r}_{pq,\tau,h}$ and minimize $\mathrm{SmoothL1}(\widehat{\tilde{w}}_{\tau+h}(e_{pq})-\tilde{w}_{\tau+h}(e_{pq}))$. We set $\tilde{w}_{\tau}(e_{pq})=0$ when the edge is absent at time $\tau$. The $\log(1+\cdot)$ transform stabilizes training under the heavy-tailed exposure distribution. Here, smooth L1 loss is defined as follows.
}
\begin{definition}[smooth L1 loss]
For a scalar prediction $\hat{u}\in\mathbb{R}$ and target $u\in\mathbb{R}$, let the residual be $r=\hat{u}-u$.
The Smooth~L1 (Huber) loss with threshold $\delta>0$ is defined as
\begin{equation}
\mathrm{SmoothL1}_\delta(r)=
\begin{cases}
\frac{1}{2}\frac{r^2}{\delta}, & \text{if } |r|<\delta,\\[6pt]
|r|-\frac{1}{2}\delta, & \text{otherwise}.
\end{cases}
\label{eq:smoothl1}
\end{equation}
Equivalently, written directly in terms of $(\hat{u},u)$:
\begin{equation}
\mathrm{SmoothL1}_\delta(\hat{u},u)=
\begin{cases}
\frac{1}{2}\frac{(\hat{u}-u)^2}{\delta}, & \text{if } |\hat{u}-u|<\delta,\\[6pt]
|\hat{u}-u|-\frac{1}{2}\delta, & \text{otherwise}.
\end{cases}
\end{equation}
\end{definition}
Smooth~L1 behaves like an $\ell_2$ loss near zero (encouraging small residuals) and like an $\ell_1$ loss for large residuals (reducing sensitivity to heavy tails and outliers). A common choice is $\delta=1$, when $\mathrm{SmoothL1}_\delta$ is briefly written as $\mathrm{SmoothL1}$.
\textbf{Node-level TVL dynamics.}
We also predict the log-change in protocol TVL,
$\Delta_{p,\tau+h}=\log(1+w_{\tau+h}(p))-\log(1+w_{\tau}(p))$,
using Smooth~L1:
\begin{equation}
\mathcal{L}_{\text{node}}
=
\sum_{p\in\mathcal{P}_{\tau}\cap \mathcal{P}_{\tau+h}}
\mathrm{SmoothL1}\!\left(\widehat{\Delta}_{p,\tau+h}-\Delta_{p,\tau+h}\right),
\label{eq:loss-node}
\end{equation}
where $\Delta_{p,\tau+h} = \log(1+w_{\tau+h}(p)) - \log(1+w_{\tau}(p))$ is the ground-truth log-change in TVL.
\textbf{Multi-task objective.}
The total loss is a weighted sum:
\begin{equation}
\mathcal{L}
=
\lambda_{\text{exist}}\mathcal{L}_{\text{exist}}
+
\lambda_{\text{weight}}\mathcal{L}_{\text{weight}}
+
\lambda_{\text{node}}\mathcal{L}_{\text{node}},
\label{eq:loss-total}
\end{equation}
with $\lambda_{\text{exist}}=2.0$, $\lambda_{\text{weight}}=0.5$, and $\lambda_{\text{node}}=20.0$. These weights are calibrated to balance the gradient contributions across tasks despite their different loss magnitudes: edge existence loss $\mathcal{L}_{\mathrm{exist}} \approx 0.22$, edge weight loss $\mathcal{L}_{\mathrm{weight}} \approx 2.4$, and node loss $\mathcal{L}_{\mathrm{node}} \approx 0.05$ on average. They also reflect the primary importance of link prediction while using weight and node supervision to encourage economically meaningful representations.
\subsubsection{Optimization}\label{subsubsec:optim}
\textbf{Initialization.} We adopt the open-source weights of GraphPFN as initialization of the encoder.
\textbf{Optimizer.}
We use Adam \citep{KingmaBa2015Adam} with hyperparameters $\beta_1=0.9$, $\beta_2=0.999$ and learning rate $\eta = 5 \times 10^{-4}$.
\textbf{Training details.}
We train for up to 20 epochs with early stopping (patience = 3) based on validation AUPRC. Gradient clipping ($\|\nabla\|_2 \le 1.0$) is applied for stability.
{
\textbf{Optional sharpness-aware training.}
To further improve generalizability, an optional variant wraps the base optimizer with Sharpness-Aware Minimization (SAM), which seeks parameters with lower local sharpness by optimizing against adversarial weight perturbations {\cite{foretsharpness}}.
}
\begin{table}[t]
\centering
\caption{Training hyperparameters for DeXposure-FM experiments.}
\label{tab:training-hparams}
\small
\setlength{\tabcolsep}{6pt}
\begin{tabular}{ll}
\hline
\textbf{Hyperparameter} & \textbf{Value} \\
\hline
Data granularity & Weekly snapshots \\
Forecast horizons $h$ & $\{1, 4, 8, 12\}$ weeks \\
Negative sampling ratio & 5:1 (neg:pos) \\
Optimizer & Adam ($\beta_1=0.9$, $\beta_2=0.999$) \\
Learning rate (heads) & $5 \times 10^{-4}$ \\
Learning rate (backbone) & $5 \times 10^{-5}$ (fine-tune only) \\
Training epochs & 20 (early stopping patience=3) \\
Gradient clipping & $\|\nabla\|_2 \le 1.0$ \\
\hline
\multicolumn{2}{l}{\textit{Loss weights:}} \\
$\lambda_{\mathrm{exist}}$ (edge existence) & $2.0$ \\
$\lambda_{\mathrm{weight}}$ (edge weight) & $0.5$ \\
$\lambda_{\mathrm{node}}$ (node prediction) & $20.0$ \\
\hline
\end{tabular}
\end{table}
\begin{comment}
\newpage
\section{Empirical Evaluations on Machine Learning Benchmarks}
\subsection{Task 1: Multi-step Forecasting}
\textbf{Implementation Deatails}
\textbf{Empirical Results}
\subsection{Task 2: xx}
\textbf{Implementation Deatails}
\textbf{Empirical Results}
\section{Financial Economics Tools and Experimental Verifications}
\subsection{Macroprudential Applications}
\textbf{Systemic importance ranking.}
\textbf{Sector spillover monitoring. }
\textbf{Stress testing and contagion assessment.}
\textbf{Early warning signals.}
\subsection{Validity and Scope}
\end{comment}
\section{Empirical Evaluations on Machine Learning Benchmarks}
\label{sec:evaluation}
We evaluate DeXposure-FM on two machine learning benchmarks: (1) {multi-step forecasting} of edge existence, edge weights, and node TVL changes; and (2) {predictive contagion stress testing}, where we forecast future simulator-implied stress-test losses under fixed counterfactual shocks. The following Section~\ref{sec:econ} provides economic interpretation and applications of these predictive outputs.
\begin{comment}
\subsubsection{Temporal split}
We use a two-stage evaluation protocol:
\textit{Stage 1: Model selection via walk-forward cross-validation.}
We apply expanding window walk-forward cross-validation on pre-2025 data with 15 folds. Each fold uses a minimum of 104 training weeks, 24 validation weeks (for early stopping), and 8 test weeks. The validation window is sized to ensure sufficient samples even at longer horizons: for $h=12$, we require $\geq 12$ validation weeks to construct valid forecast pairs. The window advances by 8 weeks per fold, accumulating more training data. This stage is used for hyperparameter selection and model comparison.
\textit{Stage 2: Hold-out evaluation.}
Final performance is reported on a strict 2025 hold-out set, which is never seen during training or validation:
\begin{itemize}
\item \textbf{Training:} 2020-03-23 $\sim$ 2024-07-15 (225 weeks)
\item \textbf{Validation:} 2024-07-22 $\sim$ 2024-12-30 (24 weeks, for early stopping)
\item \textbf{Test:} 2025-01-06 $\sim$ 2025-08-18 (33 weeks, strict hold-out)
\end{itemize}
Stage 1 is used for hyperparameter tuning; all results reported in this paper are from Stage 2 hold-out evaluation.
\subsubsection{Forecast horizons vs. CV windows.}
The 8-week CV window controls how the temporal folds slide; within each window, the model predicts at multiple forecast horizons $h \in \{1, 4, 8, 12\}$ weeks ahead. These are orthogonal: the CV window determines sample collection, while $h$ determines how far into the future each prediction extends.
\end{comment}
\subsection{Baseline and Competitors}
We compare our model with three approaches:
{{GraphPFN:} pre-trained GraphPFN encoder with frozen weights; only the following task-specific prediction heads are trained on DeXposure. In contrast, {DeXposure-FM} uses GraphPFN weights as initialization and fine-tunes the encoder and task heads end-to-end; (2)
{ROLAND:} a representative temporal graph neural network \citep{YouEtAl2022ROLAND}, trained from scratch on DeXposure; and (3) a persistent baseline that directly uses the current value at time $t$ as the prediction for a future timing $t+h$, where $h$ is the horizon. }
They use the same optimizer, learning rate, and training schedule as DeXposure-FM.
\subsection{Task I: Multi-step Forecasting}
\label{subsec:forecast}
We first evaluate DeXposure-FM on task of multi-step forecasting.
\subsubsection{Implementation Details}
\label{subsubsec:task1-impl}
We evaluate multi-step forecasts at horizons $h \in \{1,4,8,12\}$ weeks on three targets: (1) \emph{edge existence}, a binary classification task of whether an edge $(p,q)$ is present at $t+h$, (2) \emph{edge weight}, a regression task on log-scaled exposure weight for edges that exist, and (3) \emph{node TVL change}, a regression task.
{We report AUROC \citep{Fawcett2006ROC} and AUPRC \citep{DavisGoadrich2006PR}} for edge existence and MAE and RMSE for edge weights and $\Delta$TVL (all on the log scale).
\subsubsection{Empirical Results}
\label{subsubsec:task1-results}
\begin{table}[t]
\centering
\caption{Multi-step forecasting results on 2025 hold-out test set at horizons $h \in \{1,4,8,12\}$ weeks. DeXposure-FM = Finetuned Foundation Model, GraphPFN = Graph Prior Fitted Network with Frozen weights. \textit{Persistence} = naive baseline predicting $\hat{A}_{t+h} = A_t$, $\hat{W}_{t+h} = W_t$.}
\label{tab:main-results}
\small
\setlength{\tabcolsep}{4pt}
\begin{tabular}{llcccccc}
\hline
& & \multicolumn{2}{c}{\textbf{Edge Exist}} & \multicolumn{2}{c}{\textbf{Edge Weight}} & \multicolumn{2}{c}{\textbf{Node $\Delta$TVL}} \\
\textbf{Model} & $h$ & AUROC & AUPRC & MAE & RMSE & MAE & RMSE \\
\hline
\multirow{4}{*}{DeXposure-FM}
& 1 & \textbf{0.995} & \textbf{0.972} & \textbf{2.465} & \textbf{3.388} & \textbf{0.056} & \textbf{0.400} \\
& 4 & \textbf{0.995} & \textbf{0.973} & \textbf{2.489} & \textbf{3.424} & \textbf{0.140} & \textbf{0.680} \\
& 8 & \textbf{0.994} & \textbf{0.967} & \textbf{2.554} & \textbf{3.509} & \textbf{0.229} & \textbf{0.890} \\
& 12 & \textbf{0.993} & \textbf{0.967} & \textbf{2.648} & \textbf{3.606} & \textbf{0.286} & \textbf{1.046} \\
\hline
\multirow{4}{*}{GraphPFN}
& 1 & 0.988 & 0.938 & 3.260 & 4.383 & 0.059 & 0.401 \\
& 4 & 0.988 & 0.940 & 3.189 & 4.049 & 0.142 & 0.682 \\
& 8 & 0.987 & 0.938 & 3.169 & 4.064 & 0.215 & 0.896 \\
& 12 & 0.986 & 0.936 & 3.136 & 4.130 & 0.324 & 1.056 \\
\hline
\multirow{4}{*}{ROLAND}
& 1 & 0.961 & 0.865 & 3.240 & 4.264 & 0.060 & 0.403 \\
& 4 & 0.962 & 0.868 & 3.242 & 4.162 & 0.141 & 0.684 \\
& 8 & 0.961 & 0.867 & 3.213 & 4.180 & 0.221 & 0.895 \\
& 12 & 0.961 & 0.866 & 3.195 & 4.177 & 0.279 & 1.058 \\
\hline
\multirow{4}{*}{Persistence}
& 1 & 0.763 & 0.604 & 2.487 & 4.296 & 0.057 & 0.403 \\
& 4 & 0.782 & 0.635 & 2.372 & 4.138 & 0.138 & 0.685 \\
& 8 & 0.749 & 0.580 & 2.618 & 4.400 & 0.213 & 0.899 \\
& 12 & 0.762 & 0.603 & 2.541 & 4.304 & 0.272 & 1.065 \\
\hline
\end{tabular}
\end{table}
Table~\ref{tab:main-results} reports the forecasting results on the strict 2025 hold-out test set.
Despite the strong persistence of the exposure network (Table~\ref{tab:data-stats}), DeXposure-FM substantially outperforms other methods for {edge existence} prediction,
{edge weights},
and {node TVL changes}.
\subsection{Task II: Predictive Contagion Stress Testing}
\label{subsec:stability}
We then evaluate our model on whether forward-looking network forecasts translate into accurate forecasts of \emph{stress-test losses} generated by a fixed contagion simulator. Specifically, we compare system losses computed on the model-predicted future network $\hat{G}_{t+h}$ with losses on the realized future network $G_{t+h}$, under fixed counterfactual shock definitions.
\subsubsection{Implementation Details}
\label{subsubsec:task2-impl}
We train DeXposure-FM on the pre-2025 training period (Section~\ref{subsec:training-pipeline}) and evaluate on the strict 2025 hold-out set. Each test week provides an origin $t$, yielding multiple out-of-sample pairs $(t,t+h)$ for horizons $h\in\{1,4,8,12\}$. To handle protocol entry/exit, all comparisons are computed on the common node set $V_t \cap V_{t+h}$.
Stress-test losses are computed using a DebtRank-style contagion simulator \citep{EisenbergNoe2001,BattistonEtAl2012DebtRank} under three scenarios: (1) \emph{top protocol shock}: 50\% TVL loss to the largest protocol, (2) \emph{top-5 protocols shock}: 30\% TVL loss to the top-5 protocols, and (3) \emph{bridge sector shock}: 100\% TVL loss to bridge protocols. For each $(t,t+h)$, we run the same simulator on three graphs: the observed network at $t$ (persistence baseline), the predicted network $\hat{G}_{t+h}$, and the realized network $G_{t+h}$.
Because the DeFi exposure network is highly persistent (Table~\ref{tab:data-stats}), the persistence baseline is difficult to beat on average. We therefore report both (1) overall performance and (2) a \emph{post-hoc stratified evaluation} on the \textbf{worst 20\%} of test cases under persistence, defined by the largest baseline absolute errors within each horizon (pooled across shock scenarios). This stratification is computed on the held-out test set and is not used for model selection. We summarize improvement with $\Delta \mathrm{MAE}=\mathrm{MAE}(\text{baseline})-\mathrm{MAE}(\text{model})$, where positive values indicate lower error than persistence.
\subsubsection{Empirical Results}
\label{subsubsec:task2-results}
Figure~\ref{fig:contagion-comparison} shows comparison between three methods,
and Figure~\ref{fig:contagion-advantage} visualizes $\Delta\mathrm{MAE}$ in both the overall population and the worst-20\% tail. Table~\ref{tab:contagion-advantage} reports horizon-level summary statistics.
{On average, persistence remains a strong baseline ($\Delta\mathrm{MAE}(\text{all})<0$, i.e., persistence achieves lower error than the model), reflecting the high week-to-week stability of the DeFi exposure network. The value of a learned forecaster emerges in the tail: among the 20\% of test cases where persistence errors are largest, DeXposure-FM achieves positive $\Delta\mathrm{MAE}$ with win rates of 83--100\%. This tail regime, where network structure shifts most from the previous week, is precisely where forward-looking stress tests matter for macroprudential monitoring. The improvement is most pronounced under bridge-sector shocks (Figure~\ref{fig:contagion-advantage}), consistent with the sensitivity of cross-chain contagion to evolving network topology.}
\begin{figure}[t]
\centering
\includegraphics[width=0.95\textwidth]{figures/fig_contagion_comparison.pdf}
\caption{Predictive contagion stress testing (Task II). We compare system loss (\%) under identical shocks when running the contagion simulator on the observed network at time $t$ (persistence baseline), the model-predicted network $\hat{G}_{t+h}$, and the realized future network $G_{t+h}$.}
\label{fig:contagion-comparison}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=0.95\textwidth]{figures/fig_contagion_advantage.pdf}
\caption{Advantage regimes for predictive stress testing. Bars report $\Delta\mathrm{MAE}=\mathrm{MAE}(\text{baseline})-\mathrm{MAE}(\text{model})$ in system loss (\% points). ``Overall'' is the full test set; ``Worst 20\%'' restricts to the 20\% largest baseline errors (tail regime). Positive values indicate DeXposure-FM outperforms persistence, highlighting where a learned forecaster adds value when the persistence assumption breaks.}
\label{fig:contagion-advantage}
\end{figure}
\begin{table}[t]
\centering
\caption{Predictive stress testing summary (2025 hold-out). $\Delta\mathrm{MAE}$ is measured in system-loss percentage points. Worst20\% selects the 20\% largest persistence-baseline errors within each horizon (pooled across shock scenarios). ``Win rate'' is the fraction of worst20\% cases where the model has lower absolute error than persistence.}
\label{tab:contagion-advantage}
\small
\setlength{\tabcolsep}{6pt}
\begin{tabular}{lccc}
\hline
Horizon $h$ & $\Delta\mathrm{MAE}(\text{all})$ & $\Delta\mathrm{MAE}(\text{worst20\%})$ & Win rate (worst20\%) \\
\hline
1 & $-0.95$ & $+3.04$ & 100\% \\
4 & $-1.71$ & $+1.42$ & 83\% \\
8 & $-0.17$ & $+2.60$ & 100\% \\
12 & $-0.55$ & $+2.21$ & 83\% \\
\hline
\end{tabular}
\end{table}
\section{Financial Economics Tools and Experimental Verifications}
\label{sec:econ}
We now translate our model into financial-economics tools and provide experimental verifications.
DeXposure-FM is directly relevant to macroprudential monitoring of decentralized financial infrastructure, addressing the data gaps highlighted.
Concretely, let $G_t$ denote the observed weekly exposure graph and let $\hat{G}_{t+h}$ denote the model's $h$-step-ahead forecast. We treat each monitoring ``tool'' as a deterministic functional of a graph (a measurement map) that can be applied either {descriptively} on $G_t$ or {predictively} via the \emph{forecast-then-measure} pipeline:
\begin{equation}
G_t \;\xrightarrow{\;\;\text{DeXposure-FM}\;\;}\; \hat{G}_{t+h}
\;\xrightarrow{\;\;\text{tools}\;\;}\;
\widehat{\mathcal{M}}_{t+h} \equiv \mathcal{M}(\hat{G}_{t+h}),
\end{equation}
where $\mathcal{M}(\cdot)$ includes protocol-level systemic-importance rankings (SIS), cross-sector spillover concentration, and scenario-based stress-test losses. This framing aligns with the macroprudential objective of producing \emph{actionable, time-$t$ signals} about \emph{time-$t+h$ fragility} (e.g., watchlists, risk channels, and scenario backstops), while remaining fully transparent about the underlying network objects.
\subsection{Systemic Risk Measurement: SIS and Spillovers}
\label{subsubsec:systemic-risk}
We first introduce SIS and spillovers as systemic risk measurement.
\subsubsection{Implementation}
We compute protocol-level and network-level indicators on each weekly exposure snapshot. For protocol $p$, the SIS combines interconnectedness, exposure concentration, and scale:
\begin{equation}
\text{SIS}_p = \alpha \cdot \widetilde{\text{PageRank}}_p + \beta \cdot \text{TailExposure}_p + \gamma \cdot \widetilde{\log(1+\text{TVL}_p)},
\label{eq:sis}
\end{equation}
where $\text{TailExposure}_p$ is the share of $p$'s top-$k$ outgoing exposures (we use $k=5$), and $\alpha,\beta,\gamma$ are non-negative weights that sum to 1 (default $\alpha=\beta=\gamma=1/3$). We normalize PageRank {\citep{BrinPage1998PageRank}} and $\log(1+\text{TVL})$ to comparable scales (denoted by tildes). In parallel, we aggregate edge weights into a sector-to-sector spillover matrix $\mathbf{S}\in\mathbb{R}^{K\times K}$ where $S_{ij}$ is total exposure from sector $i$ to $j$, and compute a scale-invariant spillover concentration index as the {Herfindahl-Hirschman Index (HHI) \citep{Rhoades1993HHI}} of off-diagonal entries:
\begin{equation}
\text{SpilloverIndex} = \text{HHI}\left(\{S_{ij} : i \neq j\}\right).
\end{equation}
These measures operationalize the network-theoretic insight that interconnectedness, not just size, determines systemic fragility \citep{Acemoglu2015SystemicRisk,GlassermanYoung2016Contagion}. Weekly SIS rankings help identify protocols whose distress would propagate broadly, while spillover monitoring can highlight sector pairs that act as risk conduits (e.g., stablecoins and bridges) \citep{KosseEtAl2023Stablecoin,ESRB2025,DieboldYilmaz2012}.
SIS and spillovers are standard {descriptive} measures when computed on the observed network $G_t$. The contribution of DeXposure-FM is to make them \emph{forward-looking}: we first forecast a future exposure graph $\hat{G}_{t+h}$ and then compute \[\widehat{\text{SIS}}_{t+h}(p)=\text{SIS}_p(\hat{G}_{t+h}),\] \[\widehat{\text{SpilloverIndex}}_{t+h}=\text{SpilloverIndex}(\hat{G}_{t+h}).\]
This yields actionable forecasts such as (1) a predicted watchlist of systemically important protocols at $t+h$, and (2) predicted cross-sector risk channels.
At each week $t$, a supervisor computes the current dashboard on $G_t$ and the forecast dashboard on $\hat{G}_{t+h}$. Large predicted changes in the top-$K$ SIS list or spikes in predicted spillover concentration motivate targeted stress scenarios (Section~\ref{subsubsec:contagion}) and deeper qualitative review (e.g., governance risk and code audit status of newly elevated protocols).
\subsubsection{Empirical Validation}
Empirically, we validate this ``forecast-then-measure'' workflow at the level of aggregate risk metrics (including mean SIS and spillover concentration) by comparing values computed on $\hat{G}_{t+h}$ vs.\ $G_{t+h}$ (Figure~\ref{fig:forward-risk-scatter}) and by event-window case studies (Figure~\ref{fig:early-warning}).
\subsection{Stress Testing and Contagion Assessment}
\label{subsubsec:contagion}
Stress testing maps a counterfactual shock scenario into a system-wide loss measure by propagating distress through the exposure network, providing a scenario-specific analogue of macro stress tests in a DeFi setting.
\subsubsection{Implementation}
We implement a DebtRank-style contagion simulation to assess systemic loss propagation, following the loss-allocation logic \cite{EisenbergNoe2001,BattistonEtAl2012DebtRank}. Given an initial shock to protocol $p_0$ with loss ratio $\delta_0$, we run the following procedure:
\begin{enumerate}
\item \emph{Initialize:} $\text{Loss}_{p_0} = \delta_0 \cdot \text{TVL}_{p_0}$.
\item \emph{Propagate:} When a distressed debtor $p$ has loss $\text{Loss}_p$, we allocate its loss to its creditors $q$ proportionally to their exposures $E_{qp}$:
\begin{equation}
\Delta \text{Loss}_q \;=\; \text{Loss}_p \cdot \frac{E_{qp}}{\sum_{q'} E_{q'p}}.
\end{equation}
\item \emph{Iterate:} If $\text{Loss}_q > \tau \cdot \text{TVL}_q$ (distress threshold $\tau=0.1$), protocol $q$ becomes distressed and propagates losses to its creditors. Losses are capped at $\text{TVL}_q$.
\item \emph{Terminate:} When no new protocols become distressed.
\end{enumerate}
We report total system loss (as a percentage of total TVL), contagion depth (propagation rounds), and affected-protocol counts. The three stress scenarios used throughout are: top protocol shock (50\% TVL loss), top-5 protocols shock (30\%), and bridge sector shock (100\%).
\subsubsection{Empirical Verification}
Section~\ref{subsec:stability} evaluates \emph{forward-looking} stress testing; here, we run the same simulator on $G_t$ (persistence baseline), $\hat{G}_{t+h}$ (model forecast), and $G_{t+h}$ (realized future), and then compare the resulting system loss. Because the DeXposure network is highly persistent week-to-week, the persistence baseline is strong \emph{on average}. However, in the subset of weeks where realized losses deviate most from persistence (the worst 20\% baseline-error regime), DeXposure-FM provides consistent improvements (Table~\ref{tab:contagion-advantage}), with gains concentrated in bridge-sector shocks (Figure~\ref{fig:contagion-advantage}). This supports a macroprudential interpretation: the model is most valuable as a \emph{backstop} for scenario analysis under non-stationary reallocation of exposures.
\subsection{Forward-looking Risk Metric Forecasting}
\label{subsubsec:forward-looking-risk}
Aggregate risk metrics (e.g., concentration, density, spillovers) serve as dashboard-style indicators of evolving fragility. Forecasting these aggregates provides a practical way to monitor trend shifts and calibrate the forecast-then-measure pipeline.
\subsubsection{Implementation}
Beyond stress testing, we can forecast aggregate stability indicators by first predicting a future exposure graph $\hat{G}_{t+h}$ and then computing deterministic risk metrics on it (e.g., TVL concentration, edge concentration, network density, spillover index, and summary statistics of SIS). We compare these predicted metrics to their realized counterparts on $G_{t+h}$ across the 2025 hold-out set.
\subsubsection{Empirical Verification}
Figure~\ref{fig:forward-risk-scatter} reports predicted vs.\ realized risk metrics for $h\in\{1,4,8,12\}$. We interpret these plots as a \emph{calibration and monitoring} check: even when persistence dominates levels, the predicted metrics can flag directional changes and large deviations that motivate deeper scenario analysis and qualitative review.
\begin{figure}[t]
\centering
\includegraphics[width=0.95\textwidth]{figures/fig_forward_risk_scatter.pdf}
\caption{Forward-looking risk metric forecasting on predicted exposure graphs. Each point compares a realized metric on $G_{t+h}$ (x-axis) to the same metric computed on the predicted graph $\hat{G}_{t+h}$ (y-axis), across horizons.}
\label{fig:forward-risk-scatter}
\end{figure}
\subsection{Early Warning Signals and Event Studies}
\label{subsubsec:shock-events}
Early warning analysis evaluates whether forecast-based measurements shift in advance of major stress events, providing event-study evidence that the forecast-then-measure tools can produce timely alerts around regime changes.
\subsubsection{Implementation}
We examine two major stress events: the Terra/Luna collapse (May 9, 2022) and the FTX collapse (November 7, 2022). To avoid event leakage, for each event, we train an event-specific forecaster using only snapshots strictly prior to the event window, then generate one-step-ahead forecasts within the event window. We track structural indicators and stress-test outcomes (via Section~\ref{subsubsec:contagion}) and monitor potential early warning features:
\begin{itemize}
\item Changes in network connectivity (e.g., density $\rho_t$),
\item Concentration shifts (e.g., TVL HHI), with practical threshold rules such as $\Delta\text{HHI}_t > 2\sigma$,
\item Predicted stress-test losses under standard scenarios (Section~\ref{subsubsec:contagion}).
\end{itemize}
\subsubsection{Empirical Verification}
Table~\ref{tab:shock-results} summarizes structural shifts during the event windows, and Figure~\ref{fig:early-warning} compares predicted vs.\ realized trajectories for risk concentration and stress-test loss. These case studies illustrate how model-based forecasting can complement descriptive monitoring by providing forward-looking alerts around regime changes.
\begin{table}[t]
\centering
\caption{Network structure changes during stress events, comparing the last pre-event week (anchor) to the final week of the event window. Terra/Luna shows a flight-to-quality pattern with TVL collapse but edge count increase as capital reorganizes across protocols. The FTX event shows a \emph{positive} $\Delta$TVL because our dataset captures only on-chain DeFi protocols: the collapse of a centralized exchange triggered capital migration \emph{into} DeFi as users withdrew funds to self-custody, consistent with the ``flight to decentralization'' narrative \citep{VidalTomasEtAl2023FTX}.}
\label{tab:shock-results}
\begin{tabular}{lcccc}
\hline
\textbf{Event} & \textbf{Pre-TVL (\$B)} & \textbf{Post-TVL (\$B)} & \textbf{$\Delta$TVL} & \textbf{$\Delta$Edges} \\
\hline
Terra/Luna & 261.9 & 166.3 & $-$36.5\% & +9.3\% \\
FTX & 119.9 & 175.1 & +46.1\% & $-$1.8\% \\
\hline
\end{tabular}
\end{table}
\begin{figure}[t]
\centering
\includegraphics[width=0.95\textwidth]{figures/fig_early_warning.pdf}
\caption{Early warning event studies. For each event window, we compare predicted vs.\ realized risk concentration (HHI) and predictive stress-test loss (contagion system loss \%).}
\label{fig:early-warning}
\end{figure}
\subsection{Validity and Scope}
\label{subsec:validity}
Model-based risk measures are only as reliable as the conditions under which they were trained and validated. We report several boundaries that users should keep in mind.
\subsubsection{Stable vs. Turbulent Regimes}
The DeXposure dataset exhibits 98.5\% mean edge overlap week-to-week, meaning most credit relationships persist. Under such stable conditions, GraphPFN achieves an AUROC larger than 0.91 across all forecast horizons; see Table~\ref{tab:main-results}. During structural breaks, such as new protocol launches, governance attacks, or rapid deleveraging, the historical edge distribution may shift abruptly, and forecasts should be interpreted with greater caution. The degradation of ROLAND illustrates how models without pre-trained representations struggle when asked to extrapolate beyond short horizons.
\subsubsection{Data Coverage}
DeXposure-FM is trained exclusively on on-chain DeFi protocols sourced from DeFiLlama. It does not observe:
\begin{itemize}
\item Centralized exchange (CEX) balances or order-book exposures,
\item Over-the-counter (OTC) derivatives or lending agreements,
\item Off-chain reserves backing stablecoins (e.g., Treasury holdings of USDC).
\end{itemize}
Consequently, the model captures intra-DeFi contagion but cannot directly assess spillovers to or from traditional financial institutions, a gap that matters as DeFi-TradFi linkages deepen.
\subsubsection{Temporal Resolution}
The training dataset aggregates to weekly snapshots. Intraday or even daily dynamics, such as flash-loan attacks \citep{Qin2021FlashLoans} or rapid liquidation cascades \citep{Warmuz2023ToxicLiquidationSpirals}, are smoothed out. For high-frequency risk monitoring, complementary tools operating on block-level data would be required.
\subsubsection{Cross-chain Data Consistency}
DeXposure aggregates data across 602 blockchains, each with its own indexing quirks and oracle delays. Minor inconsistencies in timestamp alignment or token-price feeds can introduce noise. Users should be aware that edge weights near reporting boundaries may reflect data artifacts rather than genuine exposure changes.
\subsubsection{TVL as a Measurement Proxy}
TVL aggregates heterogeneous assets without risk weights, a limitation we discuss in Section~\ref{sec:conclusion}. Nevertheless, TVL remains the main metric for assessing DeFi protocol significance \citep{BIS2025TVL}, and its changes over time capture the capital flows that drive contagion \citep{ZhangEtAl2026TVLDynamics}. The tools are therefore most informative for relative monitoring (rankings, concentration changes, scenario comparisons) rather than absolute loss accounting.
\subsubsection{Our aim: Complement, not replace, qualitative judgment}
Model outputs such as SIS rankings and spillover indices are quantitative summaries, not definitive verdicts. A protocol may rank low on SIS yet pose idiosyncratic risks (e.g., smart-contract vulnerabilities, oracle manipulation) that network topology alone cannot capture \citep{DuleyEtAl2023Oracle,gogol2024sokdecentralizedfinancedefi}. Supervisors should triangulate model signals with code audits, governance analyses, and market intelligence.
\begin{comment}
\subsection{Scope, Limitations, and Implementation Considerations}
\label{subsec:limitations}
Model-based network risk measurement is only as reliable as the data coverage and the stability of the mapping from observables to exposures \citep{MullainathanSpiess2017}. We summarize the main boundaries that matter for interpreting and deploying the tools in Section~\ref{subsec:macro-applications}.
\noindent\textbf{Stable vs.\ turbulent regimes (and drift).} The DeXposure dataset exhibits 98.5\% mean edge overlap week-to-week, so persistence is strong under stable conditions. During structural breaks---new protocol launches, governance attacks, or rapid deleveraging---the historical edge distribution may shift abruptly. In these settings, persistence-style baselines can fail, and forward-looking forecasts can be most informative (e.g., the worst20\% tail-regime gains in Table~\ref{tab:contagion-advantage}). Because DeFi evolves rapidly, periodic retraining on updated snapshots is necessary to mitigate model drift.
\noindent\textbf{Data coverage and external validity.} DeXposure-FM is trained exclusively on on-chain DeFi protocols sourced from DeFiLlama. It does not observe (i) centralised exchange balances or order-book exposures, (ii) OTC derivatives or off-chain lending agreements, or (iii) off-chain reserves backing stablecoins \citep{AnaduEtAl2023StablecoinsMMF}. Consequently, the tools are best interpreted as measures of \emph{intra-DeFi} fragility and cannot directly assess spillovers to or from traditional financial institutions---a limitation that becomes more salient as DeFi-TradFi linkages deepen \citep{ESRB2025}.
\noindent\textbf{Measurement proxies (TVL and exposure weights).} TVL is a convenient but imperfect proxy for economically meaningful exposures \citep{BERTOMEU2024105321}. It aggregates heterogeneous collateral and liquidity profiles (stablecoins, volatile tokens, LP positions) without risk weights. Likewise, exposure weights derived from TVL flow reconstructions may not map one-to-one to contractual seniority or liquidation priority. In practice, the tools are most useful for relative monitoring (rankings, concentration changes, and scenario deltas) rather than absolute loss accounting.
\noindent\textbf{Temporal resolution and data quality.} The dataset aggregates to weekly snapshots, so intraday dynamics---such as flash-loan attacks \citep{Qin2021FlashLoans} or liquidation cascades \citep{Warmuz2023ToxicLiquidationSpirals}---are smoothed out. For high-frequency monitoring, complementary block-level tools are required. Finally, because DeXposure aggregates data across hundreds of chains with heterogeneous indexing and oracle conventions, quality control is important: edge weights near reporting boundaries may reflect data artefacts rather than genuine exposure changes.
\end{comment}
\section{Future Development Plan}
We plan to continuously update and improve DeXposure-FM. Below is our future development plan.
\subsection{Enlarging Training Data Pool}
The current DeXposure-FM is trained on weekly inter-protocol snapshots from the DeXposure dataset, using a GraphPFN encoder as pretrained initialization. While this provides broad on-chain coverage at a stable temporal resolution, it omits key off-chain channels through which DeFi is funded, hedged, and linked to traditional markets. In DeXposure-FM~2.0, we plan to expand the training pool by incorporating additional data sources, including centralized exchange (CEX) balances and order-book–implied exposures, over-the-counter (OTC) derivatives and lending agreements, and disclosures on off-chain stablecoin reserves (e.g., USDC’s Treasury-backed holdings). We also aim to add higher-frequency data (daily or intraday, where feasible), particularly around stress episodes, to better capture rapid deleveraging and liquidity dynamics that weekly aggregation smooths out.
\subsection{Expanding Proxies for Credit Exposure}
Total Value Locked (TVL) is a convenient but imperfect proxy for economic exposure. It aggregates heterogeneous assets into a single dollar value without adjusting for liquidity, haircuts, or collateral quality. As a result, equal TVL can imply very different loss-absorbing capacity and contagion risk; for example, \$1B held in thinly traded governance tokens is not economically equivalent to \$1B in USDC, and TVL can also move mechanically with prices even when underlying positions are unchanged. To address these limitations, DeXposure-FM~2.0 will incorporate asset-level risk weights and composition features (e.g., liquidity and volatility proxies, depeg risk, and observable collateral rules) to produce risk-adjusted exposure estimates and more interpretable systemic-risk indicators.
\subsection{Model Drift and Continuous Update}
DeFi evolves rapidly: new chains launch, token standards change, and incentive mechanisms shift. This non-stationarity implies that a model trained on historical regimes may gradually lose accuracy as exposures and flows depart from past patterns, including both gradual structural change and discrete breaks from major upgrades or new collateral rules. Periodic retraining on updated snapshots is therefore essential to maintain forecast quality, ideally paired with drift monitoring (e.g., calibration and error shifts by sector/chain) and versioned releases so that risk signals can be traced to specific data vintages and model iterations.
\subsection{Innovative Model Architecture}
The future DeXposure-FM 2.0 will include an innovative hybrid architecture that combines the current direct multi-horizon forecasting paradigm \citep{RasulEtAl2023LagLlama} with diffusion-based generative modeling \citep{MeijerChen2024DiffusionTS}. Auto-regressive models are efficient and accurate for point and conditional forecasts, but they can struggle to represent globally coherent network trajectories over long horizons, especially under stress. Diffusion models, by contrast, provide a principled way to learn complex conditional distributions by gradually denoising samples, and have recently shown strong performance in structured generation tasks, such as in diffusion language models \citep{LiEtAl2022DiffusionLM}.
\subsection{Open Source, Competitions, and Community Development}
We endeavor to develop DeXposure-FM to become fundamental infrastructure rather than a closed research artifact. We have released an open-source version of model weights and training code. We will continue our open-source efforts when improving the model. Based on the DeXposure dataset and DeXposure-FM model, we will organize public benchmarking competitions. These challenges will be designed to encourage robust methods and will include baseline implementations, leaderboards, and model cards reporting calibration and failure modes. We also aim to build a sustained community around DeFi economic measurement. By lowering barriers to entry and making the measurement process transparent, we hope to accelerate cumulative progress on reliable, policy-relevant tools for monitoring systemic risk in decentralized financial networks.
\section{Conclusions}
\label{sec:conclusion}
Credit exposures in decentralized finance (DeFi) are often embedded in token holdings and smart-contract interactions, rather than recorded as explicit bilateral claims, forming a tightly coupled network of inter-protocol dependencies. In such an environment, a disturbance to a single token can propagate across protocols, generating sizable and difficult-to-contain contagion. As DeFi becomes more intertwined with traditional financial infrastructure, most prominently via stablecoins, this evolving risk landscape calls for stronger tools to measure and forecast exposures. We introduce DeXposure-FM, which is arguably the first time-series, graph foundation model, designed for DeFi. DeXposure-FM combines a graph–tabular encoder with pretrained weights as initialization and multiple task-specific heads. It is trained on the DeXposure dataset, comprising 43.7 million observations spanning 4,300+ protocols on 602 blockchains and 24,300+ unique tokens. The model is trained for credit-exposure forecasting, jointly learning the dynamics of protocol-level flows and the evolving topology and weights of exposure links, from which sector-level spillovers and other network statistics are derived. Across a suite of machine-learning benchmarks, DeXposure-FM consistently outperforms strong competitors, including a prior graph foundation model and state-of-the-art temporal graph neural networks. We also translate the model outputs into economically interpretable indicators, including time-varying measures of systemic importance, sector-level spillover, and early-warning signals based on shifts in network concentration and reliance on fragile collateral, which illustrate applications to macroprudential monitoring, DeFi stress testing, and counterfactual policy analysis. The tools are fully supported in the empirical validations. The model and code have been publicly available.
\bibliographystyle{elsarticle-harv}
\bibliography{sections/DeXposure-FM}