> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vanna.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Margin Account

> Your personal on-chain account for depositing collateral, borrowing assets, and trading with leverage.

A Margin Account is your personal smart contract on Stellar. You deposit collateral into it, borrow assets against that collateral, and deploy those assets into trading or farming strategies - all while Vanna's risk engine monitors your position health continuously.

<Snippet file="snippets/risk-notice.mdx" />

## What you can do

<CardGroup cols={2}>
  <Card title="Open Account" icon="plus" href="/guides/margin/open-account">
    Create your Margin Account on-chain.
  </Card>

  <Card title="Deposit Collateral" icon="arrow-down-to-bracket" href="/guides/margin/deposit-collateral">
    Move assets from your wallet into your Margin Account.
  </Card>

  <Card title="Borrow" icon="hand-holding-dollar" href="/guides/margin/borrow">
    Borrow assets against your deposited collateral.
  </Card>

  <Card title="Repay" icon="arrow-up-from-bracket" href="/guides/margin/repay">
    Pay down your outstanding debt.
  </Card>

  <Card title="Transfer Collateral" icon="arrow-right-arrow-left" href="/guides/margin/transfer-collateral">
    Move assets between your wallet and Margin Account.
  </Card>

  <Card title="Health Factor" icon="heart-pulse" href="/guides/margin/health-factor">
    Understand how your position health is tracked.
  </Card>
</CardGroup>

## How it works

You deposit collateral (XLM or USDC) into your Margin Account and borrow assets against it. Borrowed assets stay inside your Margin Account - they cannot be sent directly to your wallet, but you can deploy them into Farm or Trade from within the account.

Your Health Factor - total collateral value divided by total debt value - must stay above 1.1x at all times. If it drops to 1.1x, your account becomes eligible for liquidation.

You can have one active Margin Account at a time. Closing an account and opening a new one reuses the same on-chain contract.

## Before you start

* **Wallet connected** - see [Connect Wallet](/guides/connect-wallet) if you haven't done this yet.
* **Assets in your wallet** - you need collateral (XLM or USDC) ready before you can borrow.

## Key metrics

Once your Margin Account is active, the Margin tab shows a metrics bar with three values.

| Metric                                 | What it means                                                                                                                    |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Health Factor**                      | Total collateral value divided by total debt value. Must stay above 1.1x to avoid liquidation.                                   |
| **Net Available Collateral**           | Your net equity in the account - total collateral value minus what you owe.                                                      |
| **Collateral Left Before Liquidation** | How much your collateral value can drop before your Health Factor reaches 1.1x and the account becomes eligible for liquidation. |
