CVEX Docs
WebsiteAffiliate DashboardTestnet
  • Website
  • Trading Terminal
  • Introduction
    • CVEX Overview
    • Component Breakdown and Definitions
    • Use Cases and Applications for Futures and Options
  • Background
    • The State of Cryptocurrency Trading and Problems Faced
    • Perpetual Contracts and Their Limitations
    • Options Trading in Crypto Markets
    • Conclusion
  • Protocol
    • Overview
    • Protocol Owner
    • Platforms
    • Price & Risk Oracles
    • Contracts
    • Order Types
    • Positions
    • Range Orders
    • Matching Engine
    • Collateral Token (USDC)
    • Frontends
    • Clearance Bots
    • CVEX Token
    • Fees & Rewards
  • Margin & Liquidations
    • Overview
    • Futures Mark Price
    • Black Scholes Model
    • Implied Volatility Surface
    • Premium Mark Price
    • Options Hedge Ratio
    • Value-at-Risk Model
    • Risk Parameters
    • Initial & Required Margin
    • Liquidation Protocol
    • Default Fund
    • Deleverage Queue
    • Default Prevention
  • Crypto Valley Exchange Platform
    • Overview
      • Case Studies
    • Contracts
    • Margin Model
    • Fees & Rewards
    • Go To Market Strategy
    • Affiliate Marketing
    • Market Makers
    • Brokers & Structured Product Providers
    • Front End & Builder Incentives
    • Price & Risk Oracles
  • Building on CVEX
    • Development Resource
  • Strategy
    • Security measures & Risk Prevention
    • Future Work
    • Legal & Compliance
    • Team and Advisors
    • Conclusion
  • Disclaimer
  • Credits
Powered by GitBook
On this page
  • Risk Parameters
  • Methodology Justification
  1. Margin & Liquidations

Risk Parameters

PreviousValue-at-Risk ModelNextInitial & Required Margin

Last updated 1 year ago

In the CVEX Protocol, Risk Oracles play a pivotal role in regularly reassessing and updating risk parameters associated with the underlying assets of each Platform. These parameters are encapsulated in a symmetric matrix resembling a variance-covariance matrix with list of independent parameters, where the diagonal elements α\alphaα represent the volatility of each underlying asset as per VaR-based risk assessment, the off-diagonal elements β\betaβ denote the correlated volatility between pairs of assets, and independent parameters γ\gammaγ represent the volatility of the contract price, independent from the volatility of underlying asset:

Parameters=[α1β12⋯β1nβ21α2⋯β2n⋮⋮⋱⋮βn1βn2⋯αn],[γ1γ2⋮γm]Parameters = \begin{bmatrix} \alpha_1 & \beta_{12} & \cdots & \beta_{1n} \\ \beta_{21} & \alpha_2 & \cdots & \beta_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ \beta_{n1} & \beta_{n2} & \cdots & \alpha_n \end{bmatrix} , \begin{bmatrix} \gamma_1 \\ \gamma_2 \\ \vdots \\ \gamma_m \end{bmatrix} Parameters=​α1​β21​⋮βn1​​β12​α2​⋮βn2​​⋯⋯⋱⋯​β1n​β2n​⋮αn​​​,​γ1​γ2​⋮γm​​​

This set of parameters allows the protocol and its participants to calculate the worst expected loss over a specified VaR period for any given trader's portfolio. This computation is akin to calculating variation for a linear combination of dependent and independent random variables:

ExpectedLoss=∑i=1nαi2Ni2+∑i=1n−1∑j=i+1nβijNiNj+∑i=1mγi2ni2ExpectedLoss = \sqrt{\sum_{i=1}^{n} \alpha_i^2 N_i^2 + \sum_{i=1}^{n-1}\sum_{j=i+1}^{n} \beta_{ij} N_i N_j + \sum_{i=1}^{m} \gamma_i^2 n_i^2 } ExpectedLoss=i=1∑n​αi2​Ni2​+i=1∑n−1​j=i+1∑n​βij​Ni​Nj​+i=1∑m​γi2​ni2​​

Where nin_ini​ is net exposure of each trader's position, and NiN_iNi​ is combined net exposure of the trader's positions of specific underlying asset, calculated with futures and perpetuals Mark Price PPP, options Delta Hedge Ratio Δ\DeltaΔ, and positions quantity AAA (positive for longs and negative for shorts):

