Chainrisk Risk Management Services Proposal for Future Deployments on Compound Finance

Chainrisk Risk Management Services Proposal for Future Deployments on Compound Finance

1. Previous Work with Compound

Chainrisk recently conducted a comprehensive economic audit of Compound V3 on the Arbitrum One Chain as part of the Compound Grant Program (CGP), with regular updates and active engagement on the grant forum. The audit focused on optimizing risk management and enhancing protocol stability through advanced simulations and stress tests within the USDC market, targeting collateral assets such as Wrapped Ether (WETH), Wrapped Bitcoin (WBTC), GMX, and Arbitrum (ARB). The final report, shared with the community, provides an in-depth overview of Chainrisk’s risk methodology, offering valuable insights into how these recommendations enhance the protocol’s resilience and ensure its sustainable growth in the decentralized finance ecosystem.

2. Executive Summary

This is a follow-up proposal to our ‘Comprehensive Risk Management Services Proposal for Compound Finance’. Thanks to @Avantgarde @pennblockchain @AranaDigital for their valuable comments on the forum and to @bryancolligan @PGov for sharing their feedback over the community calls. Incorporating the feedback we’ve received, we propose a risk management services proposal for future deployments on Compound. Chainrisk proposes a state-of-the-art risk management solution for Compound Finance, designed to optimize protocol safety, capital efficiency, and sustainable growth. Our comprehensive approach leverages advanced quantitative methodologies, machine learning algorithms, and protocol-specific risk models to test Compound V3 (Comet) Modules and new protocol upgrades in various market scenarios.

Key Highlights:

  • Chainrisk proposes a 3-month risk management services proposal, focusing on future Comet deployments on Base and Linea, and new chains. During this pilot phase, we aim to deliver high-quality risk assessments and actionable recommendations to enhance market robustness. We are committed to transparency by making our reports and analyses publicly accessible to enhance community engagement.

  • Chainrisk will provide data-driven recommendations for dynamic risk parameters, including but not limited to:

    • Borrow Collateral Factor
    • Liquidation Collateral Factor
    • Liquidation Threshold
    • Supply Cap
    • Target Reserves
    • Storefront Price Factor

    These recommendations will be based on rigorous quantitative analysis and market conditions to optimize protocol safety and efficiency.

  • Chainrisk will deploy an advanced real-time monitoring and alerting system, providing critical risk insights to protocol stakeholders and facilitating timely responses to market dynamics.

  • A full-time team of 6 will be dedicated to Compound with experts in Security, Statistics, Cloud and Data Science, bringing valuable experience from prestigious institutions such as the Ethereum Foundation, NASA, JP Morgan, Deutsche Bank, Polygon, Nethermind, and EigenLayer.

  • Our team will actively support the implementation of new initiatives such as ‘COMP Everywhere,’ ‘Compound Sandbox,’ and the adoption of higher collateral factors to drive innovation and enhance the protocol’s utility.

  • A robust knowledge transfer and community engagement program will be implemented to ensure comprehensive understanding and active participation within the Compound community.

  • 3-month engagement (Feb 1, 2025 - April 30, 2025): $90,000 in USDC tokens will serve as the payment for this phase.

3. Company Overview

Chainrisk is an end-to-end economic security & risk management company building tools and services for all Defi protocols and L1, L2s to protect value at risk. Chainrisk specializes in economic security, offering a unified simulation platform designed for teams to efficiently test protocols, particularly in challenging market conditions. Our technology is anchored by a cloud-based simulation engine driven by agents and scenarios, enabling users to create tailored market situations for comprehensive risk assessment.

Our team comprises experts with diverse backgrounds in Crypto, Security, Statistics, Economics, and Data Science, bringing valuable experience from institutions such as Ethereum Foundation, NASA, JP Morgan, Deutsche Bank, Polygon, Nethermind, and Eigen Layer.

