Price risk done right

Concordia’s approach to price risk

Concordia Systems
Published in
20 min readAug 6, 2023

--

Concordia is a risk and collateral management platform for digital brokerages. It extends credit to its members, while preventing their risk of default by ensuring they maintain sufficient margin. As with every risk engine, the balance to strike is between efficiency (cheap margin, more credit) and security (low default risk, efficient liquidations). Borrowers want inexpensive leverage. Lenders want to be confident they can recover their deposits. The goal is to find the right balance.

Concordia’s risk engine prevents default risk for open positions by taking into account the composition of the entire portfolio that holds these positions. Risk is adjusted per portfolio, rather than merely per isolated position. This method is in line with conventional high-volume central counterparty clearing houses that accommodate a wide diversity of instrument types (such as CME’s SPAN methodology).

The process is to scale and normalize individual assets & liabilities by their historical returns, observe the historical P&L for the concrete portofolio made out of these assets & liabilities, and compute the value-at-risk (VaR) for by identifying worst case scenarios.

This article mainly focuses on the calculation of price risk — other components of the risk model (such as concentration, correlation, and event risk) will be saved for later treatments.

In what follows, we will build up to Concordia’s price risk methodology from basic principles. This article will assume some familiarity with quantitative risk analysis, but will also take time to explain basic things first. For the experts or impatient, have a look at the equations & simulation here.

Background glossary

A portfolio is a set of collaterals and liabilities. A collateral is a basket of goods that could be sold into a market. In our case, even assets that are derivative (like options) or illiquid (like invoices) can count as eligible collateral. For an asset to be a collateral, at bottom the only requirement is that it has a potential buyer at a fair market price.

Borrowers are entities that demand money, lenders are entities that supply it. Lenders will let their assets go to a borrower with the expectation of receiving repayment plus interest. The reward of interest payment is balanced by the risk that the borrower defaults and never repays in full. On the other side, the borrower wants money in order to make a particular trade. A borrower is often pursuing leverage, a hedge, or some complex combination thereof.

The act of pledging collateral grants credit to the borrower. An intermediary (such as a clearing house) takes custody of the collateral in exchange for giving its owner the power to borrow. If they choose to exercise this power to borrow, their collateral must be sufficient to cover the debt. The escrowed collateral exists to force a repayment if the borrower’s portfolio becomes too risky. The intermediary can sell off the collateral in order to repay the borrower’s debts to its lenders.

The value of collateral in excess of the value of debt is called equity. If a portfolio has positive equity, then it has more collateral than debt. At zero equity, if all of the collateral could be sold off, the owner of the portfolio would just barely be able to cover their debt. When there is negative equity, the portfolio is underwater: if the borrower fails to make repayment or post additional collateral, and the entire balance of pledged collateral gets liquidated, then some debt would still remain unpaid. In this unfortunate situation, the borrower has defaulted and the lenders will not get their full money back. The risk of default is precisely what Concordia mitigates.

Portfolio risk

Our risk model’s job is to decide whether a pot of collateral will cover a given sum of obligations. If your claimants demanded repayment, and you sold off the value in the portfolio, could you repay in full? Though this question is simple, it becomes complicated to answer in practice.

There are a number of ways portfolios can sour, including:

  • Your pledged collateral loses market value. Yesterday it could cover your loans, but not today.
  • The value of your debt increases. This is the main danger with “shorting”: you bet on a price going down, but it moves against you. Now you have to pay back more than the initial value of your loan.
  • The markets dry up, and even if your collateral still fetches the same price, it can not fetch that price at size. If you need to liquidate more collateral than there are buyers, the act of selling collateral to pay debt can send the value of your collateral south, accelerating a spiral.

To account for the value-at-risk in a portfolio, clearing houses require an amount of margin to be present — an extra buffer in the portfolio that can sponge up stress. The value of collateral must be greater than the value of all claims by some healthy margin. How do you measure whether margin is healthy?

This measurement centers on time.

The amount of required margin must be sufficient to give people time to rebalance their portfolios once they begin sliding toward insolvency. Time is important to consider, because assets not only have a rate of change but a rate of daily trading volume. If every transaction were instantaneous, and every market infinitely liquid, then in that sci-fi world you could react with mathematical perfection to every minor fluctuation in price. But the real world has friction & finite resources. It takes time to sell, and it especially takes time to know when to sell. And so there is always a requirement for extra idle equity in a portfolio.

