Protocol Architecture

Astro Protocol's architecture is designed to support simple yet robust interactions among its components, optimizing for large amounts of liquidity while minimizing volatility.

Vault Contract

Central to the protocol, the Vault Contract enforces the deposits, withdrawals, and issuance of synthetic assets. It interacts directly with the Oracle Module to get real-time pricing, ensuring that the collateralization ratios are maintained within safe limits.

Key Functions and Role

  • Collateral Management: The Vault Contract allows users to deposit collateral in exchange for synthetic assets or stablecoins (e.g., USDA).

  • Debt Issuance and Management: Minting synthetic assets is enabled for users upon collateral deposit, following the protocol's determined ratios.

  • Real-Time Pricing Updates: The Vault Contract integrates with the Oracle Module for real-time pricing updates on different collateral types. It enables accurate and fair vault management by maintaining current collateral values.

  • Liquidation Triggers: The Vault Contract starts liquidation if collateral value drops below predefined thresholds. These can be handled directly through the Direct Liquidation Handler or, in more severe cases, passed to the Auction Module via the Protocol Liquidation Handler. Liquidation is discussed in more detail in the "Liquidation Module" section.

  • User Interaction Interfaces: The contract offers action handlers for users to interact with their collateral and debts. It includes functions for depositing and withdrawing collateral, minting and burning synthetic assets, and managing debts.

  • Fee and Penalty Collection: The Vault Contract calculates and collects stability fees and liquidation penalties during liquidations. These fees are crucial for compensating the protocol for the risks and maintaining overall economic stability.

Importance within Protocol's Architecture

The Vault Contract is vital for the operational efficiency and financial security of the Astro Protocol. It acts as the primary interface for users, facilitating all major interactions with the protocol. Its robust design ensures:

  • Security and Trust: Users can trust the protocol with their assets, knowing that the Vault Contract enforces strict rules and transparent operations.

  • Efficiency: The automated processes within the contract reduce the need for manual intervention, streamlining operations and minimizing errors or delays.

  • Flexibility: By supporting various types of collateral and synthetic assets, the Vault Contract caters to a broad user base with diverse needs.

  • Stability: Through the integration with the Stability and Oracle Modules, the contract contributes to the overall resilience of the protocol, adapting to market changes and user activities dynamically.

Liquidation Module

This module is triggered when collateral value falls below predefined thresholds, with two main components: the Direct Liquidation Handler and Protocol Liquidation Handler. It supports both immediate liquidations by users and systematic liquidations managed by the protocol itself.

Direct Liquidation Handler

The Direct Liquidation Handler is a specialized component of the Astro Protocol's Liquidation Module, crafted to facilitate the immediate liquidation of undercollateralized vaults when specific conditions are met. This handler enables rapid response to mitigate potential risks from fluctuating market values of collateral.

Key Functions and Role

  • Threshold-Based Liquidation Activation: The Direct Liquidation Handler is triggered when a vault's collateralization ratio falls between predefined thresholds, such as less than 175% but more than 150%. For example, if a vault's collateralization ratio drops to 160%, the Direct Liquidation Handler will be activated. This trigger ensures swift liquidation to protect collateral value and system stability.

  • Execution of Liquidation: Authorized users can directly liquidate a vault with this handler upon activation. To recover the collateral, the liquidator pays off the vault's debt, including fees and penalties.

  • Debt Settlement and Fee Calculation: The handler calculates the repayment amount to close the vault in a direct liquidation event. This includes the debt principal (USDA Loan), stability fee (5%), and liquidation penalty (13%). These fees deter risky behavior and compensate for the associated risk.

  • Collateral Transfer and Vault Closure: The Direct Liquidation Handler facilitates the collateral transfer upon receiving payment from the liquidator. Concurrently, it ensures that the original debt is marked as settled, and the vault is officially closed within the system's records.

  • Protocol Fee Distribution: Collected fees will be managed by stewards via a protocol treasury until decentralized governance controls fee distribution.

  • Integration with Stability Measures: While the Direct Liquidation Handler operates autonomously to address immediate liquidation needs, it is designed to work in harmony with other protocol components, such as the Stability Pool and the Oracle Module. This ensures actions are based on real-time market data and contribute to protocol stability and liquidity.

