> ## Documentation Index
> Fetch the complete documentation index at: https://tradepost.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trade counts and flair

> The three flair modes and what each writes.

## Settings

| Setting                              | Default              | Values                                                         |
| ------------------------------------ | -------------------- | -------------------------------------------------------------- |
| Trade count in user flair            | Trade Post writes it | Trade Post writes it, Keep our existing bot, Leave flair alone |
| Flair for a trader with no count yet | `{count} Trades`     | Must contain `{count}`, must fit 64 characters                 |
| Your subreddit's trade bot           | *(blank)*            | A Reddit username. Only used by "Keep our existing bot"        |
| The comment your bot expects         | `{bot} {user}`       | Must contain both tokens. Only used by "Keep our existing bot" |

| Mode                  | Writes flair | Posts a comment    | Requires           |
| --------------------- | ------------ | ------------------ | ------------------ |
| Trade Post writes it  | Yes          | Completion notice  | User flair enabled |
| Keep our existing bot | No           | Your bot's command | Bot name filled in |
| Leave flair alone     | No           | Completion notice  | Nothing            |

<Info>
  Trade Post keeps its own count in every mode, including the two that write no
  flair. Switching modes later loses nothing.
</Info>

## Trade Post writes it

Reads the number already in a trader's flair, adds one, writes it back. The digits
are spliced over the old digits and every other character is left alone, so emoji,
tier words and region tags survive.

An existing swapbot history carries over on a trader's first trade here. There is
no batch job and nothing to import.

A count is recognised as digits immediately before *trades, transactions, swaps,
sales, exchanges, deals, confirmations, confirmed*, or a flair that is nothing but
a number. Not "the first number in the string", which would read `Since 2019 · 42
Trades` as 2019.

| Their flair              | Result                                              |
| ------------------------ | --------------------------------------------------- |
| Has a recognisable count | Number spliced in place                             |
| Empty                    | **Flair for a trader with no count yet** is used    |
| Text with no number      | Count appended after `\|`, if it fits 64 characters |

Reddit caps flair at 64 characters. If appending would overflow, nothing is
written. Trade Post never truncates existing flair.

A CSS class of exactly `flair-<count>` is bumped alongside the text.

Requires user flair enabled subreddit-wide, and moderator permissions on the app
account.

<Warning>
  **Test on one account first.** The first flair write clears the trader's flair
  template and background colour and forces the text colour to dark. Reddit's flair
  API replaces every field it is not given, and returns only the text and CSS class
  to read, so those are all Trade Post can preserve.
</Warning>

## Keep our existing bot

Writes no flair. When both traders confirm, each gets a button that posts the
confirmation comment as themselves, mentioning your bot and the other trader, with
their feedback underneath. Your bot handles the flair.

<Warning>
  A blank bot name saves cleanly and disarms the mode. No flair, no comment, no
  error, and the confirm button never appears.
</Warning>

The `u/` on the bot name is optional. In the comment, `{bot}` is your bot and
`{user}` is the other trader; both are required and the save is refused without
them.

## Leave flair alone

Nothing is written to flair. The completion notice still posts.

## Notes

* Negative outcomes never reach flair in any mode. Back-outs and ghosts appear only
  in [Mod tools](/moderators/mod-tools).
* The mode is read on every completed trade, so switching it off stops flair writes
  immediately, including on trades already in flight. This is the opposite of
  [the ghost window](/moderators/trade-rules#days-before-silence-counts-as-ghosting),
  which is fixed when a trade is accepted.
* Trade Post's count and the flair number can drift when a moderator or bot edits
  flair by hand, or when a count expires.
  [Rebuild trade counts](/moderators/ledger#rebuild-trade-counts) is the repair.