This required extra idle equity — the value of collateral in excess of the value of liabilities — is the maintenance margin in a portfolio. And it is equivalent to the quantity of risk in a portfolio. One way to quantify the “value at risk” in portfolio is ask: in the worst case scenario how much equity could evaporate over a certain time horizon (for example, 24 hours)? If we expect people to be able to react & rebalance with 1 day of grace, can this portfolio withstand a beating while it waits to be shored up? The VaR is the depreciation from the worst case scenario we can reasonably expect in given time horizon.

Value-at-risk

The future tends to resemble the past. This the main assumption of “value-at-risk” theory. You should learn from history, because you are doomed to repeat it. If an instrument exhibited volatility in its recent history, it will probably continue to be volatile tomorrow.

This search for the “worst case scenario” is what gives us a clue for how to quantify risk in a portfolio. Let’s ask ourselves: would Tesla stock or the euro make for a safer collateral? To answer that, the first thing you would look for is how these two assets have performed as of late. Which is to say: you want to measure how volatile their returns have been. “Volatility” is a statistical quantification of the amount of change, positive or negative, over an interval of time. If a price stays flat, or goes in a straight line in any direction, then it has little to no volatility, since every day is the same as before. But the more jitter and uncertainty about which way the price will move, the higher the calculated volatility.

Uncertainty is the key phenomenon. Compared to the euro, Tesla’s stock is severely volatile, with its price is up one day and down the next. If you were to lend me $100, you would feel much better about $105 euros as collateral than the equivalent amount TSLA. The issue here is that it is extremely unlikely for the euro to drop 5% suddenly, but TSLA is known to move that much after Elon Musk makes a 280-character tweet.

The measurement of volatility indicates how risky a collateral is. It points to the degree of uncertainty we have about its future price, and hence how much value we could reasonably expect it to lose. The quantity of risk attributed to a collateral puts us on the path of defining how much extra margin value a portfolio should have. If you are going to lend me $100, you might be content with $105 of euros as collateral, but ask for a pledge of at least $125 of TSLA.

The difference between the borrow power you get from pledging TSLA versus the euro can be thought of as a haircut on the value of your collaterals. Dollar for dollar, euros will tend to grant you more borrow-power than TSLA. Hence, TSLA has a steeper haircut. If $125 of TSLA lets you borrow $100 of US dollars, then we can say that there is a 20% haircut on the value of TSLA. You can only borrow 80-cents on the dollar.

Early products that service on-chain borrowing & lending take an approach similar to this. Aave, Compound, and their many copycats all follow this one basic method: they list out a handful of eligible collaterals, and give each one a haircut. The margin requirement for a portfolio is simply the inverse of this haircut. Suppose Bitcoin has a 20% haircut. That means $100 BTC will give you $80 of borrow-power, since the margin requirement (or risk) is $20. Finally, with these protocols, if you have a blended pot of collateral, just apply the specific haircut to each collateral, and you know how much equity must be maintained in your portfolio.

Concordia’s holistic model

But the story only begins with collateral. And this is where Concordia’s risk engine departs from nearly every other risk model one can find among on-chain collateral managers.

A portfolio is made of collaterals and liabilities. The risk of default is not only a matter of collateral volatility, but also liabilities. The problem is that Aave, Compound, and their ilk focus only on collateral. They ignore the volatility of debt entirely.

Consider two portfolios:

  1. Euro collateral, bitcoin debt
  2. Euro collateral, dollar debt

Collateralizing euros to borrow bitcoin is a very different scenario from collateralizing the same euros to borrow dollars. A euro should stretch much farther as a collateral for dollar debt than as a collateral for bitcoin debt, simply because bitcoin is much more volatile (relative to the euro and dollar). It is less likely that the same fistful of euros will cover a debt of bitcoin than a debt of dollars. Therefore it is safer to borrow dollars on the back of euros, than borrow bitcoin. Euros should receive a different haircut as collateral depending on which debts they secure.

Remember that a risk model’s job is to determine whether we can expect a given set of collateral to cover a given set of liabilities. Since the value of the debt is also volatile, our work is not done where Compound & Aave leave off. The entire portfolio must be taken into account.

Our focus should be on the performance of the concrete portfolio with its exact composition of collaterals and liabilities. Rather than measure the changing value of collaterals, we wish to measure the changing value of the whole portfolio. A portfolio that is likely to profit is less risky than one that is likely to lose.

To predict the future, learn from the past

The calculation of required margin is a calculation of a reasonable worst case scenario for a portfolio. There should be a buffer of equity in the portfolio that can absorb a bad day of losses. To find this value, one observes the historical performance of a portfolio, and measures the worst day of losses. It is reasonable to expect that the future will look like the past, and so if we require a portfolio to have enough value to accommodate a bad day in its history, this portfolio should likely survive a shock in the future.

