Back to Articles

January 1, 2024



min read

The Imbalance Score: A Novel Metric for RWA-Focused Perpetual DEXes

This research article investigates the role of Real World Assets (RWAs) in enhancing risk management within multi-asset, pool-based perpetual Automated Market Makers (AMMs). We focus on the challenges of risk management in these systems, particularly addressing accumulated directional exposure and risk concentration. Central to this study is our development of the ‘Imbalance Score’, a novel metric for quantifying counterparty risk, derived from first principles and Modern Portfolio Theory. Through analysis of historical data and simulated scenarios, we demonstrate how RWAs can effectively reduce the mean and variance of counterparty risks in these AMM models, offering insights into the potential of RWAs in improving the stability and efficiency of these systems.

This article is also available in PDF form here (recommended).

To read Chaos Labs’ complementary article on the subject, see here.

1. Introduction: Pool-Based Perpetual AMMs

1.1 Structural Overview

In this article, we explore the potential for diversifying Real World Assets (RWAs) to mitigate risk in multi-asset, pool-based perpetual AMMs. These DEXes face a unique set of risk management challenges that make them particularly well suited to the benefits of asset diversification.

Before diving deeper, we’ll begin by clearly defining the distinct perpetual exchange design paradigm we’re focused on. This model diverges substantially from both traditional Central Limit Order Books (CLOB) and virtual Automated Market Makers (vAMM). Often loosely described as an “oracle-based AMM,” this label does not fully capture its unique approach to price discovery, which significantly departs from standard AMMs that enable true price discovery of the underlying asset.

Key characteristics of this DEX model include:

1. Unified Reference Price. Unlike models with differing mark and index prices, this system uses a single reference price for each traded asset. This does not facilitate organic price discovery of the perpetual itself but rather involves synthetic or virtual pricing of the cost of holding the position, enabled by market-condition-dependent fees.

2. Fee Structuring. Use of fees to price the risk of positions to the protocol by simulating the effects of organic price discovery.

- One-Time Fees. At trade opening/closing, fees may include a skew-dependent fee simulating price impact, or a fixed percentage of the notional trade size.

- Compounding Fees. These are crucial during the trade’s lifetime for pricing externalities. They often include a blend of borrowing costs, volatility risk, and open interest skew, thereby managing the risk of positions to the protocol and its counterparty pool.

3. Fully Onchain, Asynchronous Order Fulfillment. This model allows immediate trade execution within liquidity bounds, independent of a direct counterparty. This requires:

- Risk-dependent compounding fees to restore protocol equilibrium and minimize directional risk.

- Pooled capital to balance temporary liquidity imbalances.

4. Pooled Capital as a Third Counterparty. Similar to AMMs, this model relies on pooled liquidity for trade execution without an immediate counterparty. However, unlike AMMs where liquidity providers (LPs) face impermanent loss risk, here LPs face PnL risk, directly counterbalancing trader profits and losses. Recent developments have sought to mitigate risks through liquidity segmentation to manage the impact of market anomalies or sustained trader gains.

In summary, the primary distinguishing feature of this DEX model is its approach to virtual price exposure, underpinned by asynchronous, onchain trade execution. This model opens the door for un- or less-correlated RWAs to play a unique role in enhancing risk management.

1.2 Risk Management Challenges

Despite the growing popularity of this model, it faces complex risk management challenges. These arise primarily from its asynchronous order matching, the potentially significant resulting directional exposure, and risk concentration across multiple, often highly correlated assets within a single pool.

Current risk management strategies focus mainly on pricing and risk concentration. Examples include:

- Dividing liquidity into asset-specific pools, reducing risk concentration compared to a unified pool approach.

- Conservatively limiting Open Interest (OI) relative to pool size to manage risk, albeit at the cost of capital efficiency.

- Designing fee structures that more accurately reflect the risks each position brings to the protocol, like implementing more aggressive, non-linear funding rates.

A significant aspect yet to be thoroughly explored is the use of asset diversification as a risk management tool. The issue of counterparty exposure concentration is intensified by the high correlation typically observed among crypto-native assets. To illustrate, consider Figure 1, which shows contrasting correlation matrices between the top five non-stablecoin crypto pairs and a mix of forex and commodity pairs.

