Omer Goldberg
Omer Goldberg

dYdX Risk Parameter Recommendation Portal

Cover Image for dYdX Risk Parameter Recommendation Portal
  1. Background
  2. Introduction
  3. Platform Overview
  4. Market-Specific Parameter Recommendations
  5. Margin Risk Parameter Recommendations
    1. Order Book Liquidity Visualization
  6. Objective Order Book Liquidity Metrics
    1. Algorithmic Framework
  7. Conclusion
    1. Previous Chaos Labs dYdX Contributions
    2. Previous Considered.Finance dYdX Contributions


Chaos Labs and are excited to present our collaboration, the dYdX Risk Parameter Recommendation Portal. This dashboard provides real-time parameter recommendations informed by market liquidity and objective order book liquidity measures.

As risk contributors within dYdX, and the broader DeFi ecosystem, Considered.Finance and Chaos Labs continuously explore mechanism design, economic security frameworks, and market risk requisites for the creation of truly decentralized protocols.

The dYdX Risk Parameter Recommendation Portal implements the framework proposed by Considered.Finance in Proactive Risk Management of dYdX Risk Parameters. This empowers anyone in the community to monitor the margin risk parameters in a decentralized way.


Well-calibrated margin risk parameters serve a dual function. They shield the dYdX protocol from bad debt brought about by market volatility or malicious actors while minimally constraining standard trading activity.

The dYdX Parameter Recommendation Portal offers a transparent way to suggest optimal parameter levels as well as all inputs informing them.

In particular, the individual market order book metrics offer the community a benchmark for liquidity on the exchange that can be utilized broadly in DAO decision-making processes. Recent discussions concerning the appropriate sizing of rewards underscore how the community could use this data point.

This system is currently configured to evaluate trading conditions in dYdX v3 when informing parameter recommendations. The underlying data and algorithms are adaptable and robust and can be easily modified for use in v4 in most risk parameter frameworks.

Under v3 governance, dYdX Trading Inc. manages these parameters with the exception of maintenanceMarginFraction. The benefit of this portal ahead of v4 is the order book data underlying the model. This data will help the DAO manage parameters in v4 initially, as it is reasonable to assume market makers migrate their liquidity.

In the meantime, it provides an objective measure of liquidity in each market. The distribution sampling captures both the depth and consistency of liquidity. Debates around rewards and any other changes now have a data point to refer to.

On the homepage of the dYdX Parameter Recommendations Portal, users can access high-level recommendations tailored to specific markets. For a comprehensive understanding of the methodology behind these recommendations, users can click the "Discover Methodology" button, which will redirect them to the Considered.Finance research paper titled "Proactive Management of dYdX Risk Parameters," providing a thorough exploration of the methodology.

Platform Overview

The platform leverages real-time dYdX order book data at its core, recording historical data and creating an extensive observation history. Historical data is the foundation for computing recommended baseline and maximum position sizes, with the incremental position size derived accordingly.

This process provides a sound basis to protect all stakeholders through consistent application across markets. In essence, traders will only be limited from opening positions that run an intolerable risk of not being able to be liquidated in stressed market conditions.

Calibrating margin parameters according to order book liquidity also plays a role in keeping perpetual prices in line with their underlying indexes.

Market-Specific Parameter Recommendations

Members of the community have the capacity to peruse data specific to each market by selecting the desired market row. This user-friendly feature ensures accessibility and transparency of information, contributing to informed decision-making within the ecosystem.

Members of the community have the capacity to peruse data specific to each market by selecting the desired market row. This user-friendly feature ensures accessibility and transparency of information, contributing to informed decision-making within the ecosystem.

Clicking into a market opens the Market Detail view, which displays parameter recommendations that are specific to a market. The Chaos Labs data infrastructure ingests real-time dYdX order book data and stores long-term observations. A rolling period of this history is then used to compute recommended baselinePositionSize and maximumPositionSize values from which the incrementalPositionSize is inferred, based on research and algorithm by Considered.Finance.

Margin Risk Parameter Recommendations

The Parameter Change data visualization shows Maximum Allowable Leverage at different position sizes. The blue line shows recommendations driven by market liquidity, while the orange line mirrors the present market configuration. Notably, the Market specific Portal Recommendation, depicted in blue, exhibits a steeper downward slope as a function of position size, indicating a more restricted availability of market liquidity. This allows traders room to trade higher leverage up to around 1800 ETH in this case while protecting the exchange from overstressing the order book in the long tail.

Order Book Liquidity Visualization

Current and historical order book data are used to propose the most efficient configurations for each market.

Displaying a real-time, market-specific order book snapshot, comprehensively depicting the current state of buy and sell orders.

Objective Order Book Liquidity Metrics

There is no precise, objective measure of liquidity on an order book exchange as there is on an AMM. This portal overcomes that by showing the observed liquidity at a range of depths. To overcome the issue of liquidity fluctuations through time, different percentiles are shown. This shows how consistent liquidity is in different markets, which can form the basis of many functional analyses.

Algorithmic Framework

For transparency, the algorithm recommending margin risk parameters works as follows:

0. Sample order book liquidity in each live market within the following spreads: 20bps, 40bps, and 100bps. Sampling should occur at regular timeframes (preferably every 15 or 30 minutes for optimal insight into overall market conditions such as traditional finance data releases. Sampling granularity can be adjusted based on practical constraints). Liquidity within a specific spread is defined as:

  1. Designate a sample length for computation (initially set at three months, considering these parameters should be relatively stable, and given the reliance on the distribution tail, recommendations to decrease will promptly surface).
  2. Compute and project distribution statistics onto the dashboard, thereby objectively representing the market-observed liquidity on the market detail page utilizing the established sample length.
  3. Determine the risk parameters based on each level's 99th percentile of least observed liquidity. The baselinePositionSize should be the 99th percentile at 20bps in the ETH and BTC markets and the 99th percentile at 40bps in the remaining markets, excluding UMA and SNX. UMA and SNX should be set at 1/6th of the 99th percentile at 100bps as the liquidity distribution in these markets has unique characteristics; they should also have double the initialMarginFraction and maintenanceMarginFraction.
  4. Define the maximumPositionSize as six times the baselinePositionSize across all markets.

This is the first step in optimizing these parameters. In v4, there could be dYdX protocol-level risk framework changes, such as maintenanceMarginFactor scaling with position size as initialMarginFactor currently does. These and further refinements will be the focus of future iterations of this framework.


The dYdX parameter recommendation portal represents the first step in our collaborative contribution to the decentralization of dYdX. Our shared commitment towards growing a financial system that is both decentralized, economically secure, and optimally functional. Chaos Labs and Considered.Finance, through the dYdX Grants program, are continuing to advance and support the development of the dYdX protocol. Chaos Labs is actively researching mechanism design for V4 Permissionless Market Listings, while Considered.Finance is focusing on Funding Rate Bounding research. We look forward to continuing to dive deep into optimizing mechanism design and economic risk security frameworks.

Our research initiatives aim to highlight transparency, encourage data-informed decision-making, and seek to formalize the understanding and measurement of liquidity in the dYdX ecosystem.

We actively encourage and value the community's feedback or ideas. If there are any thoughts, suggestions, or insights regarding other potential areas of risk research, optimization, or mechanism design that could have a substantial impact, we are happy to dive deeper. We firmly believe in the power of collaboration and are excited for what comes next for dYdX as we march towards V4.

Previous Chaos Labs dYdX Contributions

Previous Considered.Finance dYdX Contributions