For example, this portfolio collateralized USDC to borrow ETH. On a fateful day in March, USDC depreciated suddenly by 10%. This loss is an extreme outlier in the history of the portfolio’s performance — it lost more on that day than on any other. If the portfolio had enough equity to cover that loss (which is true in this case), then the portfolio would not have gone underwater.

The equity of a portfolio that borrows ETH with USDC as collateral. There was a large loss in mid-March due to a sudden depreciation of USDC. Black: equity. Red: daily losses.

The procedure to compute price risk is as follows: given a specific composition of a portfolio, comb through its historical performance (say, a statistically significant 200 days), searching for the most extreme day of losses. Or, if you want to ignore the extreme long tail (which may be a very rare black swan), find the 99% worst day. The losses on that day — the 99% worst day in all the observed history — is a good baseline for your required margin. It is the value-at-risk: the most a portfolio can expect to lose in a given time period with a given confidence interval. If the future mirrors the past, then statistically speaking this should give you something in the vicinity of 99% confidence that this margin will be sufficient to cover future losses.

Concordia’s risk engine is oriented toward the historical performance of the whole portfolio. Different portfolios will have different margin requirements, depending on their specific composition. And these requirements will change as the underlying assets themselves perform differently. If an asset that was stable suddenly becomes volatile, and a portfolio’s history of losses has a new outlier, then the margin requirements would increase accordingly.

Quantifying memory: forgetting & forgiving

They say the secret to a happy marriage is a short memory. Events in the distant past do matter — but they matter much less than recent ones. This principle holds true when quantifying risk.

When calculating the volatility of a given instrument, there are two parameters that affect the relative importance of the present over the past:

  1. How quickly does the effect of history decay when calculating volatility?
  2. What weight do we give to extreme historical outliers when making predictions about the future?

These two parameters help condition how responsive Concordia’s risk engine is to recent changes relative to the distant past.

When calculating volatility, the price movement is compared against its past, which gives a measure of how much the price has changed. But how much has it changed relative to its distant past? The effect of the past on the present calculation decays with time. Distant changes have diminishing effectiveness on recent calculations. Lowering the decay coefficient creates a rolling volatility series that is smoother or less sensitive to daily fluctuations. Increasing the time decay coefficient makes the volatility series more “forgetful” of the past, and more focused on a narrow band of recent history.

Rolling exponentially-weighted volatility for a series of returns r

The time decay factor λ (0 < λ< 1) assigns relative weight to the current change against the previous change. Below are various values for λ and the computed rolling volatility for bitcoin. Notice that a high λ is smoother than a low, as it assigns heavier weight to history and is thus less responsive to current changes.

Volatility of BTC with various values for lambda. Notice how a lower lambda forgets faster than a higher.

What should this value for λ be? Different kinds of instruments will have different values. For example, “stablecoins” usually have very small daily changes in their returns — except for those rare black swan events driven by news or catastrophe where they wobble suddenly. These wobbles are expected to be the exception, not the norm, and the instruments level back out. In this case, it is rational for the volatility calculation to be “forgetful” about historical volatility. Once recent volatilities simmer down, the exceptional events in the past can be safely ignored. The same is not true for an instrument that is expected to be volatile, like TSLA or bitcoin. If there was a wild swing in the recent past, we should expect to see a wild swing in the near future. In this case, the rolling volatility calculation should not forget these changes too quickly.

While volatility calculations take an aggregate view of the instrument’s history, we should also be cognizant of the possibility of extreme swings, however infrequent they may occur.

Every asset is bound to have a bad day from time to time. Or the reverse: its price could boom suddenly, without precedent. These outlier events are forever going to be a part of its history. But how much should the system remember these one-off outliers? Should a bad day 3 years ago have a bearing on the risk we assign in the present day?

Those exceptionally intense episodes in the past should have some bearing on the calculation of volatility we make in the present. The degree to which they affect the current volatility calculation is scaled by a second parameter α (0 < α < 1). A low α means the system is more “forgiving” of past transgressions. A high α means the system is less willing to forget — if an asset once made a nosedive, the risk engine will henceforth be circumspect toward it, assigning a higher amount of risk.

The current volatility V_T is compared to historical outlier stress scenario S_stress with weight α

One again, take for example the stablecoin USDC. It was famously rock-solid at $1, until one bad weekend when it wasn’t. On some bad news and market fear, its price dropped approximately 10% to $0.90. After some time, it stabilized back to $1, making the dip seem like a bizarre nightmare from which the asset awoke and never returned.

USDC price

