# Sub-accounts

An owner is a wallet that signs in to Mosaiq with Para. Each owner has one
master account, whose address is the owner's wallet. An owner can also hold
sub-accounts. A sub-account is a separate trading account of the same owner,
with its own address, cash, positions, orders, margin, and API key. Use one to
keep a strategy apart from your other accounts.

## Create a sub-account

Create a sub-account with [`POST /v1/subAccounts`](/api/post-sub-accounts)
and your Para wallet session. An API key cannot create one. You choose the
name, and Mosaiq gives the sub-account a random address. A new sub-account has
no cash and no API key. To trade from it:

1. Move cash to it with a [`transfer`](/api/exchange#transfer).
2. Create its API key with [`POST /v1/apiKeys`](/api/api-key#create-a-key),
   with its address in `account`.

You cannot delete or rename a sub-account.
[`GET /v1/subAccounts`](/api/get-sub-accounts) lists your accounts. It also
takes the wallet session.

## How many sub-accounts you can hold

Your volume on Mosaiq sets how many sub-accounts you can hold. With no volume,
you can hold one. Each 1,000,000 USDC of volume allows one more, up to five.

| Your volume (USDC) | Sub-accounts you can hold |
| --- | --- |
| below 1,000,000 | 1 |
| 1,000,000 to below 2,000,000 | 2 |
| 2,000,000 to below 3,000,000 | 3 |
| 3,000,000 to below 4,000,000 | 4 |
| 4,000,000 and above | 5 |

Your volume is the cumulative notional of the fills that Mosaiq booked on all
your accounts. Perp fills and spot fills both count, at the fill price. Fees do
not count. Volume that you trade on a venue outside Mosaiq does not count.
Mosaiq updates your volume every 10 minutes, so a new sub-account can become
available up to 10 minutes after your volume crosses a step.

Mosaiq can raise the limit of an owner, up to five. You can then hold the
larger of the raised limit and the number in the table. Your volume never
decreases, so the number in the table never goes down.

`allowance` in `GET /v1/subAccounts` shows how many sub-accounts you can hold,
how many you hold, your volume, and the volume at which you can hold one more.

## API keys and rate limits

Each account has its own [API key](/api/api-key). A key acts for its own
account only, and no request field selects another account. Each account has
at most one active key.

Each account also has its own exchange request budget. A request on one
account never spends the budget of another. Every account of an owner gets the
owner's limit, 1,200 requests per minute by default. When Mosaiq sets
another limit for an owner, each account of the owner gets it. A new
sub-account has a full budget at once. A deposit, withdrawal, or transfer with
the wallet session spends the budget of the master account.

Other limits do not depend on the account. Your wallet can create 10 API keys
per hour for all your accounts together. The limits per IP count every request
from an IP, whatever account it acts for.
The [HTTP overview](/api/http-public#rate-limits) lists every limit, and
[`GET /v1/rateLimits`](/api/rate-limits) shows the budget of an API key's
account.

## Risk caps and margin

The caps of your tier apply to all your accounts together. For these caps,
Mosaiq adds up the master account and every sub-account:

* The number of open orders
* The notional of open orders
* The gross notional of positions and open orders
* The notional per asset and venue

For example, if your tier allows 20 open orders and the master account has 15,
all your accounts together can open 5 more. The cap on the notional of one
order applies to each order.
[`userCaps`](/api/clearinghouse-state#positions-and-margin) in
`clearinghouseState` shows the caps and the usage of all your accounts.

Margin is per account, and Mosaiq [liquidates](/concepts/liquidation) each
account on its own. A loss or a liquidation on one account never uses the cash
of another of your accounts. To add margin to an account, transfer cash to it.

## Moving cash

Deposits and withdrawals go through the master account only. A deposit credits
the master account. A deposit request with the API key of a sub-account fails
with `403`, `forbidden` and the detail `master_account_required`. A
withdrawal takes the wallet session, debits the master account, and pays your
wallet.

To move cash between your accounts, send a [`transfer`](/api/exchange#transfer)
with the wallet session. A transfer can go from the master account to a
sub-account, back to the master account, or between two sub-accounts. It is
complete when the answer arrives. The amount has at most 6 decimals and cannot
exceed the `withdrawableUsdc` of the account that sends it. To withdraw the
cash of a sub-account, transfer it to the master account first.

:::warning\[A sub-account address is not a wallet]
No one holds a private key for a sub-account address. Never send USDC to it on
Arbitrum. Mosaiq does not credit that transfer, and no one can move the USDC
out of that address.
:::

## Trades between your accounts

Your accounts can trade with each other. Mosaiq books such a trade like a trade
between two clients, with a fill and its fees on each account. Mosaiq has no
self-trade prevention between the accounts of one owner.

## Points

Your [venue points](/concepts/points) count the fees of all your accounts and
go to your wallet, the address of the master account.
[`GET /v1/points`](/api/points) shows 0 fees and 0 points for a sub-account
address.

## What is public

Account data is public by address, for a sub-account as for a master account.
Pass a sub-account address as `user` to
[`clearinghouseState`](/api/clearinghouse-state),
[`openOrders`](/api/open-orders), [`userFills`](/api/user-fills),
[`userFunding`](/api/user-funding),
[`portfolioHistory`](/api/portfolio-history), or the
[user-data WebSocket](/api/websocket). Each read shows that account only.

The link between an owner and its sub-accounts is private. Only the owner's
wallet session can list them, with `GET /v1/subAccounts`. No public read names
the owner of an account.
