Classic Mode
Blackwing also supports Classic Mode - margin trading without using Limitless Pools. Classic mode works similarly to other margin trading protocols - users are able to open leveraged positions by supplying collateral but they are liquidated if the value of their position drops below a certain threshold. Positions in Classic Mode are not composable, use isolated margin, and only support USDC as collateral and the quote currency.
A user might want to use Classic Mode because the asset they want to trade isn't supported by Limitless Pools.
For exact details on how a Classic Mode trades are executed, see the [Intent Solver ]
Margin Engine
Classic Mode margin calculations involve position_market_value
, initial_position_market_value
, position_locked_collateral
, position_margin
, initial_margin_requirement
, and maintenance_margin_requirement
.
position_market_value
is the market value of open positions at the current oracle price.initial_position_market_value
is the market value of open positions at the oracle price when the position was opened.position_locked_collateral
is the amount of USDC collateral used to open up a position.position_margin
is computed asposition_market_value / position_locked_collateral
initial_margin_requirement
is the maximum valueposition_margin
can take when opening a position.maintenance_margin_requirement
is the minimum valueposition_margin
can be before it is liquidated.
initial_margin_requirement
is a static configured value for each market. For example, if max leverage for a market is set to 5x, the initial_margin_requirement
is 5.
maintenance_margin_requirement
is calculated as (initial_position_market_value - position_locked_collateral) / position_locked_collateral
.
Example (initial_margin_requirement := 5
):
- A user opens a $100 5x long position for WIF:
position_margin
is 5.initial_margin_requirement
is met and so the user is allowed to open the position.maintenance_margin_requirement
is 4 ((100 - 20)/20). - The position increases in value to $120:
position_margin
is 6.maintenance_margin_requirement
is 4. - The position decreases in value to $110:
position_margin
is 5.5.maintenance_margin_requirement
is 4. - The position value decreases to $79.
position_margin
is 3.95.maintenance_margin_requirement
is still 4. Because the user can't meet their maintenance requirement, the position is liquidated.
Additional risk parameters include:
loan_book_cap
: a max amount of leverage the protocol is allowed to give out.withdraw_threshold
: max amount of money a user is allowed to withdraw without review
Liquidation
When a position is able to be liquidated, anyone is able to permissionlessly liquidate the position on the destination chain. Closing the position yields the liquidator a liquidation reward while remaining collateral is returned to the user.