<!-- https://zunder-design-preview.pages.dev/docs/start/quickstart · Markdown version of the page -->

# Quickstart in paper mode

Install Guard, load your rules, and point a bot at it in paper mode. Paper mode uses Hyperliquid's real prices and sends no orders.

:::note[Planned]
Every command on this page matches Guard's v1.0.0 release (the same source as `deploy/guard`). The release is not published yet; the commands work from the day it is.
:::

Paper mode is where every Guard starts. It reads Hyperliquid's real prices and your real account, judges every order with the same rules, and records what it would have done. It sends nothing to Hyperliquid's `/exchange` endpoint.

## 1. Install and set up, with your rules

Run Guard on the machine where your bot runs: the setup detects your system (macOS, Linux, Windows or Docker). A server you reach over SSH is the other way. The setup carries the rules you set on this site (Backtest, Watch or the homepage), stored in your browser as a rules code that starts with `zr1_`; otherwise the defaults. It starts in paper mode.

Run it on the machine where your bot runs. With the default rules (the page fills in your own and detects your system); every command matches Guard's v1.0.0 release:

**macOS**

```sh
curl -fsSL https://zunder-design-preview.pages.dev/i | sh -s -- --rules zr1_eyJ2IjoxLCJtYXhMZXZlcmFnZSI6NSwibWF4TG9zc0F0U3RvcFBjdCI6Miwic3RvcFBvbGljeSI6ImF0dGFjaCIsImRlZmF1bHRTdG9wRGlzdGFuY2VQY3QiOjIsIm1pbkxpcURpc3RhbmNlUGN0IjoxMCwibWF4UG9zaXRpb25QY3QiOjIwMCwibWF4T3BlblJpc2tQY3QiOjYsImRhaWx5TG9zc1N0b3BQY3QiOjYsImRyYXdkb3duSGFsdFBjdCI6MjUsIm1hcmtldHMiOlsiKiJdfQ
```

**Linux**

```sh
curl -fsSL https://zunder-design-preview.pages.dev/i | sh -s -- --rules zr1_eyJ2IjoxLCJtYXhMZXZlcmFnZSI6NSwibWF4TG9zc0F0U3RvcFBjdCI6Miwic3RvcFBvbGljeSI6ImF0dGFjaCIsImRlZmF1bHRTdG9wRGlzdGFuY2VQY3QiOjIsIm1pbkxpcURpc3RhbmNlUGN0IjoxMCwibWF4UG9zaXRpb25QY3QiOjIwMCwibWF4T3BlblJpc2tQY3QiOjYsImRhaWx5TG9zc1N0b3BQY3QiOjYsImRyYXdkb3duSGFsdFBjdCI6MjUsIm1hcmtldHMiOlsiKiJdfQ
```

**Windows**

```
& ([scriptblock]::Create((irm https://zunder-design-preview.pages.dev/i.ps1))) -Rules zr1_eyJ2IjoxLCJtYXhMZXZlcmFnZSI6NSwibWF4TG9zc0F0U3RvcFBjdCI6Miwic3RvcFBvbGljeSI6ImF0dGFjaCIsImRlZmF1bHRTdG9wRGlzdGFuY2VQY3QiOjIsIm1pbkxpcURpc3RhbmNlUGN0IjoxMCwibWF4UG9zaXRpb25QY3QiOjIwMCwibWF4T3BlblJpc2tQY3QiOjYsImRhaWx5TG9zc1N0b3BQY3QiOjYsImRyYXdkb3duSGFsdFBjdCI6MjUsIm1hcmtldHMiOlsiKiJdfQ
```

**Docker**

