Risk Engine & Liquidation
Yamata’s risk management engine continuously monitors all perpetual positions to protect traders and the platform from excessive losses. It’s vital to understand how your margin health is calculated (e.g. Margin Ratio or LTV) and what triggers a liquidation. This section explains those concepts and the liquidation process step-by-step.
Margin Ratio and LTV
Margin Ratio and Loan-to-Value (LTV) are two sides of the same coin for evaluating your account health:
Margin Ratio (Percent Margin Level): Often defined as (Account Equity / Maintenance Margin Requirement) * 100%. A margin ratio of 100% means your equity exactly equals the minimum required – you are on the edge of liquidation. Above 100% is safe; below 100% would mean equity isn’t even covering maintenance requirement (which typically shouldn’t happen because liquidation will trigger as you approach 100%).
Loan-to-Value (LTV): Expresses risk as the portion of your collateral that is effectively utilized/at risk. Yamata defines LTV as the ratio of your “liabilities” (negative P&L and any borrowed amounts) to the total collateral value.
If you have only USDC collateral, LTV starts at 0 when you have no positions, and increases as you incur losses or withdraw collateral.
If you use non-USDC collateral, opening a position might be akin to borrowing USDC against that collateral, raising LTV.
A lower LTV = safer (lots of collateral for little exposure). Higher LTV = risky (you’ve used most of your collateral’s value to support positions).
These metrics move inversely: when margin ratio goes down, LTV goes up, and vice versa. Yamata primarily uses LTV internally to gauge risk due to multi-collateral complexity.
Account Equity: It’s important to know how we define equity:
Equity = Total Collateral Value (after haircuts) + Unrealized P&L (which can be negative or positive) + any Funding credits/debits accrued.
Collateral value for each asset = quantity * index price * weight. Sum of those plus your USDC balance gives total collateral value in USDC terms.
Maintenance Margin Requirement: This is the minimum margin needed for your open positions. It’s calculated from position notional * maintenance margin rate. For example, if maintenance margin is 2.5% of position size, a $10,000 position requires $250 in equity to avoid liquidation. Yamata might have tiered maintenance rates, but conceptually a fixed percentage per asset or per leverage tier.
Liquidation Thresholds
Yamata’s risk engine will take action as your LTV approaches critical levels:
Initial Margin vs Maintenance Margin: When you open positions, you must have the initial margin (e.g., 5% for 20× leverage). Maintenance margin might be lower (e.g., 2.5%). As long as your equity stays above maintenance margin, you’re safe. If losses accumulate and equity falls towards that threshold, that’s when trouble starts.
Warning Level: When your LTV crosses a certain point (for example, 80% or 90%), you should consider this a margin call warning. Yamata’s UI may provide alerts or color-coded risk indicators as you approach danger. At this stage, you still have time to add collateral or reduce positions manually to improve your margin ratio.
Auto-Conversion at LTV Limit: If your LTV reaches a predefined high (say 95%), Yamata will automatically attempt to reduce risk by converting some of your non-USDC collateral into USDC. This “margin call” conversion bolsters your USDC reserves to better cover losses. Essentially, the system sells a portion of your alt collateral for USDC to lower the LTV. This happens before outright liquidation and is intended to save your positions by injecting more stable collateral. You will be notified if such an event occurs.
Liquidation Trigger: If your LTV hits 100% (meaning your account equity equals the maintenance requirement, or effectively liabilities = collateral), the system will initiate liquidation. In other words, the Margin Ratio is at 100% – you’ve run out of free margin. Yamata does not allow LTV to exceed 100% (which would mean negative equity); liquidation is designed to occur just in time to prevent that.
Liquidation Process
When liquidation is triggered, here’s what happens:
Order Cancellation: First, the engine cancels any open orders you have on the order book. This includes limit orders that might be using some margin. By freeing up this reserved margin, your LTV might drop slightly. (In some cases, this can save you if the market moved back in your favor and freed margin is enough, but typically if you hit the trigger, cancellation alone won’t fully solve it.)
Position Liquidation: The engine will start closing your positions. Yamata’s liquidation mechanism will generally aim to market sell (or buy, if you’re short) your positions into the order book to reduce exposure immediately:
It may liquidate the largest position first or proportionally – specifics vary, but the goal is to reduce notional until your account health is back to acceptable levels (below 100% LTV).
In a full liquidation scenario, all positions could be closed out. If partial liquidation (reducing some positions) is enough to restore margin health (e.g., due to a quick market bounce or having one highly risky position closed), then remaining positions might be left open. However, assume worst-case that a liquidation will flatten all open positions.
Execution Method: Yamata uses a fair and efficient method to execute liquidations:
The system may place market orders on your behalf to close positions immediately at the best available price.
To minimize impact, it might break large positions into chunks or use a designated liquidator mechanism to handle it (some platforms have an auction or matching engine specifically for liquidations).
The price at which your positions get closed is determined by market liquidity. In volatile conditions, slippage can occur, and you might get a worse price than the mark price at trigger – which is why having an insurance fund or safety net is important (see below).
Post-Liquidation Accounting: After liquidation, your account is debited for the losses realized in closing the positions. Ideally, you will have some collateral left (maybe not much). Yamata guarantees no negative balance: you will not owe money even if the liquidation price was not great. Any shortfall is covered by the platform’s safety mechanisms (insurance fund or other traders via an auto-deleveraging system). In practice, Yamata’s high-performance order book and risk engine try to liquidate efficiently to avoid any shortfall at all.
Notification: You will likely receive an alert (in-app notification or email) that your account was liquidated. Post-liquidation, you might see that all positions are closed and your Perps wallet now contains only the remaining collateral (if any) after losses. It’s a hard lesson, but you can continue trading with the remaining funds or deposit more.
After Liquidation
If you get liquidated:
All your perpetual positions are closed out. You retain whatever collateral was left after the process.
You should analyze what led to the liquidation (too much leverage? not honoring a stop-loss? sudden market move?) and adjust your strategy to prevent it in future.
Yamata’s Insurance Fund: Yamata likely maintains an insurance fund to handle extreme cases where liquidation couldn’t cover the losses (for example, a gap beyond your maintenance margin). This fund accumulates from parts of fees or liquidations where there was leftover margin. It’s there to ensure solvent operation and that winning traders get paid. The details of the insurance fund are beyond scope, but it is part of risk management.
Avoiding Liquidation
Use Moderate Leverage: The higher your leverage, the smaller a price move needed to wipe out your margin. Using a moderate leverage (or none at all) gives more breathing room. For instance, at 5× leverage, a 20% adverse move could liquidate you; at 20×, only a 5% move could do it (roughly speaking).
Set Stop-Losses: Don’t rely solely on the liquidation engine as your safety net. Set your own stop-loss orders well before the liquidation point to exit trades on your terms, possibly saving more collateral. Remember, liquidation prices can sometimes be worse, whereas a stop might have gotten you out earlier.
Monitor Your LTV/Margin Ratio: Keep an eye on the risk metrics shown on the Yamata interface. If you see your margin utilization climbing or LTV% creeping up due to a losing position, take action: reduce the position, hedge, or add collateral.
Diversify Collateral: Using multiple collateral assets can help if one asset’s value is plummeting (e.g., if you only hold one volatile coin as collateral and it’s crashing, your collateral value shrinks fast). However, keep in mind correlated assets can all drop together in a market downturn.
Stay Informed: Watch funding rates and market volatility. If a big event is coming (economic news, protocol upgrades, etc.), volatility can spike. Either reduce leverage before such events or be prepared for rapid moves.
Last updated