Margin
Once a wallet is connected, the protocol will generate a margin account for traders to deposit initial funds (USDC). Traders are allowed to leverage their account value up to 2x, where account value is defined as portfolio net of borrowed value. Leverage multiple is defined as:
Lmultiple=BorrowsAccountβ€…Value=βˆ‘b=b1biloan(b)βˆ‘a=a1aipositions(a)βˆ’βˆ‘b=b1biloan(b)L_{multiple}=\frac{Borrows}{Account\: Value}=\frac{\sum_{b=b_1}^{b_i}loan(b)}{\sum_{a=a_1}^{a_i}positions(a)-\sum_{b=b_1}^{b_i}loan(b)}
position(a): position value for a given asset a a_i: asset in portfolio loan(b): loan value for a given asset b b_i: borrowed asset
The protocol stipulates that a trader must post an initial collateralization of 150% and allows for a maintenance collateralization of 125%. Having a maintenance collateralization threshold allows for some price movement in assets before a trader runs the risk of being liquidated. If a trader is liquidated the system or a liquidator will take all funds and positions in a margin account.
A trader’s margin collateral ratio is slightly different from their leverage multiple and is defined as:
Cmargin=PositionsBorrows=βˆ‘a=a1aiposition(a)βˆ‘b=b1biloan(b)C_{margin}=\frac{Positions}{Borrows}=\frac{\sum_{a=a_1}^{a_i}position(a)}{\sum_{b=b_1}^{b_i}loan(b)}
where variables are defined above.
Margin account structure was gleaned from mango markets: https://docs.mango.markets/tutorials/trade-on-mango.markets#how-to-trade-with-leverage
Copy link