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

# PnL sharing and social cards

HiperSnipe generates branded PnL images and can broadcast wins to community channels and X.

## In-bot PnL chart

From the Trading UI → **🔥 PnL Chart** button:

* Cycle-aware realized + unrealized breakdown
* Shareable chart image for the current position

## Social share flows

`utils/pnl_card.py`, `utils/image_generator.py`, and `utils/social_sharing.py` support:

| Channel            | Behavior                                                 |
| ------------------ | -------------------------------------------------------- |
| Telegram story     | Branded card optimized for stories                       |
| Instagram / TikTok | Copy text + image assets for manual post                 |
| Community chat     | Auto-broadcast on large wins (`utils/broadcaster.py`)    |
| X (Twitter)        | Auto-tweet when API keys configured (`utils/twitter.py`) |

## Community broadcast threshold

Set `MIN_BROADCAST_PNL_PCT` in `.env` (default **20%**). Wins at or above this ROI can trigger community win-card posts when `COMMUNITY_CHAT_ID` is set.

## Referral on tweets

`TWITTER_REFERRAL_USER_ID` attaches a referral link to automated tweets. Demo cards use `PNL_DEMO_REFERRAL_ID` (see `assets/build_pnl_demo_card.py`).

## Admin tools

| Command                  | Purpose                           |
| ------------------------ | --------------------------------- |
| `/test_win`              | Send a test win card to community |
| Admin → Revert PnL Theme | Reset card branding               |

## Related

* [Analytics and PnL](/features/analytics-pnl.md)
* [Configuration](/for-operators/configuration.md) — Twitter and community vars
* [Call relay](/admin/call-relay.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/pnl-sharing.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.