N=∑Pfutures(Afutures+ΔAoptions)+PperpsAperpsN = \sum P_{futures} (A_{futures} + \Delta A_{options}) + P_{perps} A_{perps}N=∑Pfutures​(Afutures​+ΔAoptions​)+Pperps​Aperps​

Risk Parameters

The diagonal parameters, denoted as α\alphaα in the risk matrix, are precisely represented by the VaR estimations for each index:

αa=VaR(A)\alpha_a=VaR(A)αa​=VaR(A)

The introduction of these parameters enables the efficient incorporation of adjustments for perpetual contracts, caused by funding rates. This results in a slight increase in margin requirements compared to normal expiring futures. Additionally, this approach effectively prohibits the possibility of unlimited leverage in sets of positions that are otherwise considered as perfectly hedged.

Methodology Justification

It's important to note that while this methodology borrows the structure of calculations typically associated with the normal distribution, the actual variables and parameters used diverge from this norm. Specifically, all variance parameters are adjusted to the quantile representing the VaR metric, and the assumption that expected position returns follow a normal distribution is not made.

This empirical approach, while not a precise analytical representation, has demonstrated a good approximation for a portfolio's expected loss. The choice of a simpler formula for portfolio evaluation is intentional. Due to frequent recalculations within protocol execution, the formula must be deterministic and reproducible by Clearance Bots and other protocol participants. Therefore, complex calculations requiring numerical methods are avoided in favour of this more straightforward approach.

The justification for this methodology lies in its effectiveness and simplicity. Despite using a formula traditionally associated with normal distribution in a formally incorrect context, the empirical results have been encouraging. This approach provides a balance between computational efficiency and accuracy, crucial for decentralised systems where resource optimisation and deterministic outcomes are paramount. This practical compromise enables the CVEX Protocol to maintain robust risk management while ensuring operational efficiency.

In summary, this illustrates how the CVEX Protocol achieves true on-chain cross-margining.

The off-diagonal parameters, β\betaβ, which capture the correlations between indices, are calculated by Risk Oracles based on the observed VaR of combined portfolios for each pair of assets. For assets AAA and BBB, depending on whether they are positively or negatively correlated, the correlation parameter is determined as follows:

βab=VaR(A)2+VaR(B)2−VaR(A+B)2,ρ(A,B)>0\beta_{ab} = {VaR(A)^2 + VaR(B)^2 -VaR(A+B)^2}, \rho(A, B)> 0βab​=VaR(A)2+VaR(B)2−VaR(A+B)2,ρ(A,B)>0
βab=VaR(A+B)2−VaR(A)2−VaR(B)2,ρ(A,B)<0\beta_{ab} = {VaR(A+B)^2 - VaR(A)^2 - VaR(B)^2} , \rho(A,B)<0βab​=VaR(A+B)2−VaR(A)2−VaR(B)2,ρ(A,B)<0

While the volatility of underlying assets α\alphaα and their correlations β\betaβ are collectively considered for all contract types involving the same assets, the independent (idiosyncratic) volatility of each contract including different expiries of the same derivatives series is assessed separately. These independent parameters γ\gammaγ represent fluctuations in the value of traders' positions that cannot be solely explained by the movements of the underlying assets, and may include factors, such as caused by noise trading.

To calculate γ\gammaγ, Risk Oracles assess the observed difference in volatility between index prices and contract prices. For perpetuals, it also incorporates the expected funding rate, adjusted by VaR time period:

γ=VaR(contract)2−VaR(index)2+r′\gamma = \sqrt {VaR(contract)^2 - VaR(index)^2} + r'γ=VaR(contract)2−VaR(index)2​+r′
Comparison of the model-predicted and actually observed losses for portfolios containing BTC and ETH positions in various combinations. The angle represents the proportion between positions, while the distance from the centre indicates the expected losses. This model is based on the Expected Loss formula utilised in the CVEX Protocol. For two contracts, it involves 8 parameters - 4 alpha and 4 beta parameters, which are represented on the chart by 8 anchor points. The graph effectively demonstrates the model's capability to approximate the dependencies of margin requirements for combined portfolios accurately.
Drawing