> ## 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 ledger

> The wiki record of every resolved trade, and the tool that rebuilds counts from it.

The ledger is a wiki page in your subreddit at `tradepost/ledger`: an index plus
one page per month. Both are moderators-only and unlisted, so the index is the way
in. Reach it from **Mod tools → Open the ledger**.

It stores no content. Each line points at the Reddit comment that already records
the trade.

## Line format

| Column           | Contents                              |
| ---------------- | ------------------------------------- |
| resolved (UTC)   | When, to the minute                   |
| trade            | Trade id                              |
| lister / offerer | Both traders' Reddit account ids      |
| outcome          | `completed`, `backedOut` or `ghosted` |
| at fault         | Which side, or `-` for a completion   |
| thread           | Permalink to the comment              |

No usernames, item names, prices, prose or titles.

## Writes

A line is queued when a trade resolves and written on the half hour. A trade
completing at 14:05 appears at 14:30.

Each month is its own page and a finished month is never rewritten, with one
exception noted below. Reddit versions every wiki revision, so edits show in the
page history.

A month whose writes keep failing is set aside after six consecutive attempts, so
one broken month does not block the rest. Nothing is deleted; the lines are
quarantined and need a hand to restore.

## Rebuild trade counts

Repairs `rep` records from the ledger pages. Also rewrites the index and re-formats
any month page still in the old layout.

|                |                              |
| -------------- | ---------------------------- |
| Duration       | Up to 20 seconds             |
| Window         | 180 days                     |
| Safe to repeat | Yes. It never lowers a count |
| Scheduled      | No                           |

**Use it when** a trader's count vanished, counts look wrong after an incident, the
index is missing or stale, or a month page renders as one paragraph instead of a
table. That last case is the only thing that rewrites a finished month.

**"Incomplete" is a report, not an error.** The message says whether to run it
again, or that Reddit's account lookup is not answering and nothing was written, or
that the window is too large to rebuild from the app.

**It does not** reverse, decrement or remove anything, and it will not raise the
number in the trader lookup above what the flair says. It reclassifies rather than
adds.

<Warning>
  Prose typed onto a ledger page does not survive a reformat. The rebuild re-emits
  the page from the lines it can parse.
</Warning>

## Editing by hand

You can edit the pages; they are wikis and you are a moderator. A malformed line is
skipped rather than breaking a rebuild. Every edit leaves a Reddit revision.