Both basic intuition and Modern Portfolio Theory (MPT) suggest that combining a mix of uncorrelated and negatively correlated assets could reduce the overall risk per unit of return, especially when compared to a portfolio of highly correlated assets. This is under the assumption that Open Interest is similarly skewed (either long or short) across all assets. Our risk-scoring system incorporates widely used MPT formulas to quantify risk.

The following sections aim to investigate how asset diversification, including through forex, commodities, and other traditional asset classes beyond crypto-native assets, can enhance risk management in these perpetual AMM models. We introduce a novel scoring mechanism to quantify a pool’s total counterparty risk at any given time. Given the complexity of assessing combined risk in a multi-asset portfolio, this scoring system condenses various risk dimensions into a single, comprehensive risk score. The core question we address is whether a diverse range of tradeable Real World Assets can substantively improve risk management in these innovative perpetual AMM models.

2. Analysis: Theoretical Framework

2.1 Model Assumptions

Defining the scope and assumptions of our analysis

The specific risk we’re interested in evaluating in this context is that of trader counterparty risk; namely the net risk taken on by the pool that acts as a counterparty to traders and enables the trading engine’s asynchronous order matching. It’s worth noting that the specific nature and risks taken on by this counterparty pool vary depending on protocol implementation. The Ostium Protocol, for instance, features a “liquidity cushion” that accrues liquidation rewards over time and acts as first settlement of trader PnL, reducing the volatility in value of the liquidity pool. Other protocols, as discussed previously, choose to split liquidity into multiple pools rather than a single one.

For the purposes of this analysis, however, we’ll model the simplest implementation of this system. We assume a single counterparty pool that takes on traders’ net directional exposure at any given point in time (Figure 2).

To make explicit a few more of our terms and assumptions before moving forward:

1. Stablecoin settlement. Settlement only in a dollar-denominated stablecoin. This avoids the additional complexity of accounting for fluctuations in the dollar-denominated value of assets in the Counterparty Pool. If those assets differ from those used as collateral by traders, they may move with or against traded assets, further magnifying or reducing total risk.

2. Static pool and Open Interest caps. We assume pool size is static aside from trade settlement and not subject to fluctuation from depositor behavior (withdrawal/deposit).

3. Fully synthetic trading and oracle pricing. The only asset “changing hands” is a dollar-denominated stablecoin. All price exposure is denominated in dollars and provided real-time via reliable oracles (no erroneous price reporting).

4. Fee exclusion. Compounding funding and borrowing fees are excluded from our model to avoid further complexity.

5. Notional exposure. All Open Interest “exposure” values are notional. E.g., a 10x long on $100 of collateral (=$1,000 long exposure) and a 5x long on $200 of collateral (=$1,000 long exposure), are treated equivalently in this analysis.

6. Imbalance definition. “Imbalance” refers to the cumulative net imbalance in Open Interest for a given asset. E.g., if an asset’s long exposures total $1,000 and its short exposures total $800, the imbalance is $200 long.

7. Portfolio definition. The term “portfolio” refers to the specific set of assets traded, to which the pool serves as a counterparty and settlement layer.

8. Risk quantification. Risk is defined as any factor that leads to a loss or gain for LPs or traders, as protocols themselves should take no directional opinion on who should “make money.” A protocol’s assumed “objective function” is one of zero PnL, net of fees, for either party. The goal is to minimize variance around this median.

9. Unrealized PnL (uPNL). We quantify risk assuming positions can be closed at any time. The term unrealized PnL to denote positions’ outstanding gains or losses.

2.2 Building Intuition

Why a linear combination of open interest imbalances is insufficient to capture risk.

With that out of the way, let’s begin building intuition for how to go about our stated goal of quantifying counterparty pool risk. While the fairly straightforward Sum of Absolute Imbalances (∑ |B_i|) across assets i might seem like a good place to start, we’ll explain why simple sums of this nature are insufficient to generate a quantitative and interpretable measure of actual risk.

Consider, for instance, a protocol with positions open only on two assets, A and B. If:

- Asset A has an imbalance B_a of 100 USD long, and

- Asset B also has an imbalance B_b of 100 USD long,

One way to determine the risk might be,

But, if

- Assets A and B are perfectly inversely correlated assets (ρ{a,b} = −1),

One asset’s long imbalance should hedge out the other asset’s long imbalance. Following this logic and now factoring correlation into our risk measure, these imbalances cancel each other out:

However, this measure still doesn’t properly capture risk. If:

- A is twice as volatile as B, and

- A moves up 10% in price (uPnL = 10), then