Key Differentiators:

  • Focus on Capital Efficiency: We prioritise enhancing the top-line of DeFi protocols by exploring innovative avenues of capital efficiency for both protocols and its users.
  • Commitment to Transparency: Risk management shouldn’t be a black box. That’s why we strive to make our analyses as public as possible, fostering trust and clarity within the DeFi community.
  • Advanced Simulation Engine: Our unique dual-pronged simulation engine combines the power of Rust-based off-chain computations with real-time on-chain data, enabling us to conduct precise risk assessments and fine-tune parameters effectively.
  • Community Engagement: We value community input and actively involve users in our risk management proposals. By seeking feedback, we ensure our solutions align with the community’s needs and insights.
  • Agility and Speed: Our agile team is always ready to roll out new tools and strategies quickly, helping DeFi protocols understand and mitigate risks while opening up new opportunities for capital efficiency. For new Comet deployments on existing chains, recommendations should take about a week, and a couple of weeks for new chain deployment.

4. Scope of Work for Compound Finance

This proposal outlines a comprehensive approach to enhancing risk management, governance analysis, and user experience for Compound V3.

Deliverables -

A. Risk Management and Analysis

  1. Complementary Risk Management

    • Serve as a risk management service provider, focusing on future Comet deployments on Base and Linea, and new chains.
    • Expand asset offerings by introducing new collateral types for existing base assets, adding new base assets with corresponding collateral, and actively supporting new chain deployments with full coverage of associated base and collateral assets
    • Focus on longer-tail assets to ensure comprehensive coverage
  2. Data-Driven Recommendations

    • Provide bi-weekly recommendations for dynamic risk parameters:
      • Borrow Collateral Factor
      • Liquidation Collateral Factor
      • Liquidation Threshold
      • Supply Cap
      • Target Reserves
      • Storefront Price Factor
  3. Real-Time Monitoring & Alerts

    • Implement an advanced real-time monitoring and alerting system
    • Provide critical risk insights to stakeholders
  4. Supporting New DAO Initiatives

    • Offer risk management support for new DAO initiatives, including recent proposals like the Compound Sandbox development by the WOOF team and COMP Everywhere proposal.
  5. Comprehensive Reporting

    • Deliver a Comprehensive Risk Report at the end of the 3 months
    • Include:
      • Risk management framework details
      • Analyses of newly launched markets and added assets
      • Assessments of high-risk events, particularly days with elevated liquidation risk

B. Community Engagement and Knowledge Transfer

  1. Knowledge Transfer Program
    • Implement a robust knowledge transfer initiative
    • Conduct regular community engagement sessions
  2. Transparency
    • Ensure all reports and analyses are publicly accessible
    • Provide clear documentation and resources for community understanding

5. Detailed Service Offerings

5.1 Proposed Risk Management Framework for Longer Tail Assets

Long-tail assets in the cryptocurrency landscape refer to digital tokens characterized by low market capitalization and trading volume, positioning them at the periphery of the market compared to dominant cryptocurrencies like Bitcoin and Ethereum. Long-tail assets often attract speculative trading strategies, where traders aim to leverage short-term price movements in these less liquid markets.

Long-tail assets play a pivotal role in portfolio diversification, offering exposure to niche sectors within the cryptocurrency ecosystem. This category encompasses various tokens such as liquidity provision (LP) tokens, liquid restaking tokens (LRTs), liquid staking tokens (LSTs), real-world assets (RWAs), and vault tokens. While these assets hold the promise of high returns, their limited presence on mainstream decentralized finance (DeFi) platforms underscores the necessity for robust risk management strategies.

Chainrisk Long Tail Asset Onboarding Methodology

This methodology outlines a basic framework for evaluating long tail assets through Fundamental, Technical, Market and Statistical Evaluations.

I. Asset Fundamental Evaluation:

Objective: This includes an in-depth examination of the asset’s functionality, utility, and role within its ecosystem. Key factors include:

  • Assess the primary functions of the asset and the specific scenarios in which it is utilized. Understanding its real-world applications helps gauge its relevance and potential for adoption.
  • Evaluate critical indicators such as Price, Fully Diluted Valuation (FDV), trading volume, market capitalization, and other relevant metrics. These figures provide insights into the asset’s reliability, stability, and overall market performance.
  • Analyze the economic model surrounding the asset, including total supply, distribution among stakeholders, utility within the ecosystem, and any inflation or deflation mechanisms.

II. Technical Evaluation:

Objective: To evaluate the technical specifications of the asset to understand its security and operational robustness. Key Factors include:

  • Analyzing the asset’s interoperability within decentralized finance ecosystems highlights its potential for integration with other protocols.
  • Assess the asset’s smart contract audits, built-in security features (e.g., multi-signature wallets), historical security incidents, and the presence of bug bounty programs.
  • Evaluate other technical specifications such as access control, oracles, immutability, centralization, documentations, and more.

III. Market Evaluation:

Objective: To assess potential market risks associated with the asset by analyzing the historical performance of the asset. Key Factors include:

  • Volatility Analysis: Evaluate the historical price volatility to understand potential fluctuations. This involves analyzing past price movements and asset volatility.
  • Liquidity Analysis: Evaluating the asset’s liquidity across different trading platforms (DEX and CEX) provides insights into how easily it can be traded without significant price impact.

IV. Statistical Evaluation:

Why Chainrisk uses Percentile-based methods for Long Tail Assets?

Percentile-based methods are very useful for understanding skewed data distributions because they focus on actual data points rather than assuming a perfectly balanced, bell-shaped curve (like a normal distribution). In many real-world situations, data isn’t balanced in this way. For instance, in finance, big losses are often more common than big gains, resulting in a left-skewed distribution where the “tail” (extreme values) is longer on the left. Using percentiles helps capture these extreme events more accurately.

Traditional measures like the mean (average) and standard deviation don’t work as well in these cases because they rely on symmetry. When data is skewed, these measures don’t accurately reflect the likelihood of extreme values. Percentiles, on the other hand, look at specific data points within the distribution—like the 5th percentile, which represents the point where only 5% of the data falls below. This approach is much better at identifying “tail risks,” or the chance of rare but large losses since it doesn’t assume the data is evenly spread.

In finance, for example, percentile measures can show how much a portfolio might lose in the worst 5% of scenarios (known as Value at Risk, or VaR). Percentiles are useful because they aren’t thrown off by extreme values; they simply show where data points fall relative to each other. This makes them reliable and realistic for assessing risk in any skewed distribution, giving a clear picture of potential extremes without assuming everything follows a neat, bell-shaped curve.

5.2 Risk Monitoring and Alerting Dashboard

Chainrisk will develop a comprehensive risk monitoring and alerting dashboard for Compound, focusing on real-time user positions, market dynamics and simulations. This powerful tool will provide valuable insights for both the protocol and its users, enabling them to make well-informed choices about their respective positions and strategies.

Key Features

Protocol Risk Analysis

The dashboard will offer in-depth protocol and market-specific risk analysis, including ( but not restricted to ) :

  • Supply and borrow metrics per asset per market
  • Asset-specific Utilization rates
  • Asset distribution for supply and borrow
  • Value at Risk (VaR) and Liquidations at Risk ( LaR ) calculations per market
  • Protocol reserves distribution
  • Identification of accounts at risk of liquidation
  • Market Risk Alerts

User Analysis

To enhance user experience and decision-making, the dashboard will provide:

  • Real-time user metrics
  • User wallet breakdown and distribution
  • Individual user health scores
  • Simulations of user health based on asset price fluctuations

This comprehensive user analysis will enable Compound users to better understand and manage their positions.

6. Technical Implementation

6.1 Chainrisk Simulation Engine