How forgiving should the risk engine be of this dip? If the system is not forgiving, USDC will have a hard time living down the reputation for having had an exceptionally volatile day. The risk engine can decide: it burned us once, and so it will forevermore be risky. Or, the risk engine can choose to “move on” and forgive that dip. After some time, the risk engine can choose to ignore the historical stress scenario in favor of more recent behavior.

One property at stake here is the capital efficiency of USDC as a collateral: how much borrow-power does it provide? If the risk engine forgives the stress event, then USDC can return to being a very efficient collateral; if the risk engine continues to count the stress event against USDC (under the belief that the stress could happen again), then USDC remains severely downgraded.

Below is a depiction of the changing margin requirements for 1 USDC with different values for α. For moste of USDC’s history, the difference in alpha is not noticeable, since the outlier stress for USDC is so low relative to daily performance. But in early March, USDC experienced an unexpected 10% movement. The red line shows a much less forgiving model, which remembers the stressful day and counts it against USDC’s risk rating. The blue line is more forgiving, and gives less weight to the past stressful event.

These two series are the daily margin requirements calculated for $1 of USDC. The red line uses a greater α value than blue. It gives more weight to outlier stress in the past.

The weight of outlier historical stress on present volatility calculations is a parameter that gets tuned per asset. Much like λ with regards to tuning volatility, this α parameter has different fits for different kinds of assets. Assets that move rarely & severely on unexpected news or fear are different from those for which a sudden drop & rebound is routine.

Normalizing instruments

Concordia takes the whole portfolio into account when calculating risk, but must first preprocess each asset individually. Volatility and stress is relative to the peculiarities of each asset, and if a risk engine just observed the volatility of the profit & loss in an entire portfolio, it would gloss over information that gets lost when adding everything up. How severe is it if a portfolio lost 5% in value in a day? If its collateral were predominantly euros, that is a much different scenario than if it were made up of TSLA or Dogecoin. A 5% daily change in the euro is far more significant than a 5% drop in TSLA.

Concordia preprocesses the returns for each instrument in a portfolio in order to normalize their volatilities. A bad day for bitcoin looks different than a bad day for USDC, and the system should react differently to 1% price swing in either.

The method for normalizing volatility is to first strip out the volatility from the historical instruments, and then re-scale the volatility to a value that is determined through the methods in the previous section. The history of daily returns for each asset gets run through a preprocessor that scales the returns according to asset-specific parameters lambda and alpha (see above). After this normalization process, the history of returns will reflect the time-decay of our volatility calculation, as well as the weight of outlier stress events.

Here are box-and-whisker plots showing the distribution of returns for a 90-day history of bitcoin normalized according to various values of alpha and lambda. Notice that high alphas have a markedly high impact on the spread of returns.

Alpha 0.1, lambda 0.8
alpha 0.1, lambda 0.97
alpha 0.5, lambda 0.97

Using these scaled returns for each asset, we can now collect a history of profit-and-loss for the entire portfolio which reflects a balanced approach to recent changes versus historical stress. In comparison, a “naive” approach to profit-and-loss that did not preprocess volatilities would not place relative weight on recent history over ancient history.

Backtesting

The value-at-risk in a portfolio is the expected worst-case loss for a given time horizon and a given confidence level. If the risk engine uses a daily interval to calculate the risk to be $100 with a confidence level of 99%, then that means we should expect to see the loss of this portfolio to exceed $100 for 1 out of every 100 days. We can test this.

By running through history, one can compare the calculation of value-at-risk against the actual profit-and-loss for that day. If the actual loss is lower than the required margin, then a portfolio that had at least that amount of margin would have withstood the loss with equity to spare.

Testing that the required margin is sufficient to cover the actual loss on a given day helps set a lower limit for the risk model parameters. We can be confident that a portfolio will have at least enough equity to handle expected worst-case losses. But we also do not want to require too much equity. After all, it would be trivial to require that a portfolio maintain a debt-to-value ratio of 0.001%. The goal is to strike the balance between covering worst-case risk, while also providing an efficient borrowing experience.

What we are faced with is an optimization problem. The quantified risk should cover the worst-case scenarios, but no worse. Tuning the parameters of the risk model is to seek a margin requirement that actually does get breached once in a while. To optimize the parameters for the risk model, Concordia sets various statistical budgets on the model’s performance (e.g. frequency of breaches, clustering of breaches, depth of breaches, variance of margin recalculations), and tunes the parameters according to the budget.

