The funds in your margin account are used only as collateral for these loans and to settle debts to lenders.
Let's go over them by looking at the changes to the user interface.
With the addition of margin trading, you now have three separate accounts in which you can store your deposited funds: exchange, margin, and lending.
When you close your position, your loans are settled automatically.
Your lending account holds funds you can loan to other users and earn interest on.
When you deposit funds, they first go to your exchange account.
When you borrow funds and make a trade, a position will open.
If you buy, you are opening what is called a long position. Note that as you continue to trade, your position may change; for example, if you open a short by selling 300 XMR, but then buy 600 XMR, your short will become a long.
In order to margin trade, you will need to transfer some funds to your margin account at the Transfer Balances page.
You may fund your margin account with any currency for which margin trading is enabled.
Margin trading is essentially trading with borrowed funds instead of your own.
When you place a margin order, all of the money you are using is borrowed from other users offering their funds as peer-to-peer loans.