The Chainrisk Simulation Engine is a sophisticated, modular testing environment designed to conduct high-fidelity simulations of DeFi market scenarios. It comprises two key components:-

  • RiskEVM: A high-performance, Rust-based simulation engine optimized for computationally intensive tasks. RiskEVM models complex protocol interactions, including borrowing, lending, and liquidation events under various market conditions. This component enables a comprehensive assessment of protocol behaviour and stability, particularly during periods of market stress.
  • On-Chain Simulation: This component executes backtests on forked mainnet networks, ensuring simulation accuracy and fidelity to real-world scenarios. By leveraging actual on-chain data, it evaluates protocol responses to diverse conditions, providing insights into resilience and potential vulnerabilities.

The integration of these components allows Chainrisk to identify potential risks and optimize parameters with a high degree of precision. This dual-pronged approach combines the efficiency of the Rust-based simulation engine with the accuracy of on-chain data, enabling robust risk assessment and parameter optimization for DeFi protocols.

Why do we need 2 Engines?

The RiskEVM is a custom-built, highly optimized agent-based simulation engine designed to address the challenges of conducting large-scale economic audits on blockchain networks. It leverages Rust’s capabilities for parallelism and concurrency to significantly reduce Time to Complete (TTC) for complex audits.

The RiskEVM offers several key advantages that enhance its performance and efficiency in conducting complex DeFi simulations. It employs parallel execution of independent tests and transactions, significantly reducing overall processing time. The system’s ability to deterministically pre-identify wallet interactions allows for optimized resource allocation. Additionally, its branched processing architecture, which converges for final results, ensures both speed and accuracy.

The RiskEVM eliminates the need for external RPC calls and repetitive oracle setups per simulation, streamlining the process and reducing potential points of failure. Finally, by minimizing the gas cost complexity typically associated with mainnet fork testing, it provides a more cost-effective solution for comprehensive protocol analysis. These features collectively enable the RiskEVM to perform extensive simulations with improved speed, accuracy, and resource efficiency compared to traditional methods.

This architecture allows the RiskEVM to perform extensive simulations (e.g., 6 million for Compound Labs) more efficiently than traditional on-chain forked network approaches. By minimizing latency, external dependencies, and resource overhead, the RiskEVM provides a more scalable and cost-effective solution for comprehensive blockchain economic audits.

Architecture


Benchmarking

The Chainrisk RiskEVM leverages a highly optimized Anvil implementation using a Rust compiler. Its modular architecture and efficient handling of high transaction volumes, combined with minimal external calls, results in latency improvements of up to 150x compared to competitors.

This performance boost enables the Chainrisk team to rapidly compile and generate risk parameters. While current risk management solutions typically process around 40K simulations in 24 hours, Chainrisk processes about 10 million with the same servers in the same amount of time.

The RiskEVM’s capabilities allow for:

  1. Real-time parameter recommendations for settings that don’t require governance proposals

  2. Accelerated analysis for parameters and markets subject to on-chain voting

The enhanced simulation speed translates to:

  • Faster updates
  • Quicker alerts
  • Increased ability to mitigate potential market shocks

This technological edge positions Chainrisk to provide more responsive and effective risk management in dynamic market conditions.

6.2 Chainrisk Cloud Architecture

Our cloud architecture is designed to support high-performance computing and large-scale data management, leveraging AWS services to ensure scalability, reliability, and security. Below is an overview of the key components and considerations that shape our infrastructure.

Core Compute Components

  • ECS: Our primary computing happens in multi-region ECS Clusters, as we use AWS as our primary cloud provider. We use Elastic Compute Service ( ECS ) coupled with AWS Fargate. ECS allows us to manage containerized applications without the overhead of maintaining each machine separately. This service automatically scales the Kubernetes control plane based on workload demands, ensuring high availability and performance.
  • ⁠Elastic Kubernetes Service: Our secondary compute is AWS EKS coupled with Fargate. We use this if we suddenly need to run a burst of workload for a short duration of time in case of super heavy load or as a failover service in case our main Clusters are down for some reason like maintenance.

Scalability