```
# 1. guided setup: rules, account, mode and (testnet) the key, with hidden input
docker run -it --rm -v zunder-guard:/data ghcr.io/zunderlabs/zunder-guard:v1.0.0 init --interactive --rules zr1_eyJ2IjoxLCJtYXhMZXZlcmFnZSI6NSwibWF4TG9zc0F0U3RvcFBjdCI6Miwic3RvcFBvbGljeSI6ImF0dGFjaCIsImRlZmF1bHRTdG9wRGlzdGFuY2VQY3QiOjIsIm1pbkxpcURpc3RhbmNlUGN0IjoxMCwibWF4UG9zaXRpb25QY3QiOjIwMCwibWF4T3BlblJpc2tQY3QiOjYsImRhaWx5TG9zc1N0b3BQY3QiOjYsImRyYXdkb3duSGFsdFBjdCI6MjUsIm1hcmtldHMiOlsiKiJdfQ
# 2. run it, reachable from this machine only
docker run -d --name zunder-guard --init --restart unless-stopped -v zunder-guard:/data -e ZUNDER_GUARD_LISTEN=0.0.0.0:8547 -p 127.0.0.1:8547:8547 ghcr.io/zunderlabs/zunder-guard:v1.0.0
```

**On a server (SSH)**, from your computer:

```sh
ssh -t you@your-server "curl -fsSL https://zunder-design-preview.pages.dev/i | sh -s -- --rules zr1_eyJ2IjoxLCJtYXhMZXZlcmFnZSI6NSwibWF4TG9zc0F0U3RvcFBjdCI6Miwic3RvcFBvbGljeSI6ImF0dGFjaCIsImRlZmF1bHRTdG9wRGlzdGFuY2VQY3QiOjIsIm1pbkxpcURpc3RhbmNlUGN0IjoxMCwibWF4UG9zaXRpb25QY3QiOjIwMCwibWF4T3BlblJpc2tQY3QiOjYsImRhaWx5TG9zc1N0b3BQY3QiOjYsImRyYXdkb3duSGFsdFBjdCI6MjUsIm1hcmtldHMiOlsiKiJdfQ"
```

The API wallet key is typed into Guard's hidden prompt where Guard runs; it is never part of a command.

The default rules are: 5x leverage, 2% loss at the stop, no stop: Guard sets one 2% away, liquidation at least 10% away, a position at most 200% of equity, 6% open risk, 6% daily loss stop, 25% drawdown halt, all markets. The format is on [Rules codes](https://zunder-design-preview.pages.dev/docs/reference/rules-schema).

The setup prints a **client key** for your bot. The client key is not your API wallet key. Hyperliquid does not accept it. Only your Guard does. Guard listens on `http://127.0.0.1:8547`, on your machine only.

## 2. Point your bot at Guard

One setting changes: the API URL. The private key becomes the client key the setup printed.

```python
from eth_account import Account
from hyperliquid.exchange import Exchange

client_key = Account.from_key("0x...")          # the client key Guard printed
exchange = Exchange(client_key, base_url="http://127.0.0.1:8547",
                    account_address="0xYourAccountAddress")
```

Guides for ccxt, Freqtrade, the TypeScript SDK, MCP and TradingView are under [Integrations](https://zunder-design-preview.pages.dev/docs/integrations).

## 3. Send an order and read the answer

Send one order your bot would normally send. In paper mode the answer your bot gets says what Guard would have done: `Zunder Guard paper mode: would resize [resized]: … (nothing was sent)`. To see Guard's state and its decisions:

```sh
curl -s http://127.0.0.1:8547/guard/status              # mode, risk state, positions, alerts
curl -s 'http://127.0.0.1:8547/guard/events?since=0'    # every decision, with its rule and code
```

You see the decision (allow, resize or veto), the rule that decided, and what would have been sent. Nothing reached Hyperliquid, because this is paper mode. The fields are listed in [Events](https://zunder-design-preview.pages.dev/docs/reference/events).

## Next: testnet, then mainnet

- **Testnet** sends real orders to Hyperliquid testnet with test money. Use it to see stops rest on the venue and fire.
- **Mainnet** needs you to type the network and confirm the account. Guard never moves there by itself.

Details: [Paper, testnet and mainnet](https://zunder-design-preview.pages.dev/docs/concepts/networks).
