Cointime

Download App
iOS & Android

Arcadia Collateral Risk Simulation: Progress Report 2

From LlamaRisk

In last week's progress report, we outlined the methodology we aim to use to define the risk parameters of Arcadia Lending. This week we will dive deeper into the simulation architecture and how we have implemented the methodology.

The report is structured into four parts:

  1. Simulation Architecture: A breakdown of the various modules and classes within the simulation, along with their relationships.
  2. Progress: Summary of the current state of the project, including implemented components and ongoing developments.
  3. Next Week's Goals: Planned tasks and objectives for the upcoming week, focusing on integration, optimization, and testing.
  4. Next Week’s Post: Preview of the content to be covered in the next update, including Simulation Verification and Validation measures.Subscribe

Simulation Architecture

The Arcadia simulation architecture, as depicted in the UML (Unified Modeling Language) diagram, consists of various modules and classes that interact to simulate asset liquidation processes within the Arcadia v2 Lending Protocol.

Figure 1: UML Diagram of the Arcadia Simulation

Below we outline a description of the architecture displayed in Figure 1 between different modules:

  • Asset: This is the fundamental unit, representing various financial instruments. It includes details like its blockchain association, unique identifiers, and other relevant information such as its name and how its price is determined.
  • Chain: This term refers to a specific blockchain, providing necessary details for interaction like its unique ID and URLs for exploration and communication.
  • Asset Metadata: This component stores detailed information about an asset for simulation purposes, including its quantity, ownership share, and risk factors.
  • Asset Value And Risk Factors: This outlines the criteria used to assess an asset's risk, including how it affects borrowing and liquidation processes.
  • Assets In Margin Account: This links assets with margin accounts, indicating the assets held and their details.
  • Auction Information: This includes information on auction processes for assets, such as ownership details, starting conditions, and current status.

Liquidation Process:

  • Lending Pool Liquidation Config & Liquidation Config: These configuration settings outline the rules and parameters for how liquidations are conducted, including fees, the duration of processes, and how prices are adjusted.
  • Liquidation Engine: The core system responsible for managing liquidations, which includes functionalities for updating auction details, placing bids, and carrying out liquidations where required.
  • Liquidator: These are the agents or entities tasked with identifying accounts that can be liquidated and executing the auction processes.
  • Margin Account: Represents the accounts of participants, showing what assets they hold, their debts, and the base currency for their valuations.

Simulation Execution:

  • Pipeline: The framework that coordinates the simulation, setting its timeline, and managing interactions between accounts, liquidators, and the liquidation process.
  • Simulation Time: Manages the timing aspects of the simulation, such as tracking the current block and timestamp, and updating asset prices as needed.

Supporting Components:

  • Slippage Calculator: This tool estimates how a trade's size might affect its price, important for understanding the potential profitability of liquidation actions.
  • Gas Estimator: Calculates the estimated Gas cost for different steps in the liquidation process.
  • Pricing Metadata & Price Strategy Methods: These define how asset prices are calculated, including various methods for price determination, such as using external data sources.
  • Simulation Metrics: Monitors various performance indicators and the simulation's overall health, including tracking the number of accounts in financial distress.

Exception Handling:The system incorporates a variety of exception classes to address particular errors encountered during the simulation, such as issues with account liquidation eligibility, auction status, missing price data, liquidity shortages, and unpopulated price fields. These exceptions help maintain the simulation's integrity and reliability by providing clear error-handling pathways.

Progress

During week 5, we completed the implementation of Orchestrator.py and introduced three different Borrower Models based on Arcadia v1 Borrow data.

Orchestrator

An attentive reader may have noticed that the above simulation architecture displayed in Figure 1 allows a user to execute one simulation run with one set of parameters, yet to find meaningful answers to parameter settings for Arcadia v2, we need hundreds to thousands of runs of different parameter settings.

This is where the need for the orchestrator class arises. The Orchestrator is responsible for setting up various risk scenarios in which collateral assets and numeraire pairs are exposed to different market conditions and allows the execution of simulations in parallel.