Scalability is a critical aspect of our architecture, enabling us to efficiently handle varying workloads:

  • Horizontal Scaling: ECS supports horizontal scaling of workloads, allowing us to increase or decrease the number of running pods based on demand. This flexibility is essential for maintaining performance during peak usage times.
  • Multi-Region Deployment: Currently operating in two AWS regions, our architecture can support up to 10 million simulations daily per region. This multi-region setup enhances our resilience and ensures low-latency access for users in different geographical locations.

Service Integration: Services like Amazon SQS for messaging, RDS for database management, and API Gateway for API management scale seamlessly with our compute resources. This integrated approach simplifies operations and enhances responsiveness to user demands.

Security Framework

Security is embedded at every level of our architecture:

Security is embedded at every level of our architecture, ensuring the output is trustworthy and manipulation-free :

  • Identity and Access Management (IAM): We implement strict IAM policies to enforce least-privilege access controls across all services, ensuring that users and applications have only the permissions necessary for their functions.
  • Secrets Management: Utilizing AWS Secrets Manager, we securely store sensitive information such as API keys and database credentials. Automated rotation of these secrets further enhances our security posture.
  • Network Isolation: Sensitive workloads are deployed within a Private VPC, isolating them from public internet access. This setup minimizes exposure to potential threats while allowing controlled access to necessary services.
  • Data Security: Our databases employ encrypted connections and fine-grained access controls. Additionally, multi-region backups safeguard against data loss, ensuring business continuity in case of failures.

Performance Monitoring and Optimization

To maintain optimal performance as we scale:

  • Monitoring Tools: We utilize monitoring solutions that provide insights into resource utilization and application performance. This data informs scaling decisions and helps identify potential bottlenecks before they impact operations.
  • Load Testing: Regular load testing is conducted to validate the scalability of our architecture under various conditions. These tests help ensure that our infrastructure can handle anticipated workloads without degradation in performance.

Future Directions

As we evolve our cloud infrastructure:

  • Enhanced Flexibility: We aim to enhance flexibility by exploring additional cloud providers while maintaining our primary reliance on AWS.
  • Advanced Autoscaling: Plans are underway to optimize resource allocation through advanced autoscaling configurations and potentially integrate more managed services to reduce operational overhead.

This architectural framework ensures we can efficiently manage complex computations and large datasets while maintaining a strong focus on security and scalability.

7. Performance Metrics and KPIs

Financial Metrics

  1. Growth in Supply Volume: Monitor the increase in the total supply volume as a key indicator of market engagement and expansion.
  2. Revenue Growth: Track the increase in revenue due to introducing new markets.
  3. Community Adoption: Track the borrowing activity as a measure of market adoption and liquidity utilization.

*To be evaluated for the Comets which will be listed post Chainrisk’s recommendations.

Community Engagement and Satisfaction

  1. Community Net Promoter Score (NPS): Survey the community to gauge satisfaction with the Compound-Chainrisk relationship.
  2. Community Engagement Metrics: Track community participation in security-related discussions, forums, and educational initiatives.

8. Timelines

  • For new Comet deployments on existing chains, risk recommendations will be delivered within one week.
  • For new chain deployments on Compound, recommendations will be provided within two weeks from the date the proposal is listed on the forum.

9. Fee Structure

Compensation

  • We will be utilizing the Compound Aera Vault and Llama Pay for the payment process. The payment stream will be executed on a per-second basis over a period of three months, from February 1 to April 30, 2025.
  • A total of $90,000 USDC will be distributed during this period. Given the exact duration of 7,689,600 seconds, this results in a payout rate of approximately 0.0117041198 USDC per second.

10. References to Previous & Upcoming Work

You can find in this section links to our work:


Research from the Team - Chainrisk Simulation Engine | Chainrisk VaR Methodology | DeFi Lending & Borrowing Risk Framework | Multi-Agent Influence Diagrams ( MAIDs ) for DeFi Governance | MAIDs Video

10. Conclusion and Next Steps

This is the final proposal after incorporating feedback from delegates and community. We shall submit an on-chain snapshot by the end of this week.

3 Likes