# Account Model

Lynx uses a two-level account hierarchy: a **main account** and the **sub-accounts** it creates.

## Two Kinds Of Accounts

| Kind            | Has its own private key?                    | Created by                                 | Can withdraw / transfer itself?                               |
| --------------- | ------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------- |
| **Main**        | Yes                                         | Any deposit to a fresh EVM address         | Yes                                                           |
| **Sub-account** | **No** — controlled exclusively by its main | `POST /v1/account/create-sub` (main signs) | No — the main account moves funds via `transfer (sub → main)` |

### Main → Sub-Account

The main account creates a new on-chain address that **has no private key of its own**. The main account has total control: it places trades on the sub-account, and moves funds in and out via internal transfer.

| Constraint     | Rule                                                                    |
| -------------- | ----------------------------------------------------------------------- |
| One level only | A sub-account cannot itself create sub-accounts. Maximum depth = 2.     |
| Quotas         | Each main account has a maximum number of sub-accounts (VIP-dependent). |

## Permission Matrix

Read this table as "Can ⟨signer-column⟩ perform ⟨row-action⟩?"

| Action                        | Main private key | Main Agent | Sub Agent |
| ----------------------------- | :--------------: | :--------: | :-------: |
| Trade (main account)          |         ✅        |      ✅     |     —     |
| Trade (sub-account)           |         ✅        |      ✅     |     ✅     |
| Transfer / withdraw from main |         ✅        |      —     |     —     |
| Transfer sub → main           |         ✅        |      —     |     —     |
| Create sub-account            |         ✅        |      —     |     —     |

> Sub-accounts have no independent private key, so all sub-account operations are executed by either the main private key or a sub-account Agent Key.

## Querying Relationships

| Endpoint                                  | What it returns                                                    |
| ----------------------------------------- | ------------------------------------------------------------------ |
| `GET /v1/account/children?address=<main>` | All sub-accounts under this main account.                          |
| `GET /v1/account/main?address=<sub>`      | The main account address (or `null` if the address is standalone). |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lynxtrade.world/authentication/account-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