If the risk model is too conservative, then a dollar of collateral is not stretching far enough. Lenders and borrowers meet in the middle here: for 99% of the time the risk model will cover a worst case 24-hour period of losses. Borrowers enjoy a margin requirement that should only fail at the extremes 1% of the time if they fail to take action over 24 hours.

Concordia re-calculates margin daily, and tunes instrument-specific parameters monthly. The routine testing & recalculation gives lenders an auditable sense of the confidence they can place in the risk engine. They can inspect the historical performance and see for themselves whether the model makes good on its promises.

Comparison to other risk engines

Most other DeFi protocols follow the same patterns as Aave & Compound: every collateral is assigned a haircut, and this haircut is equal to the amount of required margin in a portfolio. They take no account about the specific debts, nor do they consider the performance of the concrete portfolio holistically.

Let’s look at a comparison between Aave’s and Concordia’s risk model when computing the margin required for collateralizing USDC to borrow bitcoin. In the following chart, the portfolio constructed has 40,000 USDC deposited as collateral to cover a debt of 1 bitcoin. Aave’s and Concordia’s margin requirements get recalculated every day, with Aave’s represented by the orange line and Concordia’s by the blue line. The red line represents the loss the portfolio experienced on that day (a height of 0 in the red line means that there was a profit). If the red line (loss) exceeds the margin requirement, then the portfolio would have become insolvent if it started the day with the minimum amount of margin.

A few things jump right out. Aave’s calculation of risk is quite steady. The steadiness is due to the fact that USDC is the only collateral, and Aave’s risk model is based merely on the value of collaterals.

Well, Aave’s model’s risk engine was steady except for a small window in March. That was during a few days where USDC dipped in value approximately 10%.

But when USDC dipped, Concordia & Aave diverged. In the face of USDC volatility, Aave required less margin! This is simply because Aave’s risk calculation is a function of the value of the collateral — if the collateral goes down, so does the dollar amount of equity that must be in a portfolio. Opposite of this strange reaction, Concordia behaves appropriately, and increases the amount of calculated risk in the portfolio, resulting in an increase in required margin.

Another point worth highlighting is how much more margin Aave requires beyond Concordia. In some scenarios, Aave requires almost 10x as much equity in a portfolio — this is an enormous gulf in capital efficiency. And yet, by testing the performance of the actual portfolio against the margin requirements, it is plain to see that Aave’s model is far too conservative.

Now overlay this simulation with the actual equity in the portfolio that collateralizes 40,000 USDC in order to borrow 1 BTC. The equity is depicted as the black line.

In April, Aave would have liquidated this portfolio. It breached the margin requirement. But Concordia’s risk engine would have continued to accept the portfolio’s open positions. In either case, the lenders would be secured all throughout April. The issue here comes down to how capital efficient the risk engine can afford to be for the borrowers. Concordia’s data-driven approach comes out a clear winner here.

Flipping things around, here is the scenario where bitcoin is collateralized in order to borrow USDC. This portfolio collateralized 3 BTC in order to borrow 40,000 USDC.

As before:

  • Orange: Aave margin
  • Blue: Concordia margin
  • Red: actual loss for the day

Notice a similar pattern where Concordia and Aave diverge with respect to the direction of change in their margin requirements. There are periods — especially in early November — where Aave’s equity requirement goes down while Concordia adjusts upward. This behavior in Aave is the result of BTC taking a dive in value, which is countered by Concordia with an increase in required margin to accommodate the recent change in volatility.

Here is that same portfolio now with the actual portfolio equity overlaid (the black line).

Through most of Q4, this portfolio would have been judged by Aave to be unhealthy. And yet the actual losses (the red bars) are well beneath Aave’s margin requirement. Once again, Aave is far less efficient than Concordia, but without evident good reason to be. Borrowers can enjoy a much more efficient experience without sacrificing risk to the lenders.

Conclusion

Most — if not all — risk engines that have emerged in the nascent digital asset sector have unfortunately started on the wrong foot. They set haircuts on independent collaterals, rather than on concrete portfolios. The result is that these models are not sensitive to the different potential losses of actual portfolios, and so generally over-compensate with inefficient margin requirements. As shown above, when comparing Concordia’s risk model to Aave’s in relation to actual daily P&L of a portfolio, Aave requires more margin than necessary in most cases. Secondly — but perhaps more importantly — Aave’s model is ignorant to the volatility of the liabilities in a portfolio, which are just as important as the collaterals.

By quantifying risk for the portfolio as a whole, Concordia’s risk service is able to tune the margin requirements to the theoretical maximum efficiency. With empirical back-testing & stress-testing, lenders can know with statistical confidence that their deposits are safely secured by sufficient collateral.

--

--