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_valueis the market value of open positions at the current oracle price.initial_position_market_valueis the market value of open positions at the oracle price when the position was opened.position_locked_collateralis the amount of USDC collateral used to open up a position.position_marginis computed asposition_market_value / position_locked_collateralinitial_margin_requirementis the maximum valueposition_margincan take when opening a position.maintenance_margin_requirementis the minimum valueposition_margincan 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_marginis 5.initial_margin_requirementis met and so the user is allowed to open the position.maintenance_margin_requirementis 4 ((100 - 20)/20). - The position increases in value to $120:
position_marginis 6.maintenance_margin_requirementis 4. - The position decreases in value to $110:
position_marginis 5.5.maintenance_margin_requirementis 4. - The position value decreases to $79.
position_marginis 3.95.maintenance_margin_requirementis 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.