dYdX Risk Parameter Recommendation Portal

Background

Considered.Finance and Chaos Labs 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-focused 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.

Introduction

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 on 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.

We believe 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 useful analyses.

Algorithmic Framework

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

  1. 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:

  2. 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).

  3. 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.

  4. 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.

  5. 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.

Conclusion

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 advancing funding rate optimization and mechanism design research. While Chaos Labs is actively researching mechanism design for V4 Permissionless Market Listings, Considered.Finance focuses 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 Considered.Finance Work

Previous Chaos Labs Work

6 Likes

Great work on the above guys!

I think the risk parameter recommendation portal is a great first step in granting the community insight into the current state of affairs whilst also highlighting the ideal state of affairs from a risk management perspective. Naturally, post-V4 we should ideally find a way of tracking the % of liquidity migrated by market makers to V4 so as to assess whether the underlying methodology (primarily based on the historical orderbook as stated in Considered.Finance’s paper on Proactive Risk Management), is still accurate in relation to the recommendations made (I do echo the sentiment that it is reasonable to assume that market makers will indeed migrate liquidity to V4 but this assurance will ensure that the parameter recommendations are still valid and accurate).

I do believe that this is an amazing first step and I look forward to your following research pieces! An potential next step to be discussed would now be to assess the proper method of actually implementing the parameter recommendations that are posed by this new Parameter Recommendation Portal so as to actually put the valuable information it grants (no pun intended) to effect. An idea that could potentially work is to implement a module similar to Lido’s Easy Track Module - wherein Parameter changes based on Risk Parameter recommendations are put through the Easy Track Module with the community being able to vote via veto-mechanisms to such changes (reference https://easytrack.lido.fi/). This objection-based method removes the need to reach a voting threshold and makes necessary changes implementable in a more efficient manner. Naturally, this is a great alternative than snapshot/on-chain voting as those methods are too cumbersome for an area that is highly-iterative in nature due to fluctuating market conditions and trading-pair liquidity. This would also ensure that parameter recommendation implementation is not centralised post-V4 (naturally the community can decide on granting a Risk Management SubDAO the right to make changes in stipulated emergency scenario).

Well done - I look forward to seeing you both deliver further tools and analytics to be used by the dYdX Ecosystem!

1 Like

Hello,

This is an impressive development by Chaos Labs and Considered.Finance.

I’d like to propose that Chaos Labs also please consider developing a similar platform for dYdX to what they did with GMX. It would be greatly beneficial to see real-time updates and filtering for long and short liquidations for each market, down to the minute. Furthermore, providing real-time data on long and short-open interest would be a valuable addition.

Looking forward to future developments and improvements in this area.

Best regards,

Kagan

1 Like

Great project, Chaos Labs and Considered Finance.
How dynamic do you think changes in risk parameters should be? Could they be automatically adjusted in some specific timeframe like, say, the funding rate in V4, or is there no need for that?

1 Like

Thank you @Immutablelawyer , @foxlabs and @RealVovochka , for the feedback and thoughtful insights. We appreciate the positive response to this initial step and are committed to extending the platform and providing additional research and risk tools in the future.

We agree on the importance of tracking the percentage of liquidity migrated by market makers to V4 post-launch. This will help ensure the ongoing accuracy of our risk parameter recommendations, in line with the methodology and any future updates.

We advocate for the establishment of an automated system designed to facilitate parameter modifications. A mechanism grounded in objections could make the governance procedure more efficient and ensure the decentralization of parameter recommendation execution. The concept of “Optimistic” governance might empower us to anticipate and respond swiftly to market fluctuations and adjust risk parameters accordingly. The burden of governance is undeniably a tangible challenge, one that we observe contributing to slower and less effective processes in our engagements with various DAOs. It is without a doubt that this strategy is worth considering, particularly as the dYdX community shapes its governance and subDAO framework while concurrently refining our Parameter Recommendation Portal and supplementary risk management apparatuses. We look forward to offering more insights as we advance toward V4, and we’re eager to share our discoveries as we strive to develop the most streamlined processes collectively.

Our dedication to improvement and innovation in risk and economic security is aimed at maximizing the impact within the dYdX community. The efficacy of decentralization largely hinges on making relevant data accessible to the community, which informs our focus on crafting user-friendly risk tools that prioritize transparency. As you’ve pointed out, the introduction of features such as real-time updates and filters for long and short liquidations and real-time data on long and short-open interest could amplify our offering for dYdX. The V3 APIs pose limitations, complicating the creation of a comprehensive tool with complete visibility. However, V4 is poised to overcome these restrictions by providing complete data visibility like liquidations, orderbooks, cancels, etc., as the protocol will be administered at the validator level, facilitating its monitoring through the indexer. We plan to concentrate our efforts on V4, but we’re open to developing for V3 if deemed valuable by the community. The decision to further invest in V3 will also depend on whether there’s a plan to phase it out immediately or if both versions will coexist for a more prolonged period.

The dynamics of risk parameter alterations should ideally be guided by the underlying market conditions and the overall health of the protocol. While automation of adjustments within specific windows might be feasible, maintaining a delicate balance with the necessity for thorough scrutiny and review is paramount. Of course, the risk levers at our disposal in V4, and the extent of market and protocol customization, will also influence this. Upon the release of V4, we’ll be in a position to develop a more defined methodology and risk framework propositions, given the unveiling of protocol architecture and implementation.

Our ongoing pursuit of innovation is geared towards ensuring that risk parameters accurately reflect the protocol’s needs and the market’s state. As alluded to in an earlier comment above, the concept of automated adjustments, possibly within pre-set ranges or optimistically, could present a promising direction worth further investigation.

1 Like

I’d like to echo @chaoslabs in thanking @Immutablelawyer, @foxlabs and @RealVovochka for their well reasoned feedback.

@Immutablelawyer
100% agree tracking liquidity migrating to v4 is definitely a great use of the orderbook metrics. Making this metric accessible to the community at this stage is intended to help establish an objective benchmark to work from.

As mentioned by @chaoslabs the idea of a limited optimistic governance using a veto module sounds very promising. This could be used to update risk parameters quickly and efficiently. I particularly like this as an implementation for the emergency powers mentioned in the underlying paper.

@RealVovochka asks such a great question. I agree with everything said by @chaoslabs and would like to add some nuance.

There absolutely could be a way to implement a well configured version of this model or a future iteration of it algorithmically, but we must be careful.

To quote the OP, an important aspect of well-functioning risk parameters is:

minimally constraining standard trading activity.

Adhering to this means that traders should not need to be constantly monitoring exchange parameters so the frequency of updates and the rolling interval of data used for updates is extremally important.

The margin risk parameters, as implemented in v3 and this framework control the amount of initial leverage allowed at different trade sizes (and the liq. threshold). If this updated too frequently, like funding rates, user experience could be affected and certain algorithmic strategies might not be possible as allowable trade sizes are unknown upfront.

Ideally in cases like this parameters are set to cover all conditions, but at a well thought out interval for updates. This can ensure that the need to protect against bad debt at all times is balanced with user experience. See below for how much liquidity varies over short time frames:

ETH Liquidity w.i. 40bps over US CPI

Risk management always needs to be sympathetic to traders and use the tools at its disposal to improve the product.

I would expect over time a much wider array of risk mitigants available and for sure some of these could benefit from automation at a variety of time frames.

1 Like