> 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/configuration.md).

# Configuration

Copy `.env.example` to `.env` and fill in values. Never commit `.env`.

## Required variables

| Variable             | Description                                                                                         |
| -------------------- | --------------------------------------------------------------------------------------------------- |
| `TELEGRAM_BOT_TOKEN` | Bot token from BotFather                                                                            |
| `HELIUS_HTTP_URL`    | Primary HTTP RPC (e.g. `https://mainnet.helius-rpc.com/?api-key=...`)                               |
| `ENCRYPTION_KEY`     | Base64 Fernet key for wallet encryption (optional if using auto-generated key in `secure_storage/`) |

## RPC and WebSocket

| Variable                              | Description                                                                                     |
| ------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `HELIUS_WSS_URL`                      | WebSocket for limit-engine price streaming. Empty = auto-derive from HTTP URL (`https` → `wss`) |
| `WSS_FALLBACK_LIST`                   | Comma-separated backup WSS endpoints                                                            |
| `MAINNET_RPC_URL` / `MAINNET_WSS_URL` | Legacy aliases during migration                                                                 |

**Note:** The bot is tuned for premium RPC (Helius or unified dRPC). HTTP failover throttles to a single backup endpoint — not a multi-URL public pool. Set both HTTP and WSS from the same provider when possible.

## Swap and MEV

| Variable                | Description                                               |
| ----------------------- | --------------------------------------------------------- |
| `PUMPFUN_API_KEY`       | PumpPortal Lightning API key                              |
| `JITO_BLOCK_ENGINE_URL` | Jito bundle endpoint (pick region closest to your server) |

Example Jito URLs:

* Amsterdam: `https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/bundles`
* Frankfurt: `https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/bundles`
* NY: `https://ny.mainnet.block-engine.jito.wtf/api/v1/bundles`

## Admin and fees

| Variable               | Description                             |
| ---------------------- | --------------------------------------- |
| `ADMIN_USER_IDS`       | Comma-separated Telegram user IDs       |
| `SERVICE_FEE_ENABLED`  | `1` to enable global service fee        |
| `SERVICE_FEE_PERCENT`  | Fee percentage (default `1`)            |
| `FEE_RECIPIENT`        | Treasury public key for fees            |
| `TREASURY_PRIVATE_KEY` | Hot vault for fee collection and sweeps |

## Community and marketing

| Variable                        | Description                                           |
| ------------------------------- | ----------------------------------------------------- |
| `COMMUNITY_CHAT_ID`             | Numeric Telegram chat ID for broadcasts               |
| `MIN_BROADCAST_PNL_PCT`         | Minimum PnL % for win-card broadcasts                 |
| `SOURCE_CALL_CHANNELS`          | Channels to mirror for call relay                     |
| `DESTINATION_COMMUNITY_CHANNEL` | Relay destination (falls back to `COMMUNITY_CHAT_ID`) |

## Twitter (optional)

Set all four for automated PnL tweet posting:

* `TWITTER_API_KEY`
* `TWITTER_API_SECRET`
* `TWITTER_ACCESS_TOKEN`
* `TWITTER_ACCESS_SECRET`

## Logging

| Variable    | Default | Description                                |
| ----------- | ------- | ------------------------------------------ |
| `LOG_LEVEL` | `INFO`  | Set to `DEBUG` for verbose RPC/swap traces |

## Runtime config in database

Some settings live in SQLite (`global_config` table) and can be changed from the Admin UI without restarting:

* Jupiter API URL
* Helius API key hot-swap
* TG Sniper group list and parameters
* Global fee toggles

See [Infrastructure and RPC](/admin/infrastructure.md).

## Next steps

* [Running the bot](/for-operators/running-the-bot.md)
* [Operator checklist](/for-operators/operator-checklist.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/for-operators/configuration.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.