class Orchestrator(Base): """ Brute force implementation of orchestrator, has no optimization """ start_timestamp: int end_timestamp: int simulation_time: SimulationTime liquidation_engine: LiquidationEngine liquidators: List[Liquidator] no_of_margin_accounts: int debt_init_model: Any asset_ranges: Dict[Asset, Ranges] exposure_range: range | list numeraire: Asset def prepare_simulation(self): ... return parameter_sets @staticmethod def worker(params): ... pipeline.event_loop() def execute(self): ...

Attributes:

The Orchestrator manages the simulation's timeframe, environment, liquidation mechanics, and the agents executing liquidations. Additionally, it configures the simulation's scope, including the number of margin accounts, the value and risk exposure ranges of assets, and the base currency (numeraire) used for valuation.

Methods:

To be able to run the simulation in parallel, the Orchestrator has three key methods:

  • prepare_simulation(): Sets up the simulation by creating all combinations of asset risk factors and exposures for margin accounts, using combinations of collateral_factor and liquidation_factor and exposure.
  • worker(): A static method that organizes and carries out the simulation for specific parameters, designed for parallel execution through multiprocessing.
  • execute(): Initiates the simulation in parallel with Python's multiprocessing capabilities, spreading out parameter sets to various processes that each run a simulation instance.

Overall, the Orchestor is responsible for setting up the different risk scenarios by combining market scenarios with key asset parameters. This allows us to efficiently run different scenarios in parallel.

Borrower

We retrieved borrower data from v1 data and created borrow distributions. By assuming fixed strategies, we can arrive at the collateral distribution of a potential collateral portfolio at the initiation of the borrower accounts. We then can sample from the borrow amount and assume the maximum borrow based on the available collateral factor for a simulation run.

We are currently in the process of retrieving additional borrow data on Base and ETH for more alternative borrow models as suggested in last week’s methodology.

Goals for Week 6

The team's goal for the current week 6 can be broadly categorized into three buckets:

  1. Refinement of the Simulation: This entails integrating additional components (i.e. Slippage and Gas in the Liquidator Profit Calculation) and testing additional optimization algorithms during the liquidation.
  2. More Borrower Data: We aim to gather more borrower data
  3. Verification & Validation Testing: We plan to test more verification and validation scenarios on real-world test cases.
Comments

All Comments

