> For the complete documentation index, see [llms.txt](https://botlyz.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://botlyz.gitbook.io/docs/english/comprendre-l1-l2.md).

# Understanding how it works and why your funds are safe

This page explains, in plain language, how your money is organised at Lighter and why Botlyz can never move it out of your hands. It is the plain-English companion to the [Security: non-custodial model](/docs/english/securite-non-custodial.md) page and to the [Connect your account to Botlyz](/docs/english/installation-pas-a-pas/connecter-un-compte-lighter.md) guide.

> **Important**: Botlyz is an **automation tool**, not a fund manager. You keep full control of your money. Nothing below removes market or liquidation risk, which remains entirely your responsibility.

## The picture to remember: a safe whose top lock only you hold

Picture a two-level safe.

* **The top of the safe is your wallet** (MetaMask, Ledger, etc.). It is the "owner". You are the only person who holds its key. No one can open this level for you, not Botlyz, not anyone.
* **Inside, Lighter places a drawer dedicated to trading.** This is what we call a **trading sub-account**. Your money is deposited there so orders can be placed, but that drawer stays locked inside your safe.

Only you, with the top key (your wallet), can take money out of the safe. Botlyz only receives a very limited tool that acts **solely inside the trading drawer**.

## 1. Your wallet is the owner

When you connect to Lighter with your wallet, that wallet becomes the **owner** of your account. It is the top layer, the one that commands everything else.

* Your wallet holds your **private key** and your **secret phrase** (the 12 words). They never leave your device.
* Botlyz **never** has access to this level. It does not see your secret phrase, does not store it, and cannot guess it.

This is the most important point: as long as you keep your wallet to yourself, no one can decide on your behalf what leaves your account.

## 2. Lighter creates a trading sub-account underneath

A **trading sub-account** is simply a separate space, attached to your owner wallet, that Lighter uses for trading.

* This sub-account is **created automatically on your first deposit** to Lighter. There is nothing special for you to do.
* It always stays **attached to your wallet**: it is your wallet, and only your wallet, that commands this sub-account at the owner level.
* This is where your strategies place orders.

Think of it as the "trading" drawer inside your safe: handy for working, but always locked in your possession.

## 3. The API key only drives the sub-account: it can only trade

So Botlyz can place orders for you, you create an **API key**. An API key is a kind of very limited access badge: it is used to give precise instructions, without handing over full powers.

This API key:

* ✅ Can **place and cancel orders** in your trading sub-account.
* ✅ Can **read your balance and positions** (to track performance).
* ❌ Cannot **withdraw** your money to an external address.
* ❌ Cannot **transfer** your money elsewhere.
* ❌ Cannot **touch** your owner wallet.

This is what we call a **"trade-only"** key (limited to trading). When you create it at Lighter (the **"Generate API Key"** button), you simply give it an **index between 4 and 254**: there is **no permission to set**, a Lighter key is trade-only by design. Lighter then shows you the **private key only once** (copy it right away). On the Botlyz side, this key is **encrypted at rest**: it is never kept in plain text.

For the detailed procedure, see [Connect your account to Botlyz](/docs/english/installation-pas-a-pas/connecter-un-compte-lighter.md).

## 4. Botlyz can never move your funds out

Let us put the three ideas together.

* Botlyz holds **only** the trade-only API key, which acts only inside the trading sub-account.
* Botlyz has **no access** to your owner wallet, the only layer able to authorise money leaving.
* A withdrawal can therefore never go to an address chosen by Botlyz.

Result: **a withdrawal can only come back to your own wallet**, and **you** are the one who triggers it, with your wallet. Botlyz has no way to redirect your money elsewhere. The worst that access to the API key would allow is placing trading orders (which may cause losses), never emptying your account to the outside.

## Frequently asked questions

**Q. Can Botlyz steal my funds?**

No. Botlyz only holds a trade-only API key, which acts solely inside your trading sub-account and allows no withdrawal to the outside. Botlyz never has access to your owner wallet, the only layer that could authorise money leaving. Your funds can only come back to your own wallet, and you are the one who triggers it.

**Q. What happens if Botlyz disappears overnight?**

Your funds stay with you, in your Lighter account, under the control of your wallet. Botlyz does not host them and does not lock them. You can always connect to Lighter with your wallet to manage or withdraw your money.

**Q. Can I revoke the API key?**

Yes, at any time and without going through Botlyz. Go to [app.lighter.xyz/apikeys](https://app.lighter.xyz/apikeys), connect with your wallet and delete the key. Botlyz will no longer be able to place orders, but your funds stay intact in your account.

**Q. Do I have to create the trading sub-account myself?**

No. Lighter creates it automatically on your first deposit. There is nothing special for you to set up.

**Q. Can the API key send my money to someone else's address?**

No. A trade-only key can neither withdraw nor transfer funds. The only possible withdrawal brings the money back to your own owner wallet, and only you can trigger it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://botlyz.gitbook.io/docs/english/comprendre-l1-l2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
