Architecture

The Margin Account Architecture in Vanna Protocol is a complex and well-structured framework that allows traders to open multiple margin accounts, enabling them to borrow leverage and strategically deploy capital across various DeFi protocols. The diagram illustrates how traders interact with different components, ensuring that borrowing, risk management, and trading are seamlessly executed. Here’s a revised breakdown of the architecture based on the flow:
Traders begin by opening a margin account. This step is initiated through the Margin Account Factory, which is designed to create multiple margin accounts for a trader. Each account is used for borrowing, trading with leverage, and managing risks across the protocol.
The Margin Account Factory is the core system that facilitates the creation of new, isolated margin accounts. Each trader can have multiple margin accounts that serve as the primary interface for collateral deposits, leverage borrowing, and trading across different markets.
Lending Pool is the source of capital that traders borrow from. It consists of assets such as USDT, USDC, WBTC, ETH, and DAI, which traders can access by depositing collateral.
This pool operates based on a Rate Model that determines how much interest traders pay on the borrowed margin. The rate fluctuates depending on factors like pool utilization.
After the account is created and collateral is deposited, the Margin Account draws borrowing power from the lending pool. It acts as a smart contract where the funds are stored and deployed for trading across integrated DeFi protocols.
A Risk Model ensures that the account is healthy by evaluating the balance between collateral and borrowed debt, preventing liquidation unless the trader’s health factor falls below acceptable levels.
The Margin Manager oversees the health and functionality of each margin account. It ensures traders can only deploy their margin across approved protocols and continuously checks the account’s health, allowing or blocking trades based on the available borrowing power and health factor.
Traders can access various DeFi markets, including options, perpetuals, and spot markets, via Derivative Protocols integrated with Vanna. Examples include GMX and MUX for perpetuals, Lyra and Aevo for options, and Uniswap for spot trades.
The Individual Oracle calculates each trader’s overall position across integrated protocols. It determines the current standing of a trader’s positions, enabling real-time monitoring of trades and positions.
The Price Oracle pulls real-time data on asset prices, feeding into the system to update the value of collateral and trading positions. This data is used for liquidation triggers, health factor recalculations, and trade executions.
The Adaptor ensures all data from various DeFi protocols is standardized for use in the margin account system. It works with the Price Oracle to ensure that accurate trade data flows seamlessly between protocols, ensuring correct margin usage across integrated platforms.
The Rate Model plays a critical role in determining the interest rates for borrowing from the lending pool. The more the lending pool is utilized, the higher the rates, ensuring efficient capital use and balancing demand from traders.
Key Points:
Risk Model & Health Checks: These safeguards protect both traders and the protocol from excessive risk by ensuring that trades are only executed if the account remains solvent.
Derivative Protocol Integration: Vanna integrates multiple DeFi protocols, enabling traders to deploy margin strategically across a wide range of markets.
Oracles: Oracles provide the critical real-time data needed for accurate pricing, liquidation, and health factor adjustments.
In conclusion, Vanna’s Margin Account Architecture provides traders with the flexibility to create isolated margin accounts through the Margin Account Factory, ensuring that their borrowing, trading, and risk management processes are efficiently handled. With built-in risk management systems continuously monitoring each margin account for health and solvency, traders can confidently execute their strategies across multiple DeFi protocols, knowing their positions are well-protected.
Last updated