Recommended for you

  • Iranian Official: US Provocation on Strait of Hormuz is a Reactive Response

    According to IRNA, Hussein Nushabadi, the Director General of the Iranian Foreign Ministry's Parliamentary and Legal Affairs Department, stated in an interview that Washington's controversial claims regarding control over the Strait of Hormuz are primarily driven by domestic political needs and are a reactive response to Iran's demonstrated strength and strategic actions in this waterway. He noted that the baseless assertions made by the US President regarding the Strait of Hormuz do not align with international shipping regulations or the relevant provisions of the United Nations Convention on the Law of the Sea. Nushabadi also pointed out that Iran possesses political and military dominance over the Strait of Hormuz, a vital lifeline for global energy and economy, making it a powerful lever and strategic trump card in responding to external threats.

  • Jensen Huang Collaborates with Wall Street Giants to Support AI Computing Market

    On August 15, a rare scene unfolded as Jensen Huang joined forces with six major Wall Street asset management giants to endorse the idea of establishing AI computing as an independent asset class. Analysts believe this reflects Huang's commitment to the concept of token economics, marking a shift in the AI boom from a technological competition to a capital competition. However, the latest plan has raised concerns among investors regarding 'circular financing' and debt risks. In response to these doubts, Huang personally stepped in to reassure the market, stating that Nvidia may provide a residual value support mechanism of up to 25% for individual investment projects and will carefully evaluate each project. Following this, market sentiment showed slight improvement. (CCTV Finance)

  • DJI Added to 'Blacklist', US Court Orders Rehearing

    On August 15, according to the Russian Satellite News Agency, the U.S. Court of Appeals recently ruled that a lower court must rehear the case regarding the inclusion of Chinese drone manufacturer DJI on the Pentagon's 'Chinese Military Industrial Enterprises' blacklist, stating that the previous ruling was based on non-confidential information and contained flaws. The report indicated that the D.C. Circuit Court of Appeals pointed out that the lower court's conclusion that DJI 'contributes to China's defense industrial base' was erroneous, as it relied solely on publicly available information. The court has mandated that during the rehearing, the lower court may review classified documents and decide whether to uphold the Department of Defense's designation based on that information.

  • Iran Claims Undisputed Ownership of Strait of Hormuz

    On August 15, according to CCTV International News, Iran's Chief Justice Ejei stated today that the absurd remarks made by the U.S. President regarding the Strait of Hormuz are entirely based on his personal delusions. In the real world, the true owner and dominant power of this important international waterway is Iran. Ejei emphasized that Iran has proven militarily that the Strait of Hormuz is an inseparable part of Iranian territory and sovereignty.

  • US Spot Bitcoin ETF Sees Net Outflow of $56.2 Million Yesterday

    On August 15, according to data monitored by Farside Investors, the US spot Bitcoin ETF experienced a net outflow of $56.2 million yesterday.

  • No Net Inflow or Outflow for US Spot Ethereum ETF Yesterday

    On August 15, according to monitoring data from Farside Investors, there was no net inflow or outflow for the US spot Ethereum ETF yesterday.

  • Charles Schwab: Low Probability of CLARITY Act Passing Before U.S. Midterm Elections

    On August 15, Charles Schwab stated in its 'Weekly Trader Market Outlook' that as of the time of writing, the Bitwise Top 10 Large Cap Crypto Index has fallen 3% since last Friday; Bitcoin has dropped 3% during the same period, while Ethereum is down 2%. Bitcoin continues to exhibit characteristics of a low-correlation asset, with limited impact on its price from the CPI and PPI data released this week. Last week, the U.S. Senate entered its summer recess without voting on the CLARITY Act. Although the final debate vote for the bill is scheduled for September 14, the probability of it passing before the midterm elections remains low.

  • Sources: Trump to Attend Closed-Door Meeting with Crypto Executives at the White House

    On August 15, sources revealed that U.S. President Trump is expected to attend a White House meeting held by the newly established Innovation Committee on Wednesday. The committee consists of executives from the crypto industry as well as leaders from prediction markets and artificial intelligence companies. Sources indicated that the CEOs of companies such as Coinbase, Ripple, Gemini, Robinhood, Polymarket, and Kalshi are members of the U.S. CFTC Innovation Advisory Committee. Before attending the committee's first official meeting on Thursday, these crypto industry CEOs will gather at the White House for the meeting on Wednesday. Attendees learned that Trump plans to participate in this meeting. The meeting is expected to take place at the Eisenhower Executive Office Building next to the White House, aiming to initiate policy discussions on several key directions in the U.S. innovation sector. Sources also stated that CFTC Chairman Mike Selig and other policy advisors are expected to attend the meeting. One source further revealed that U.S. Treasury Secretary Scott Bessent and Commerce Secretary Howard Lutnick may also be present. The White House spokesperson has not yet responded to requests for comments regarding the meeting arrangements.

  • U.S. Optical Communication Stocks Rise, Lumentum Up Over 6%

    On August 14, U.S. optical communication stocks collectively rose, with Applied Optoelectronics increasing by over 14%, AXT Inc and MaxLinear rising by over 7%, POET Technologies and Lumentum up by over 6%, and Lightwave Logic increasing by over 5%. Corning and Tower Semiconductor also saw gains of over 4%.

  • Dunamu Reports 73% Decrease in Q2 Operating Profit to 23.5 Billion Won

    On August 14, Upbit operator Dunamu announced its Q2 2026 performance, reporting quarterly revenue of 173.5 billion won (approximately 123 million USD) and an operating profit of 23.5 billion won (approximately 16.65 million USD), representing declines of about 26% and 73% respectively compared to Q1. In the first quarter, Dunamu's revenue was 234.6 billion won (approximately 166 million USD) with an operating profit of 88 billion won (approximately 62.34 million USD). Dunamu stated that the decline in performance this quarter was primarily influenced by the overall contraction in liquidity in the global digital asset market, which weakened investor sentiment.