Protocol Liquidation Handler

The Protocol Liquidation Handler is an integral component of the Astro Protocol's Liquidation Module, specifically designed to manage the systematic liquidation of undercollateralized vaults when they fail to meet the required collateralization thresholds. This handler automates critical processes to maintain the system's stability and prevent potential financial crises within the protocol.

Key Functions and Role

  • Automated Liquidation Initiation: The handler is activated when a vault's collateralization ratio falls significantly, specifically below the minimum threshold, such as less than 150%. For instance, if a vault's collateralization ratio drops to 130%, the Protocol Liquidation Handler will be triggered instead of the Direct Liquidation Handler. This automated trigger ensures timely intervention to mitigate risks associated with declining collateral values.

  • Auction Process Management: For severely undercollateralized vaults, the handler initiates an auction to liquidate the collateral efficiently. It interacts with the Auction Module, setting up the auction's parameters such as starting price, price decrement rates, and auction duration based on the prevailing market conditions and the vault's debt levels. Auctions are discussed in more detail in the "Auction Module" section.

  • Debt and Fee Handling: The handler calculates the total amount due for the auction, including the principal debt, stability fees, and liquidation penalties. This total forms the recovery target for the auction, ensuring that the protocol recoups the necessary funds to cover the defaulted loan.

  • Vault Closure and Administration: Post-triggering an auction, the handler is responsible for closing the defaulting vault. It transfers the collateral to the auction mechanism and, following the auction, manages the allocation of the recovered funds and finalizes the closure of the vault within the protocol's ledger.

  • Contribution to Systemic Stability: The Protocol Liquidation Handler plays a crucial role in maintaining the overall health and stability of Astro Protocol by preventing losses that could escalate into broader systemic risks. This is achieved through efficient and orderly liquidation processes, even under adverse market conditions.

  • Integration with Other Protocol Modules: Utilizing real-time data from the Oracle Module, the handler ensures that liquidation prices reflect current market values, enhancing the chances of successful debt recovery. It may also interact with the Stability Module to utilize or replenish protocol reserves, depending on the outcomes of the liquidation process.

Stability Module

The Stability Module is integral for maintaining the health of the protocol during market volatility. It includes a Stability Pool where users can deposit stablecoins to earn rewards and a Collateral Pool that enhances liquidity and supports the protocol's stability. It acts as a financial buffer against market volatility and systemic risks by managing liquidity pools and providing mechanisms to mitigate potential defaults and liquidations.

Key Functions and Role

  • Liquidity Management: The Stability Module aggregates user deposits in the form of stablecoins (e.g., USDC). These deposits are used to support the protocol during periods of high demand for liquidation or when additional liquidity is necessary to maintain operations, ensuring that the protocol can cover its liabilities efficiently.

  • Risk Mitigation: By pooling resources, the Stability Module can intervene in liquidation events to purchase undercollateralized assets at a discount. By preventing large-scale sell-offs, this intervention stabilizes the market and safeguards collateral values.

  • Reward Distribution: Users who contribute to the Stability Pool will be rewarded with AST tokens or other incentives, proportionate to their share of the pool over time. These rewards compensate users for the temporary loss of liquidity during fund usage in stability operations.

  • Integration with Oracle Module: The Stability Module interacts with the Oracle Module for accurate pricing updates on assets. Current market values are used to make decisions about liquidation or collateral purchases, optimizing results.

  • Automated Liquidation Participation: The Stability Module automatically purchases distressed assets if a vault lacks collateral. This process minimizes default impact on the protocol's financial health by resolving them quickly.

  • Governance and Protocol Support: Governance votes determine where to allocate funds from the Stability Module. This can include funding development, enhancing protocol security, or other activities that contribute to the long-term sustainability of the system.

Stability Pool

The Stability Pool in the Astro Protocol is designed to act as a financial buffer that enhances the system's resilience against defaults and helps maintain overall liquidity and stability. This component is critical for absorbing shocks from market volatility and managing undercollateralized loans in a decentralized finance environment.

