Sub topic 16
Managing Risk with Leverage
Assume you understand spot trading, futures, perpetual swaps, margin, funding, mark price, and liquidation. This chapter focuses on controlling risk after opening a leveraged position.
Leverage changes the size of the obligation
Leverage lets a position control more value than the margin deposited. With 10x leverage, $1,000 of margin controls about $10,000 of notional value, before fees and other adjustments.
Leverage does not change the market’s percentage movement. It changes how that movement compares with your margin. A 2% price move against a 10x position can consume roughly 20% of its initial margin. A larger position also produces larger funding payments and trading fees.
Use position size, not the leverage number alone, as the main risk control. A low-leverage position can still be too large for an account.
Size a position from a loss limit
Choose the maximum amount you are willing to lose if your planned exit is reached. Then calculate the position size:
def linear_position_size(account_equity, risk_fraction, entry, stop):
"""Returns base-asset quantity for a linear contract, before fees."""
risk_amount = account_equity * risk_fraction
price_distance = abs(entry - stop)
if price_distance <= 0:
raise ValueError("stop must differ from entry")
return risk_amount / price_distance
equity = 5000
quantity = linear_position_size(equity, 0.01, 60000, 57500)
print(f"{quantity:.4f} BTC")
print(f"Notional value: ${quantity * 60000:,.2f}")This example risks 1% of a $5,000 account, or $50. The $2,500 distance between entry and stop produces a position of 0.02 BTC. The calculation ignores fees, funding, slippage, and gaps, so actual loss can be higher.
For inverse contracts, contract size and settlement currency change the calculation. Read the venue’s contract specification before applying a linear formula.
Use margin modes deliberately
| Margin mode | What backs the position | Main risk |
|---|---|---|
| Isolated | A chosen margin amount | The position can lose its assigned margin |
| Cross | Available account collateral | One position can draw down funds needed elsewhere |
Isolated margin limits the direct blast radius of one position, but it does not prevent losses beyond the planned stop if the market moves quickly. Cross margin can delay liquidation, yet it exposes more of the account.
A stop-loss order can reduce expected loss, but liquidation is not a stop. Liquidation uses the venue’s mark price and maintenance-margin rules. Fast markets, thin order books, canceled orders, and slippage can make the realized loss different from the stop price.
Track costs and failure paths
Before entering, estimate:
- Entry and exit fees, including whether each order is a maker or taker order.
- Funding payments for a perpetual swap and how often they occur.
- Slippage if the position must be closed through limited order-book depth.
- Distance from the entry price to the liquidation price.
- Whether the venue, oracle, wallet, or smart contract can become unavailable.
- Counterparty risk, including withdrawal restrictions or exchange insolvency.
A simple control loop looks like this:
A funding rate can turn a profitable price position into a losing one over time. A positive rate usually means longs pay shorts. If the rate is large, reduce the position, hedge it, or use a product whose costs fit the holding period.
Exercise
You have $5,000 and risk 1% on a BTC linear long entered at $60,000 with a stop at $57,500. Ignoring fees and slippage, what quantity fits the risk limit?
Show answer
The risk limit is $50. The price distance is $2,500, so the quantity is $50 / $2,500 = 0.02 BTC. Its entry notional is $1,200, but the chosen leverage must still leave room for fees, funding, and liquidation risk.