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

# Infrastructure and RPC

## RPC architecture

HiperSnipe uses a **Helius-first** RPC strategy:

| Endpoint          | Use                                 |
| ----------------- | ----------------------------------- |
| `HELIUS_HTTP_URL` | Balances, sends, confirms, metadata |
| `HELIUS_WSS_URL`  | Limit engine price subscriptions    |

HTTP failover does **not** fall back to public mainnet-beta (429-prone). The bot throttles and retries Helius instead.

## Hot-swap

Admins can change RPC URL from **RPC Cockpit** without restarting. New URL is written to `global_config` and picked up by `rpc_manager.py`.

## Blockhash cache

`utils/blockhash_cache.py` rotates across available HTTP endpoints when rate-limited.

## Jupiter

| Setting           | Default                         |
| ----------------- | ------------------------------- |
| `JUPITER_API_URL` | `https://public.jupiterapi.com` |

Admin can override via Infrastructure panel (stored in DB).

## Jito

Configure `JITO_BLOCK_ENGINE_URL` to the region closest to your **server**, not your users:

* EU servers → Amsterdam or Frankfurt
* US servers → NY
* APAC → Tokyo

## Treasury and sweeps

| Variable                   | Role                         |
| -------------------------- | ---------------------------- |
| `TREASURY_PRIVATE_KEY`     | Hot fee vault                |
| `COLD_WALLET_ADDRESS`      | Auto-sweep destination       |
| `AUTO_SWEEP_THRESHOLD_USD` | Trigger threshold            |
| `AUTO_SWEEP_INTERVAL_SEC`  | Check interval (default 24h) |

`tasks/auto_sweep.py` moves excess SOL to cold storage.

## Environment vs DB config

| Source                | Examples                                |
| --------------------- | --------------------------------------- |
| `.env`                | Bot token, encryption key, initial RPC  |
| `global_config` table | Runtime RPC, Jupiter URL, sniper groups |

Changes in Admin UI override DB values; `.env` is read at process start for secrets.


---

# 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/admin/infrastructure.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.