The Stability Pool collects deposits in the form of stablecoins, such as USDA, from users who wish to support the protocol's stability and earn rewards. These funds are used to purchase collateral from liquidated vaults, effectively absorbing the debt from undercollateralized loans. When the Vault Contract or Auction Module processes liquidations, the Stability Pool is often the first line of defense. It uses its pooled resources to buy out distressed collateral at a discounted rate, helping to stabilize the protocol's economy and mitigate potential losses.

Stability Pool parameters, such as reward distribution rates, intervention thresholds, and other operational policies, are often governed by the protocol's DAO. This allows stakeholders to participate in decision-making processes, aligning the pool's strategies with the broader interests of the community.

Stability Pool Liquidation Scenario in Astro Protocol

  1. Assumption Setup:

    • Stability Pool Total Deposit: 1,000,000 USDA.

    • Bob's Contribution: 100,000 USDA (Bob contributes to the Stability Pool, giving him a 10% share in the pool).

    • Alice's Vault Details: Alice's vault gets liquidated, which has a debt of 20,000 USDA and collateral of 400 wAR, with the price of wAR being $75 per wAR.

    • The collateralization ratio for protocol liquidation to occur is 150

  2. Impact of Liquidation on Bob's Deposit:

    1. Bob's Share in the Pool: Bob’s Share=Bob’s ContributionTotal Pool Deposit=100,000 USDA1,000,000 USDA=10%\text{Bob's Share} = \frac{\text{Bob's Contribution}}{\text{Total Pool Deposit}} = \frac{100,000 \text{ USDA}}{1,000,000 \text{ USDA}} = 10\%

    2. Debt from Alice's Liquidated Vault: Debt=20,000 USDA\text{Debt} = 20,000 \text{ USDA}

    3. Bob's Contribution to Repaying Debt:

      Bob’s Share×Debt=10%×20,000=2,000 USDA\text{Bob's Share} \times \text{Debt} = 10\% \times 20,000 = 2,000 \text{ USDA}
    4. Remaining USDA in Bob's Deposit Post-Liquidation:

      Remaining USDA=Bob’s ContributionBob’s Contribution to Debt=100,000 USDA2,000 USDA=98,000 USDA\text{Remaining USDA} = \text{Bob's Contribution} - {\text{Bob's Contribution to Debt}} \\ = 100,000 \text{ USDA} - {2,000 \text{ USDA}} \\ = 98,000 \text{ USDA}
    5. Calculating Bob's Gain in Collateral:

      • Collateral from Liquidated Vault: Collateral=400 wAR\text{Collateral} = 400 \text{ wAR}

      • Bob's Share of Collateral:

        Bob’s Share of Collateral=Bob’s share×Collateral=10%×400=40wAR\text{Bob's Share of Collateral} = \text {Bob's share} \times \text{Collateral} \\ = 10 \% \times 400 \\ = 40 \text {wAR}

      • Financial Evaluation of the Transaction:

        • Value of wAR Received: \text{Value of wAR Received} = \text{Bob's Share of Collateral} \times \text{Price per wAR} \\ = 40 \times $75 \\ = $3,000

        • Net Gain: \text{Net Gain} = \text{Value of wAR Received} - \text{Bob's Contribution to Debt} \\ = $3,000 - $2,000 \\ = $1,000

  3. Post-Liquidation Scenario:

    • Bob's remaining deposit in the Stability Pool is 98,000 USDA.

    • Bob additionally acquires 40 wAR, valued at $3,000.

    • Bob realizes a net gain of $1,000 from this single liquidation event.

Peg Stability Handler

The Peg Stability Handler is a critical component designed to maintain the stability of the USDA peg within the Astro Protocol. It targets vaults with a Collateral Ratio (CR) <175%. If there are no such vaults, the handler includes the lowest loan-to-value (LTV) vaults. The dual criteria approach enhances the protocol's stability by ensuring flexibility in selecting vaults for redemption.

Users or automated agents can redeem USDA for wAR using the Peg Stability Handler. The process includes identifying vaults, processing redemption requests, and executing adjustments. This section outlines the detailed steps and benefits of the Peg Stability Handler.

Identifying Eligible Vaults

The first step in the Peg Stability Handler's operation is to identify vaults eligible for redemption. This involves the following criteria and steps: Criteria:

  • Primary: Vaults with a Collateral Ratio (CR) of less than 175%.

  • Secondary: If no vaults meet the primary criteria, select vaults based on the lowest Loan-to-Value (LTV) ratios.

Key Functions and Role:

  1. Data Collection: Retrieve current data on each vault's collateral value and the amount of USDA issued.

  2. Calculate CR and LTV:

    1. CR=(Value of CollateralValue of USDA Issued)×100%\text{CR} = \left( \frac{\text{Value of Collateral}}{\text{Value of USDA Issued}} \right) \times 100\%

    2. LTV=(Amount of USDA IssuedValue of Collateral)×100%\text{LTV} = \left( \frac{\text{Amount of USDA Issued}}{\text{Value of Collateral}} \right) \times 100\%

  3. Filter Vaults: Initially filter for vaults where CR <175%. If no vaults meet this criterion, select vaults with the lowest LTV.

Redemption Requests

Once eligible vaults are identified, the Peg Stability Handler facilitates the redemption of USDA at par value for wAR. This process includes the following steps:

  1. Interaction: Users or automated agents interact with the protocol to request the redemption of USDA at its par value for wAR from the selected vaults.

  2. Steps:

    1. Request Initiation: Users or agents submit a redemption request. Validate the request to ensure the vault meets the specified criteria (CR <175% or lowest LTV).

    2. Redemption Execution: Transfer the equivalent amount of wAR from the vault to the user and reduce the debt by the amount of USDA redeemed, thereby increasing the vault's CR.

Collect & Adjust Mechanism

The collect and adjust mechanism ensures that the collateral ratio is impacted positively by the redemption of wAR, thereby pushing the CR higher and reducing the debt-to-collateral ratio of the affected vaults. The process involves:

  1. Collect wAR: The protocol collects wAR from the selected vaults.

  2. Adjust CR: The USDA used for redemption is removed from the vault's debt, which increases the CR by reducing the debt relative to the collateral.

Benefits

The Peg Stability Handler provides several key benefits. Users can profit and stabilize the USDA peg through arbitrage within Astro Protocol. It aids in vault liquidations, improving their health by adjusting CR and debt-to-collateral ratio. This dual action enhances the overall stability of the protocol.

Process Flow & Scenario

The following flow illustrates the operation of the Peg Stability Handler:

  1. User Initiates Redemption: A user or automated agent initiates a redemption request through the protocol interface.

  2. Identify Eligible Vaults: The protocol checks for vaults with CR <175%. If none are found, it looks for the vaults with the lowest LTV.

    • Example: If Vault A has a CR of 160% and Vault B has an LTV of 40%, Vault A is prioritized for redemption.

  3. Validate and Process Redemption: The request is validated to ensure the vault meets the criteria. The user's USDA is accepted, and the equivalent value in wAR is transferred from the vault to the user.

  4. Adjust CR: The USDA used in the redemption is removed from the vault's debt, increasing the CR and improving the vault's stability.

  5. Update Vault Status: The vault's records are updated to reflect the new amounts of USDA issued and wAR collateral. The CR of the vault is recalculated and monitored.

The Peg Stability Handler is an essential mechanism for maintaining the stability of USDA within the Astro Protocol. Targeting vaults based on CR and LTV criteria improves redemption efficiency. This mechanism facilitates arbitrage and supports partial liquidations, improving protocol health and stability. Positively impacting the collateral ratio supports protocol resilience and USDA's stable value.

Auction Module

The Auction Module is an essential component of the Astro Protocol, designed to manage the auctioning of collateral from undercollateralized vaults. This module facilitates efficient asset liquidation, promoting debt recovery and financial stability. It implements Dutch-style auctions to enable broader market participation in liquidations, promoting fair market prices and efficient collateral redistribution.

Key Functions and Role

  • Auction Initiation and Management: The Auction Module is activated for vaults with severely undercollateralized collateral. It oversees the entire auction process, ensuring adherence to rules and protocols.

  • Dynamic Pricing Strategy: The module implements a dynamic pricing mechanism where the starting price is set above the current market value (typically 20-30% higher) to maximize debt recovery. The price decreases based on a predefined decrement percentage until the auction ends.

  • Debt Recovery and Fee Handling: Auctions address debts of the liquidated vault, including principal, stability fees, and liquidation penalties. The module guarantees payment of financial obligations from auction proceeds.

  • Transparent and Fair Bidding Process: Bidders participate by submitting bids aligned with the Auction Module's price. The process promotes transparency and fair participation. The module uses a decremental pricing strategy to update bid prices at regular intervals.

  • Integration with Oracle Module: To ensure that auctions start at a reasonable price relative to the market, the Auction Module integrates closely with the Oracle Module for accurate and timely asset valuations. This integration sets and adjusts auction prices.

  • Handling Auction Outcomes: At the conclusion of an auction, the module handles the transfer of collateral to the highest bidder and ensures the distribution of funds to cover the debts associated with the liquidated vault. Surplus funds are either returned or redirected as per rules.

Auction Mechanism

Below are variables and formulas used to calculate auction parameters and execute auctions. Let the following be defined:

  • Quantity of collateral (e.g., number of wAR tokens) as qq

  • Price feed for the collateral currency as PP

  • Collateral value in USDA as VV

  • Collateralization factor (a multiplier based on risk assessment) as cc

  • Stability fee percentage as ss

  • USDA Loan (debt) as dd

  • Total fees calculated as FF

  • Debt including fees as dfd_f

  • Time as tt

  • Adjusted value of the collateral as VadjV_{adj}

  1. Collateral Value Calculation: V=q×PV = q \times P

    Here, VV represents the current market value of the collateral in USDA, calculated as the product of the quantity of collateral qq and its current market price per unit PP.

  2. USDA Value Calculation Adjusted for Collateralization: Vadj=c×VV_{\text{adj}} = c \times V

    The adjusted value of the collateral VadjV_{adj} considers the collateralization factor cc, which adjusts the raw market value to account for risk factors associated with the collateral type.

  3. Fees Calculation: F=s×dF = s \times d

    The total fees FF are calculated as a percentage ss of the debt dd. This includes the stability fee and potentially other fees like liquidation penalties.

  4. Debt Including Fees Calculation: df=d+Fd_f = d + F

    The total amount needed to clear the debt, dfd_f, includes the original debt dd plus the calculated fees FF.

Auction Execution Process

  1. Auction Start Price Calculation: start_price=P×(markup)\text{start\_price} = P \times (\text{markup})

    The auction's start price is set higher than the current market price PP by a certain markup percentage (e.g., 20 to 30%) to maximize the potential recovery amount.

  2. Price Decrement Over Time: current_price=start_price(decay_factor×t)\text{current\_price} = \text{start\_price} - (\text{decay\_factor} \times t)

    The current price \text{current_price} is decremented over time based on a decay factor that is calculated as a percentage reduction every set interval until it reaches or is still sufficient to cover dfd_f.

  3. Determine the Auction Closure Condition: dfcurrent_price×qd_f \leq \text{current\_price} \times q

    When a bidder pays the \text{current_price} \times q and this amount covers at least dfd_f, the auction is considered successful. The bidder receives the collateral, and the debt dd is considered settled.

  4. Auction Closure: (start_price×(1decay_factor)t×q)df(\text{start\_price} \times (1 - \text{decay\_factor})^t \times q) \geq d_f

    The auction closes successfully when the amount paid by the bidder, which is the current price of the asset multiplied by the quantity, is greater than or equal to the total debt including fees.

Oracle Module & Service

The Oracle Module is a pivotal component of the Astro Protocol, tasked with providing accurate and timely market data to various other parts of the system. This module ensures that all financial operations within the protocol are based on the most current and reliable asset valuations.

Key Functions and Role

  • Real-Time Data Feeds: The Oracle Module collects price data from multiple sources to minimize manipulation and errors. This data is crucial for the accurate valuation of collateral across the protocol.

  • Integration with Vault Contract: Real-time pricing updates are provided to the Vault Contract by the module, allowing for dynamic assessment of collateral values. This integration ensures proper collateralization and triggers liquidation if values drop.

  • Support for Liquidation and Auction Modules: The Oracle Module safeguards the protocol's financial integrity by ensuring fair valuation of assets during liquidation and auctions.

  • Price Update Mechanisms: Utilizing advanced algorithms and time-weighted averages, the Oracle Module updates prices at predefined intervals or in response to significant market movements. It helps maintain stability and predictability for protocol participants.

  • Security and Reliability Enhancements: The module incorporates features to detect and mitigate potential threats such as flash loan attacks or unusual market activity. This proactive security approach preserves the resilience and trustworthiness of the protocol.

  • Governance and Updates: The protocol's decentralized governance framework governs decisions on price feed additions or adjustments. Token holders shape the Oracle Module's evolution in line with community interests and market environment.

Oracle Module Price Update Mechanism

The Oracle Module operates by maintaining a consistent update cycle governed by predefined intervals. This ensures that all dependent contracts within the Astro Protocol receive timely and accurate market data. The Oracle Module holds the necessary information to feed accurate prices of collateral to the protocol. Let the following be defined:

  • TimeDelay: The fixed interval between price updates (typically one hour).

  • LastUpdateTime: The timestamp when the price was last updated.

  • CurrentPrice: The most recent price of the collateral.

  • NextPrice: The upcoming price of the collateral, set to be published after the TimeDelay.

  • Whitelists: A list of contract addresses that are authorized to receive updated prices after each interval.

Price Update Process The price update process can be described using the following steps and formulas:

  1. Initiating Price Updates: The Oracle Module is triggered by a regular call to an action handler (e.g., Poke). This can be automated through a cron job or similar scheduling mechanism to occur at LastUpdateTime + TimeDelay.

  2. Updating Current and Next Prices: When the Poke function is called, the Oracle Module performs the following operations:

    1. Set Current Price: CurrentPrice=NextPrice\text{CurrentPrice} = \text{NextPrice}

    2. Fetch New Price: The new price is obtained from an aggregated feed of external sources or directly from a trusted oracle service.

    3. Set Next Price: NextPrice=newly obtained price\text{NextPrice} = \text{newly obtained price}

  3. Broadcasting the Price Update: After updating the prices, the Oracle Module sends the new CurrentPrice to all contracts listed in the Whitelists. This ensures that all relevant parts of the Astro Protocol, such as the Vault Contract, are operating with the most recent price data.

Protocol Hosted Wallet (PHW)

The Protocol Hosted Wallet (PHW) is an essential component of the Astro Protocol, designed to streamline user interactions with Arweave and AO layers by managing assets directly within the protocol itself. This dedicated wallet system simplifies the user experience and enhances security by maintaining a controlled environment for asset transactions and management.

The PHW serves a critical role in the Astro Protocol by managing deposited Arweave tokens (AR) securely. Given the importance of the PHW in the ecosystem, strategic decisions regarding its governance and legal framework are paramount to ensure sustainability, security, and legal compliance.

In the early days, a community-driven model will be used so development and maintenance will be as a public good, supported by a consortium of teams from within the ecosystem, such as the Astro Labs team and other core members. Operational and maintenance responsibilities would fall to the collective comprising core community members and affiliate service providers. This structure would allow for shared responsibility, ensuring that the wallet's management remains transparent, decentralized, and aligned with the community's interests.

The PHW serves as a gateway to assets into AO, taking charge of managing users' AR deposits. It secures these assets through predefined wallets, enhancing security and simplifying operations for users within the ecosystem. Similar to the Wrapped Bitcoin (WBTC) model with BitGo as the primary custodian, consideration is being given to appointing a third-party custodial partner to oversee the development of new wallets. This partnership would improve transparency and efficiency, particularly in wrapping AR tokens for use on AO compute environments.

The PHW may be governed by two legal entities: a foundation and a trustee. The foundation would manage overarching governance, while the trustee would oversee daily operations and legal responsibilities. This dual-entity approach facilitates structured management of the PHW, with the foundation acting as a non-profit steward for the community in commercial dealings with service providers.

Bankruptcy Remote Vehicle

Incorporating the PHW within a trust's legal framework would make it bankruptcy remote, safeguarding it against the insolvency of associated entities. This setup provides a robust legal buffer, enhancing asset security for users.

Noting that as the protocol matures and grows, the needs will change for both the community at large and Astro itself, thus these considerations and approaches may differ and be adjusted as the landscape changes.

Last updated