- Given B is inversely correlated with A and is half as volatile,

- B moves down 5% in price (uPnL = -5)

- Resulting in a total uPnL: 10–5 = 5 USD

Compare that to a scenario where A and B are equally volatile — resulting in equal movements in price and no change in uPnL — and it becomes clear that ignoring volatility leads to an inaccurate measurement of risk. A risk score of 0 at time t fails to capture the increased probability of greater future imbalance resulting from differing volatilities.

Thus, any best approximation of risk will need to be more sophisticated than a simple linear combination, simultaneously accounting for imbalance, volatility, and asset correlation.

2.3 Sources of Counterparty Risk

Quantifying and formalizing the sources of counterparty risk in our model.

Let’s start by identifying the main metrics influencing counterparty risk discussed above, i ∈ I = {1, . . . , n} represents the assets in a portfolio:

1. Asset Volatility: degree of variation or fluctuation in the prices of an asset. We measure this using a vector of the standard deviation of returns, computed using historical price data. The dimensions are asset_i per period, or some defined historical data timeframe (1 day, 1 hour, 15 min. . . ):

2. Asset Correlation: degree to which values or returns of two or more assets move in relation to one another. We measure this using a Pearson Correlation Matrix, computed using historical price data. Correlation is dimensional:

3. Asset Imbalances: a snapshot of the set of long and short Open Interest imbalances at time t across assets. We measure this using a vector of asset imbalances, computed by pulling (for real data) or simulating (for experimentation purposes) the set of open interest imbalances for each asset i of n total assets at time t. We denominate this in USD per asset_i:

Figure 3 succinctly summarizes the framing of concepts (Risk, Dimension), information (Metric), and data (Data Source).

Our goal is to develop a single metric, which we’ll term Imbalance Score, that acts as a best approximation of protocol counterparty risk. In general, a good risk score will increase, ceteris paribus, if any of the subcomponents driving risk increase (and the inverse), conditional on this increase not itself canceling out another source of risk (e.g., an increase in the Sum of Absolute Imbalances reducing risk due to perfect inverse correlation between assets).

In summary, the Imbalance Score will be the output of a function that takes as inputs assets’ volatilities, correlations, and imbalances:

In the next section, we’ll combine these inputs to derive a function for the Imbalance Score.

2.4 Deriving the Imbalance Score

Deriving the imbalance score through a step-by-step walk-through of each input to the score and assessing its limitations before introducing additional dimensions.

Factoring in Volatility

Now that we’ve agreed on both the primary sources of risk and concrete ways to measure them individually, let’s look at the first way we can begin combining these sources of risk into a single metric. As discussed above, the correlations and differing volatilities between listed assets mean the true implied risk of any given set of imbalances differs from the simplest linear combination.

This leads us to the concept of Imbalance Implied Risk (IIR). This metric not only considers the imbalance amount at time t for a given asset, but also considers the asset’s volatility by multiplying this imbalance by the historical standard deviation of daily returns:

Each IIR value represents the expected dollar return for the next period if a one Standard Deviation event occurs. It quantifies the risk of a given imbalance for a given asset. An asset’s imbalance is riskier if it carries a larger IIR.

Why do we need this metric? Put simply, even if two assets have the same imbalance today, if the probability of a large price move for asset A exceeds that of a move in asset B, that future risk should be priced into any quantitative measure of risk at time t. Multiplying an asset’s imbalance by its volatility scales the value of that imbalance to a standardized value. This allows us to compare the risk of a given imbalance (e.g. 100 USD) for different assets (e.g., Gold vs. Oil).

IIR data at time t for each asset can be stored in a vector, which we’ll call K. K_i is the i’th asset’s IIR:

There are plenty of different ways we could aggregate the components of K, but we chose to use the Euclidian Norm (vector length). This scalar value stands for Cumulative Imbalance Implied Risk, and measures the cumulative risk that does not account for correlation between traded assets:

Factoring in Correlation

To address this limitation, we reintroduce R below, the asset correlation matrix presented briefly in section 3.2. If we multiply this n · n Pearson correlation matrix of asset i by j it will introduce an additional dimension — correlation — to enhance the metric, providing a more comprehensive measure of counterparty risk.

The problem with the resulting value is that it is of the wrong dimension. Multiplying this result by the Transpose of K, however, solves this issue:

There’s one last problem with this result: the resulting units are in (USD^2 / day^2),and they should be the same as ||K||, meaning in (USD / day). Thus:

We’ve now formally derived the Imbalance Score (IS), the core metric of our risk assessment in this research article, which captures the risk of a set of imbalances in Open Interest at time t:

Subscribe to Ostium Labs

Receive the latest updates directly to your inbox

Your subscription could not be saved. Please try again.
Your subscription has been successful.
3.5 Comparison to Modern Portfolio Theory

Outlining the ways in which the Imbalance Score is analogous to Portfolio Return Variance.

The structure of the Imbalance Score bears many similarities to Modern Portfolio Theory (MPT), which we’ll discuss in this section.

In MPT, the Portfolio Return Variance (PRV) is a measure of the total risk of a portfolio. Similar to the IS, a larger value represents a larger risk.

The PRV formula takes into account the individual variances of each asset in the portfolio, as well as the covariances between pairs of assets:

For comparison, we’ll expand the squared Imbalance Score below:

The Portfolio Return Variance (PRV) and Imbalance Score (IS) are analogous. Both represent:

- Risk from asset exposure: term on the left side of “+” in IS & PRV equations

- Risk from correlation: term on the right side of “+” in IS & PRV equations

To prove both metrics are related, let’s consider,

Where B∗ represents the Sum of Absolute Imbalances across a portfolio. A measure of the weight of any individual imbalance, relative to the sum of imbalances in a portfolio, would be:

The above formula is a representation of portfolio asset weights, as they would be used in Modern Portfolio Theory, adapted to the features of our protocol: the “weight” of an asset is its imbalance relative to the total imbalances. Substituting the w_i in PRV for the above,

We can precisely see how the Imbalance Score is analogous to PRV, adapted to our use case. More specifically, the IS goes beyond the PRV in that it accounts not only for the relative weight of imbalances as PRV does, but also for the overall magnitude of these imbalances.

To conclude: the Imbalance Score is derived from and closely mirrors the makeup and structure of MPT’s Portfolio Return Variance to suit our specific use case of quantifying counterparty risk in pool-based perpetual AMMs.

3. Validation and Simulation

Simulating Crypto and RWA portfolio behavior and comparing their resulting risk profiles using the Imbalance Score.

In the following section, we’ll run simulations to demonstrate that for a given set of imbalances, a diversified Real World Asset-containing portfolio with lower inter-asset correlation consistently yields lower risk.

We begin by simulating imbalances and showing the impact on the Imbalance Score for different portfolios, without factoring out the impacts of volatility or correlation. Secondly, we narrow our focus, standardizing for volatility and imbalance, and plotting results on a dispersion chart to illustrate the specific impact of including less-correlated Real World Assets in a perpetual AMM portfolio to reduce overall risk.

3.1 Data Specifications

The following simulations use crypto and Real World Asset price data with the below specifications:

- Five of the largest-cap, non-stablecoin crypto assets (BTC, ETH, SOL, XRP, BNB), the three most widely traded G10 currencies (EUR/USD, GBP/USD, USD/JPY) and the two most widely traded commodities (XAU, WTI)

- The last 2 years of data (2021–09 → 2023–09)

- Time units of days: the average daily price change was used to compute the period return

Figure 4 shows crypto assets’ greater volatility while Figure 5 shows the higher correlations between crypto than selected Real World Assets.

3.2 Imbalance Score in Action

Next, we outline two scenarios to help build intuition for why the Imbalance Score uniquely captures the risk posed by a given set of assets and imbalances.

Scenario 1

Let’s consider a BTC imbalance of $500 and an ETH imbalance of $200 (both long). Drawing insights from historical data, their standard deviations of daily returns are 0.03 and 0.04, respectively, with a correlation of 0.89.

Let’s start by computing the inputs B, σ, K and R under this scenario.

Calculating the Imbalance Score, we get

Scenario 2

Let’s now consider the same variables as above, but instead, with the imbalance for BTC flipped to -$500 (short skew) and $200 for ETH.

Despite Scenario 2’s lower IS, both scenarios share the same ||K|| (Cumulative Imbalance Implied Risk):

Following intuition, we expect Scenario 2 to carry less risk: BTC’s short imbalance partially hedges ETH’s long imbalance due to BTC and ETH’s positive correlation. Unlike ||K||, which remains the same, the Imbalance Score correctly reflects these differing risks:

