Margin Accounting Formulas
A margin account is a ledger within a ledger, keeping track of assets and liabilities that the user has accrued through their interaction with integrated products. It is through the margin account that a user's deposits are used as collateral, allowing them to borrow assets or take other risk positions.
Margin accounts also serve a critical role in risk management, ensuring Glow Finance remains solvent by triggering liquidations when an account becomes unhealthy.
Key Properties of Margin Accounts
- Users may open multiple margin accounts under a single wallet.
- Accounts are isolated: Liquidation in one margin account does not impact other accounts.
- Users can switch between accounts seamlessly and transfer assets between them.
A particular user, identified by a public key, may have multiple margin accounts. These accounts can be named for easy reference. The app allows seamless switching between margin accounts and for transferring assets between them.
From a risk perspective, all margin accounts are completely isolated. Liquidations only affect a particular unhealthy account, even if the user being liquidated also owns other margin accounts.
Accounting Overview
From an accounting perspective, a margin account can be viewed as a list of assets and a list of liabilities. Margin accounting proceeds in terms of the USD value of these positions.
Assets and Liabilities
The assets (A) and liabilities (L) of the margin account are given by:
where:
- represents the USD value of assets.
- represents the USD value of liabilities.
Equity Calculation
The equity (E), also referred to as the account value, is calculated as:
E = A - L
This represents the net value of the account after subtracting liabilities from assets.
Weighted Collateral Calculation
A margin account is required to have a minimum amount of equity in order to be considered healthy. The amount depends on the composition of assets and liabilities.
Collateral weights determine the contribution of assets to weighted collateral, which is given by: