> 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/for-operators/troubleshooting.md).

# Troubleshooting

## Bot does not start

| Symptom                      | Fix                                                            |
| ---------------------------- | -------------------------------------------------------------- |
| `MissingEncryptionKeyError`  | Set `ENCRYPTION_KEY` or delete `secure_storage/` to regenerate |
| `TELEGRAM_BOT_TOKEN` invalid | Regenerate from BotFather                                      |
| Import errors                | `pip install -r requirements.txt` in active venv               |

## Trading UI slow or timeout

1. Check `UI SPEED` log line for bottleneck
2. Set `LOG_LEVEL=DEBUG` temporarily
3. Verify Helius RPC not rate-limiting
4. Stage 2 audit may be pending—wait for security panel patch

## Buy/sell fails

| Error             | Action                                       |
| ----------------- | -------------------------------------------- |
| Insufficient SOL  | Fund wallet + keep rent reserve              |
| Slippage exceeded | Increase slippage preset                     |
| Route not found   | Token may be illiquid or graduated from Pump |
| RPC 429           | Wait; admin hot-swap RPC if persistent       |

## Shield not firing

1. Confirm shield ACTIVE in `/limits`
2. Check `[ORACLE] Skipped execution due to http_fallback` — WSS may be down
3. Verify `limit_engine.py` process running
4. Check presigned sell cache logs

## PnL shows wrong values

1. Ensure `assets.py` propagates `current_cycle_*` fields from `pnl_tracker.py`
2. Verify trades JSON in DB has buy/sell records
3. Partial sells should show realized SOL > 0 on Chart line
4. Invested USD = `invested_sol × live_sol_price` (not remaining cost basis)

## Database locked

* Normal under heavy load; retries should succeed
* If persistent: ensure only one `start_bot.py` instance
* Never delete `users.db`

## TG Sniper silent

* Regenerate `TG_SESSION_STRING`
* Confirm bot user is member of monitored groups
* Check Telethon not blocked by 2FA session expiry

## Leaderboard not posting

* Set `COMMUNITY_CHAT_ID` in `.env`
* Bot must be admin in target channel
* Loop runs every 8 hours on local clock boundaries

## Getting help

1. Collect last 100 lines of `bot.log`
2. Note token mint, user ID, and timestamp
3. Check Solscan for on-chain tx status


---

# 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/for-operators/troubleshooting.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.