- The first scenario’s IS is larger than ||K||, indicating the positive correlation between both long skewed assets increases the counterparty risk,

- The second scenario’s IS is smaller than ||K||, indicating that inversely skewed imbalances mitigate risk.

Further, plotting the total IS against an individual asset’s imbalance allows us to visually grasp our intuition about the optimal set of imbalances to minimize counterparty risk:

For each asset, ceteris paribus — assuming the other asset’s imbalance remains constant — there is an optimal imbalance that hedges the other’s assets imbalance.

3.3 Simulation 1: Imbalance Score Only

We’ll now split these assets into various portfolios for our simulation. Asset characteristics (standard deviation of returns, correlations) are derived from historical data (see above):

- Crypto Portfolio: BTC, ETH, SOL, XRP, BNB

- RWA Portfolio: XAU, WTI, EUR, GBP, JPY

- Crypto+RWA Portfolio: BTC, SOL, WTI, EUR, XAU

Figure 7 shows the frequency of Imbalance Scores generated by simulating asset imbalances over 5,000 iterations for the three portfolios above. The RWA-only and RWA+crypto portfolios both show a lower mean and narrower distribution of Imbalance Scores than the crypto-only portfolio.

While this figure shows a clear pattern of lower global risk, as measured by the Imbalance Score, for portfolios containing RWAs, it fails to standardize both for volatility and imbalance. Crypto’s greater volatility, for instance, by default results in a higher mean and wider distribution of Imbalance Scores. This plot thus fails to display only the specific impact of inter-asset correlation on Imbalance Scores.

3.4 Simulation 2: Standardizing for Imbalance & Volatility

To account for these shortcomings, we’ll instead plot Imbalance Scores against ||K||, the measure of cumulative risk that only factors in imbalance and volatility.

Why? Recall the three inputs to risk mentioned at the start of our analysis: volatility, correlation, and imbalance. To parse out the impact of correlation specifically on risk, we’ll need to plot a metric that captures only volatility and imbalance (||K||) against one that captures all three (IS).

The results from Figure 8 show the imbalances are much further from the central line for the same ||K|| in the crypto portfolio, representing greater IS variability.

The central black line represents the IS as a function of ||K|| where all portfolio assets would be independent. If a dot is above the central line, the total cross-asset correlation for that specific imbalance increases the IS. The inverse is also true.

The crypto portfolio’s R^2 of 0.616, compared to the latter two portfolio’s R^2 of 0.970 and 0.956 provide further quantitative validation of our previous statement. Values closer to 1 indicate a lower variability in IS for the same ||K||. Adding Real World Assets to a crypto-only pool-based perpetual AMM portfolio reduces total risk.

Ultimately, both simulations yield the same conclusion. A crypto-only portfolio systematically carries more risk, whether or not results are standardized. Adding Real World Assets to crypto-only portfolios yields a lower IS variability, and thus a lower risk.

4. Conclusion

In conclusion, this study provides an in-depth exploration of risk management in multi-asset, pool-based perpetual AMMs, emphasizing the benefits of integrating Real World Assets. By developing the Imbalance Score, we offer a new perspective on quantifying and managing risks in these complex systems. We compare counterparty risks across various protocols and investigate the impact of incorporating a range of RWAs with historically low or negative correlation on enhancing risk management. Our simulations and data analysis reveal that the inclusion of RWAs can significantly mitigate risk, reducing both the mean and variance in Imbalance Scores, and underscoring the value of synthetic RWAs in diversifying and stabilizing AMM portfolios. This research contributes to a deeper understanding of risk dynamics in perpetual AMMs and highlights the potential of RWAs to contribute to DeFi’s evolution.

Read our original post, published on our Medium blog Jan 1st, 2024, here.

More from Ostium Labs

Oct 19, 2021
5min read
A short title that engages our visitors
Quis neque, eu et ipsum amet, vel et. Varius integer enim pellentesque ornare pharetra faucibs arcu. Mauris blandit egestas nibh.
Oct 19, 2021
5min read
A short title that engages our visitors
Quis neque, eu et ipsum amet, vel et. Varius integer enim pellentesque ornare pharetra faucibs arcu. Mauris blandit egestas nibh.
Oct 19, 2021
5min read
A short title that engages our visitors
Quis neque, eu et ipsum amet, vel et. Varius integer enim pellentesque ornare pharetra faucibs arcu. Mauris blandit egestas nibh.