> For the complete documentation index, see [llms.txt](https://doc.lockerprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.lockerprotocol.com/hyper-agentic-trader/leaving.md).

# Stop, and take your money out

Stop the agent, close what it holds, get your USDC back, retire the trading key and remove the program.

Five steps, in this order: stop what runs, close the positions, withdraw, retire the trading key, remove the program. Each one is a command, and each one says what it did.

Your account is its recovery phrase (with Locker Vault, the 24 words you wrote on paper), and its key stays in your wallet. Nothing on this page touches either one.

## Stop what runs

```sh
lpa pilot schedule --off
```

No new day is played. What the pilot already holds is still followed every hour, to its exit, so a position is never left without the order that closes it.

```
No new day will be played. The daily pilot is not scheduled: a day is played when you run `lpa pilot run-now`. `lpa pilot schedule --on` has the service play one every day.
It still holds ETH: the service follows it every hour until the exit.
```

A grid or a range the pilot holds is followed the same way, every five minutes. With no new day played, a grid that ends is not set again and writes its balance, and a range's session ends at what would have been the next day's hour. To end one now instead:

```sh
lpa pilot end-grid --symbol BTC --close
lpa pilot end-range --symbol ETH --keep
```

Its resting orders are cancelled, its balance is written and its plan is removed. `--close` closes what it holds at the market; `--keep` leaves the position on the account as yours, with its target and its stop resting on the real account. On the real account this is your own act, and `--preview` does nothing at all.

To stop everything at once, whatever is running:

```sh
lpa panic
```

Every pilot and every copy stopped, then the key out of memory. It closes nothing.

```
The pilot: stopped. The positions it opened stay yours.
Copies: 1 stopped.
The key: locked, it left memory: nothing can be signed.
Nothing was closed and nothing was cancelled: your positions and orders stay as they are (`lpa perps positions`; `lpa perps close --all` closes them).
```

## Close the positions

Read what is open, then close it. Closing is always allowed by your limits, and a position on a market that cannot be quoted is closed all the same.

```sh
lpa perps positions
lpa perps close --all
```

```
SYMBOL      SIZE           ENTRY      VALUE          PNL            LIQUIDATION  LEV
ETH         0.0125         2463.10    $31.41         $+0.62         1904.11      3x
```

```
Closing 1 open position, reduce-only at market:
  short 0.0125 ETH at ~2512.40
Close all open positions on hyperliquid with 300 bps slippage cap? [y/N] y
ETH 0.0125: closed
1 of 1 position closed.
```

One market at a time is `lpa perps close --symbol ETH`, and it shows the exit as what it is, the side you held and what this exit leaves you, with no liquidation price: a reduce-only order opens nothing to liquidate.

```
CLOSE LONG 0.0125 ETH (reduce-only, market)
  exit         2512.40   (mid 2512.55, worst accepted 2437.17)
  notional     $31.41
  fees         0.045% ($0.0141)
  result       +$0.60   (estimate: the move from your entry at 2463.10 on this size, less this exit's fees)
Close long 0.0125 ETH? [y/N] y
Close sent.
```

It asks before it sends. `--dry-run` prepares it and signs nothing.

Closing a position does not cancel what rests beside it: the steps of a ladder, the levels of a grid, the entries of a range and a stop resting on the venue are orders, not positions. Read them and cancel what is left, one by one:

```sh
lpa perps orders
lpa perps cancel --symbol ETH --order-id 12345
```

Cancelling is always allowed by your limits. `lpa pilot end-grid` and `lpa pilot end-range` cancel a grid's or a range's own orders for you.

## Withdraw

```sh
lpa perps withdraw --amount 25
```

USDC leave the Hyperliquid account for **the same address on Arbitrum One**, the account your wallet holds. Hyperliquid charges a flat 1 USDC, and the answer says what lands: it arrives in a few minutes.

```
Withdrawal of 25 USDC to 0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE sent: 24 USDC will land on Arbitrum (1 USDC fee).
```

To send them somewhere else instead, name the address:

```sh
lpa perps withdraw --amount 25 --destination 0x1111111111111111111111111111111111111111
```

They go straight there, on Arbitrum One, with no step through your own address: the USDC deposit address of an exchange that accepts Arbitrum One, for example. Check it character by character in your wallet, because the money follows that address and nothing brings it back.

{% hint style="warning" %}
With `--destination` the Vault warns that **the destination is not the requesting account**: *A compromised computer may be redirecting your funds. Refuse unless you chose this address yourself.* That warning is expected here, because you named an address that is not your account. Refuse only if the address on the phone is not the one you chose. An extension or a mobile wallet gives no such warning of its own: the terminal says *NOT this account* before it asks, and the page shows the destination; check it there and in your wallet.
{% endhint %}

Both are signed by your account in your wallet, like every movement of funds: the agent key can never withdraw. On the Vault, the withdrawal card shows the amount, what you receive, the destination and the network, and the computer's page says what the phone must show before you hold it up.

USDC that landed on your own address on Arbitrum One are yours there. With the Vault, they move on with the Locker Protocol Wallet browser extension and the same 24 words; with an extension or a mobile wallet, from that wallet. Or they stay where they are: nothing expires. Moving them needs a little ETH on Arbitrum One for the network's fee.

## Retire the trading key

```sh
lpa agent revoke
```

Your wallet signs this. Hyperliquid has no revoke, so `lpa` approves a throwaway address under the agent's name, which replaces the key and keeps no key of its own; the sealed key is removed from your computer, and the mandate signed for that agent goes with it.

```
Agent 0x8c1f...9a2e revoked. `lpa agent renew` approves a new one.
```

Do this before you remove anything. Without it the key stays approved on Hyperliquid until its date, whatever you delete from the computer, and a copy of the sealed file plus your password would still be able to trade.

If your account signs with a mobile wallet, close its link too, so the phone no longer reaches this computer:

```sh
lpa signer forget
```

```
The link with your mobile wallet is closed: the phone no longer reaches this computer. The next signature shows a new QR.
```

`lpa reset` and `lpa uninstall --all` close it as well. Locker Vault and a browser extension keep no link to close.

## Remove the program

If you installed the service that runs round the clock, take it out of the system first, so nothing starts it again:

```sh
lpa service uninstall
```

Then the program itself:

```sh
lpa uninstall
lpa uninstall --all
```

`lpa uninstall` removes `~/.lpa/node`, `~/.lpa/lib`, `~/.lpa/bin` and the line it added to your shell's startup file. `--all` removes the whole `~/.lpa` too: the settings, the sealed agent key, the journal and the record, after closing the link with a mobile wallet at the relay when there is one. The question names every path before anything goes, and the service and the guardian are stopped first either way. A service that serves another `LPA_HOME` on the same machine is left running: remove it from that folder. What `--all` answers:

```
The service is stopped and removed from the system.
lpa is removed.
Removed its line from /Users/you/.zshrc.
Settings removed: /Users/you/.lpa.
```

Installed with npm, it is `npm uninstall -g @locker-protocol/agent-wallet-hyperliquid-trader`, and the command says so rather than removing files it did not put there.

Your account's key stays in your wallet, untouched, and its recovery phrase is the account (with the Vault, the 24 words): keep it, whatever you remove here.

{% hint style="info" %}
**None of this is needed to pause.** `lpa lock` alone takes the key out of memory, so nothing can be signed, until `lpa unlock` gives it back.
{% endhint %}

## Learn more

* [Go live under the mandate](https://doc.lockerprotocol.com/hyper-agentic-trader/go-live.md)
* [lpa perps](https://doc.lockerprotocol.com/hyper-agentic-trader/commands/perps.md)
* [lpa agent](https://doc.lockerprotocol.com/hyper-agentic-trader/commands/agent.md)
* [Housekeeping](https://doc.lockerprotocol.com/hyper-agentic-trader/commands/housekeeping.md)
