> For the complete documentation index, see [llms.txt](https://docs.hipersnipe.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hipersnipe.com/features/trading-shield.md).

# Trading Shield (TP/SL)

Trading Shield is per-token automated take-profit and stop-loss.

## Opening shield config

From the token Trading UI, tap the shield row:

* **Active:** `🛡️ P: +30% | L: -50% (Fixed)`
* **Off:** `🛡️ TP & SL is OFF`

Or use `/limits` → manage shield for a token.

## Configuration

| Parameter     | Description                                      |
| ------------- | ------------------------------------------------ |
| Take Profit % | Price rise from reference to trigger sell        |
| Stop Loss %   | Price drop from reference (negative value)       |
| SL mode       | Fixed or Trailing                                |
| Sell %        | Portion to sell at each trigger (typically 100%) |

## States

| UI label        | Meaning                                       |
| --------------- | --------------------------------------------- |
| 🟢 ACTIVE       | Shield enabled and monitored by limit engine  |
| 🟡 ARMED (Auto) | Global auto-arm on; will activate on next buy |
| 🔴 OFF          | No automation                                 |

## Auto-enable

**Settings → Automation → Auto-Enable Shield** arms shields for new token buys automatically. Default is OFF.

## Execution

`limit_engine.py` watches the token's AMM pool via WSS. When price crosses TP or SL:

1. Presigned sell may fire from cache
2. Swap executed via fastest available route
3. User notified; shield row updated in `/limits`

## Disabling

Tap shield → **Disable Shield** or use `disable_shield_{mint}` callback. Manual 100% sell also disables shield for that token.

## Global defaults

**Settings → Pro Settings** defines fallback TP/SL when per-token config is empty:

* `global_tp_pct` (default +20%)
* `global_sl_pct` (default -50%)

## Related

* [Limit orders](/features/limit-orders.md)
* [Limit engine architecture](/architecture/limit-engine.md)


---

# 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://docs.hipersnipe.com/features/trading-shield.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.
