Leverage lets you control a larger position than your cash alone would buy. At 10x, every $1 of your own cash backs $10 of stock exposure — so a 1% move in the stock becomes a 10% move in the cash you put up. That amplification is the whole point: gains and losses are multiplied by the leverage ratio.
Leverage cuts both ways
Leverage is picked per-trade, not per-portfolio. You can have a mix of 1x, 5x, and 20x positions in the same portfolio. The order form on web and iOS shows a leverage input whenever your tier supports it.
When you buy at Nx leverage, your cash balance drops by notional ÷ N — only the margin. At 10x on $1,000 of stock, cash drops by $100, not $1,000. The remaining $900 is an implicit loan from the broker, derived on read from your position row — it's never stored as a separate cash entry.
At 1x, margin equals notional so cash still drops by the full amount — nothing borrowed.
Shorts work differently
Each position tracks margin posted = notional ÷ leverage at the moment of fill. This is the real cash you spent on that trade — the same amount that left your balance.
Margin posted is the denominator in your effective-leverage display and the anchor for liquidation math.
If you add to an existing position at a different leverage, the combined effective leverage is:
effectiveLeverage = (total entry notional) / (total margin posted)Example: 1 share of a $400 stock at 1x (posts $400) plus 1 share at 10x (posts $40) gives $800 notional on $440 margin — effective leverage of ≈1.82x. It is not the average of 1x and 10x; leverage is weighted by margin, not by share count.
equity = cash + longMarketValue − shortMarketValue − marginLoan
marginLoan = Σ max(0, notional − marginPosted) over all leveraged longsThe margin loan is the sum across your leveraged longs of (notional − margin posted) — exactly the money the broker implicitly lent you on open.
This formula keeps equity honest no matter how much leverage you use. At entry, equity equals the cash you put up. As prices move, equity moves by (price change × share count) on every position — amplified on the leveraged ones because you hold more shares than cash alone would have bought.
Maintenance margin is the minimum equity that must be held against each position. The rate scales with the leverage you chose when you opened it:
| Leverage chosen | Maintenance rate | Analogous to |
|---|---|---|
| 1x – 2x | 30% | Traditional broker margin |
| 3x – 5x | 10% | Lightly levered account |
| 6x – 20x | 2.5% | Prop firm / futures-style |
| Above 20x | 0.5% | Crypto perpetuals |
Your total maintenance requirement is the sum across all positions. If equity falls below that sum, you're in a margin call. A WARNING fires when equity is within ~10% of the total.
If equity falls below the total maintenance requirement, our margin engine automatically liquidates your positions — largest unrealized loss first — one at a time until you're compliant again.
On each close:
MarginEvent is written with the liquidated order IDs for audit.Liquidations appear in your order history
LIQUIDATION so you can distinguish it from your discretionary trades. You'll also receive a real-time toast notification for every WARNING, CALL, and LIQUIDATION event.Starting state: $8,000 cash, no positions.
notional = 100 × $200 = $20,000
marginPosted = $20,000 / 10 = $2,000 (leaves cash)
marginLoan = $20,000 − $2,000 = $18,000 (implicit)
cash = $8,000 − $2,000 = $6,000
longMV = $20,000
equity = $6,000 + $20,000 − $18,000 = $8,000 ← unchangedAt entry, equity is the same as before — you just converted $2,000 of cash into $2,000 of exposure plus an $18,000 loan.
longMV = 100 × $202 = $20,200
equity = $6,000 + $20,200 − $18,000 = $8,200
gain on margin = $200 / $2,000 = +10% ← the leverage amplificationlongMV = 100 × $190 = $19,000
equity = $6,000 + $19,000 − $18,000 = $7,000
loss on equity = 12.5% hit on starting $8,000 equityAround $172 the monitor triggers liquidation and buys-to-close the position at market. The $17,200 sale proceeds repay the $18,000 loan (cash short by $800) and the margin is wiped out.
Leverage isn't the only path to a margin call — pure shorts can trigger one too.
shortProceeds = 100 × $250 = $25,000 (credits cash)
cash = $25,000 + $25,000 = $50,000
shortMV = 100 × $250 = $25,000 (you owe this back)
equity = $50,000 − $25,000 = $25,000 ← healthyshortMV = 100 × $400 = $40,000
equity = $50,000 − $40,000 = $10,000
maintenanceReq = 30% × $40,000 = $12,000
equity < maint → margin call → buy-to-cover the shortBuying power tells you how much additional notional you could open right now without breaching any constraint. Two ceilings apply simultaneously:
maxExtraNotional = (equity − currentMaintenance) / MMR_at_leveragemaxExtraNotional = cash × leverageYour displayed buying power is whichever of the two is smaller.
Don't use 100% of buying power
MongoTrader intentionally skips some real-broker mechanics to keep paper trading simple:
For programmatic access to the margin system (equity, buying power, liquidation prices), see the API Documentation for the portfolio and position endpoints.