Start
Margin accounts
A margin account holds your deposits, your borrows and your positions. Deposits back plain borrows together; each range and perp carries its own margin.
What an account holds
| Holding | What it is | How it is margined |
|---|---|---|
| Deposits | Tokens supplied to Lend reserves. They earn the supply rate. | Cross: all deposits back all plain borrows |
| Borrows | Tokens borrowed from Lend reserves to your wallet. | Cross: measured by account health |
| Ranges | Liquidity positions in Pools, with or without leverage. | Isolated: each has its own margin |
| Perps | Leveraged longs and shorts. | Isolated: each has its own margin |
One wallet can open several accounts, to keep strategies apart. Every deposit counts as collateral from the moment it lands; there is nothing to switch on.
Borrow limit
Each reserve has a collateral weight: the share of a deposit’s value you can borrow against. Your borrow limit is the weighted value of everything you have deposited.
- depositᵢ
- your balance in reserve i
- priceᵢ
- its oracle price
- weightᵢ
- the reserve’s collateral weight
A borrow or a withdrawal goes through when the value of your borrows stays at or under the limit afterwards.
Health
Health compares your deposits with your borrows, using each reserve’s liquidation threshold, which sits above its collateral weight. The gap between the two is the room a fully borrowed account has before liquidation.
- thresholdᵢ
- the reserve’s liquidation threshold
- borrowⱼ
- your debt in reserve j
For example, an account holds 10 SOL at 180 USDC and has borrowed 1,000 USDC. SOL’s liquidation threshold is 85%, so its health is 1,800 × 0.85 ÷ 1,000 = 1.53.
Depositing or repaying raises health. Borrowing, withdrawing, interest on your borrows and a fall in your collateral’s price lower it. What happens below 1 is on Liquidations.
Isolated positions
Opening a range or a perp moves margin out of your deposits and into the position. From then on the position stands alone: it has its own debt, its own margin ratio and its own liquidation level, and it never draws on the rest of your account.
- Add margin at any time to move the liquidation level away from the price.
- Remove margin down to the position’s opening requirement.
- Close all or part of it. The tokens left after its debt is repaid return to your account as deposits.
Margin ratios are defined on Leveraged ranges and Perpetuals.