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

# Money and the ledger

> How Civic stores money, and why balances are reliable.

You do not need this page to use Civic. Read it if you want to understand how the money is handled.

## Amounts are exact

Civic stores money as **whole minor units** — the smallest unit of your currency — never as a decimal that can drift.

With two decimal places, `$12.34` is stored as the integer `1234`. Every calculation is done on these integers, so totals always add up exactly. A balance is only ever turned into a friendly `$12.34` for display.

## Accounts

Each member has two accounts:

| Account | Purpose |
| - | - |
| **Wallet** | Spendable money. Payments send from here. |
| **Bank** | Money being stored. |

Civic also keeps two internal accounts, which you never see directly:

* One that **creates** money when income is paid or a balance is increased.
* One that **removes** money when a balance is decreased.

This lets Civic issue and sink money cleanly, and audit where it went.

## The ledger

Every movement of money is recorded once, and it is designed so that it cannot be quietly changed.

* Each movement creates **two or more entries** that sum to **exactly zero** — money leaves one place and arrives in another.
* Member accounts **cannot go below zero**. A request that would do so is refused.
* Entries are **append-only**. Nothing is edited in place; corrections are made with a new entry.
* Each entry records the balance after it, so history is reproducible.

## No double payments

Every movement carries a **reference**. If the same request arrives twice — a repeated click, a retry after a network blip, a worker restarting mid-payout — Civic recognises the reference and returns the original result instead of paying again.

> [!NOTE]
>
> This is why Civic can safely retry after a crash. It is also why a member will never be paid twice for the same day.

## Frozen accounts

An administrator can freeze an account. While frozen, no money can move in or out of it. Balances are kept, and the freeze is recorded in the audit log.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.