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

# Treasury and auto-sweep

Fee collection, promo grants, and cold-wallet sweeps flow through the treasury hot wallet.

## Key configuration

| Variable                   | Purpose                                                   |
| -------------------------- | --------------------------------------------------------- |
| `TREASURY_PRIVATE_KEY`     | Hot vault keypair — collects fees, pays promos            |
| `FEE_RECIPIENT`            | Public key for fees (overridden when treasury key is set) |
| `BOT_TREASURY_WALLET`      | Dust-to-Gold fee recipient                                |
| `COLD_WALLET_ADDRESS`      | Cold storage destination for sweeps                       |
| `AUTO_SWEEP_THRESHOLD_USD` | Balance above which auto-sweep runs                       |
| `AUTO_SWEEP_BUFFER_USD`    | USD buffer left on hot wallet                             |
| `AUTO_SWEEP_INTERVAL_SEC`  | Sweep loop interval                                       |

Dust-to-Gold monetization vars: `DUST_TO_GOLD_FEE_PCT`, `DUST_TO_GOLD_AFFILIATE_CUT_PCT`, `DUST_TO_GOLD_SOL_BUFFER`.

## Admin UI

| Entry                     | Action                            |
| ------------------------- | --------------------------------- |
| **🏦 Configure Treasury** | View/edit treasury settings       |
| **💰 Fee Control**        | Global fee toggle, buy/sell %     |
| **🧧 Grant Promo**        | Credit user wallets from treasury |

## Commands

| Command        | Purpose                                        |
| -------------- | ---------------------------------------------- |
| `/sweep_vault` | Manual sweep excess SOL to cold wallet         |
| `/grant_promo` | CLI promo grant (also available via admin GUI) |

## Auto-sweep worker

`tasks/auto_sweep.py` runs on an interval when configured. Compares hot-wallet USD value to threshold and sends excess to `COLD_WALLET_ADDRESS`.

## Security

* Treasury private key is highly sensitive — restrict server access and never commit to git
* Admin-only commands are gated by `ADMIN_USER_IDS`
* Treasury actions are logged to `bot.log` and `security.log`

## Related

* [Admin dashboard](/admin/admin-dashboard.md)
* [Admin commands reference](/admin/commands-reference.md)
* [Configuration](/for-operators/configuration.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/admin/treasury.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.
