The margin account is the sole account that tracks all of a user's state across the exchange. There is one account, called a CrossMarginAccount, for all assets. That means you only have to deposit/withdraw once to have access to all markets.
This account stores all the necessary details for the user state bookkeeping including:
- Open orders
- Cost of trades
- Trading fees
- Funding payments
A user margin account is atomically created on deposit of USDC to the platform. There is a one time cost of ~0.01 SOL, returned when an account is closed.