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

# Core banking

> Run accounts, transactions, and regulatory reporting on a ledger you own, with the controls your regulator expects.

A legacy core gives you rigid schemas, vendor lock-in, and slow release cycles. Every new product or new rule turns into months of integration work. You need a system of record that you own, plus the controls and the reports your regulator asks for. A Lerian core banking stack is a ledger you own, with a decision service in front of it and a reporting engine beside it. One login covers every piece. You adopt each piece on its own, and you connect them in a deployment step.

## What you get

***

<Columns cols={3}>
  <Card title="Midaz" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/midaz-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=66030808cf88e9836f58b228bdb04718" href="/en/midaz/what-is-midaz" width="270" height="270" data-path="images/icons/midaz-yellow.png">
    The ledger. It holds organizations, ledgers, accounts, and transactions with double-entry guarantees. CRM and the Fees Engine run inside the same process.
  </Card>

  <Card title="Tracer" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/tracer-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=445902f5ff57328953d7d23ffd3f3960" href="/en/tracer/what-is-tracer" width="270" height="270" data-path="images/icons/tracer-yellow.png">
    Real-time validation in front of the ledger. It returns allow, deny, or review before your application submits the transaction.
  </Card>

  <Card title="Reporter" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/reporter-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=9b7bb2c96d24d86b973ab98b82eb825b" href="/en/reporter/what-is-reporter" width="270" height="270" data-path="images/icons/reporter-yellow.png">
    Repeatable reports from plain-text templates over the ledger tables. It renders HTML, CSV, XML, PDF, and TXT files.
  </Card>

  <Card title="Access Manager" icon="https://mintcdn.com/lerian-49cb71fc/E8ayMkxDRO5pydGF/images/icons/access-manager-yellow.png?fit=max&auto=format&n=E8ayMkxDRO5pydGF&q=85&s=2383ad0e8e8ee6f46c95a9fbeb440ab2" href="/en/platform/access-manager/access-manager" width="1249" height="1249" data-path="images/icons/access-manager-yellow.png">
    One access-control layer. It answers who makes a request, and what that caller can reach.
  </Card>

  <Card title="Console" icon="desktop" href="/en/platform/console/about-lerian-console">
    The web interface for the stack. Operators configure the products and run the daily work in one place.
  </Card>

  <Card title="Streaming Hub" icon="tower-broadcast" href="/en/streaming-hub/what-is-streaming-hub">
    The delivery edge for events. It sends ledger and Tracer facts to a webhook, a queue, or a cursor you pull.
  </Card>
</Columns>

## How the pieces fit together

***

```mermaid theme={null}
flowchart LR
  App["Your application"]
  Tracer["Tracer<br/>allow, deny, review"]
  Midaz["Midaz ledger<br/>CRM and Fees Engine inside"]
  Rep["Reporter<br/>renders report files"]
  AM["Access Manager<br/>issues tokens"]
  Hub["Streaming Hub<br/>delivers events"]
  Sink["Your webhook or queue"]
  Console["Console<br/>operates the stack"]
  App -->|"1. validate"| Tracer
  App -->|"2. submit on allow"| Midaz
  Midaz -->|"optional reservation seam, Ledger v2"| Tracer
  Rep -->|"reads ledger tables"| Midaz
  Midaz -.->|"ledger facts"| Hub
  Tracer -.->|"tracer facts"| Hub
  Hub -.->|"webhook, queue, or pull"| Sink
  AM -.->|"issues the token your application presents"| App
  Console -->|"operates"| Midaz
  Console -->|"operates"| Tracer
  Console -->|"operates"| Rep
  classDef lerian fill:#fff8e1,stroke:#f4b400,color:#333;
  classDef yours fill:#e8f0fe,stroke:#4285f4,color:#333;
  classDef ext fill:#f1f3f4,stroke:#9aa0a6,color:#333;
  class Tracer,Midaz,Rep,AM,Hub,Console lerian;
  class App,Sink yours;
```

1. Your application sends the full transaction context to Tracer. Tracer evaluates your rules and spending limits, then returns allow, deny, or review.
2. On allow, your application submits the transaction to Midaz. Tracer never calls the ledger.
3. When a fee package applies, Midaz adds the fee calculations to the transaction you submit. Your application can call the fees endpoints first to estimate them.
4. Midaz records the balanced operations. With streaming enabled, it publishes the fact on `lerian.streaming.ledger` directly after the state change.
5. Streaming Hub matches that fact against your subscriptions and delivers it to your webhook, queue, or pull cursor.
6. Reporter reads the ledger tables you registered as a data source, and renders the files your regulator asks for.

Midaz can also call Tracer for you, on a path that stays off until you configure it. Set `TRACER_BASE_URL` and a per-ledger `tracer.mode` of `advisory` or `enforce`. The Ledger HTTP v2 transaction path then holds limit capacity with Tracer before it commits. Ledger HTTP v1 never makes this call. On this path Midaz calls Tracer, and Tracer still never calls Midaz.

## What each piece owns

***

| Piece                     | Source of truth for                               | Talks to                                                 | You keep                                                                       |
| ------------------------- | ------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------ |
| Midaz                     | balances, accounts, transactions, and operations  | publishes its facts to the stream                        | your ledger data, in your database                                             |
| CRM, inside Midaz         | who is behind an account: holders and instruments | Midaz serves it on `/v2` only                            | customer attributes. Midaz encrypts the sensitive fields before it stores them |
| Fees Engine, inside Midaz | fee packages and fee calculations                 | adds calculations to the transaction you submit          | your pricing                                                                   |
| Tracer                    | rules, limits, decisions, and its own audit log   | takes calls from your application, and never calls Midaz | your policies. Tracer checks policies and limits, not account balances         |
| Reporter                  | templates, reports, and reporting deadlines       | reads PostgreSQL and MongoDB sources in one direction    | your report definitions, and the rendered files in your own bucket             |
| Access Manager            | users, tokens, and permissions                    | every product that turns on route-level enforcement      | your people and your machine-to-machine applications                           |
| Console                   | the operation screens                             | the modules you enable                                   | one login for operators. The Console does not wire the pieces together         |
| Streaming Hub             | subscriptions and delivery state                  | consumes the stream, and never produces onto it          | your sinks and your signing secrets                                            |

## Adopt it one piece at a time

***

<Steps>
  <Step title="Stand up Midaz">
    Midaz is the ledger foundation, so it comes first. CRM and the Fees Engine run inside the ledger process, so you deploy no extra service for them.
  </Step>

  <Step title="Add Access Manager">
    Access Manager issues the tokens each service trusts. Add it directly after Midaz, before any product or interface.
  </Step>

  <Step title="Put Tracer in front">
    Your application calls Tracer before it submits, and it submits to Midaz only on allow. Tracer never initiates a call to Midaz and never reads balances.
  </Step>

  <Step title="Register the ledger databases in Reporter">
    Add each Midaz database as a PostgreSQL data source with read-only credentials. Point Reporter at a read replica where you have one, so report queries stay off the ledger write path.
  </Step>

  <Step title="Enable the modules and turn on events">
    Enable the products you run from the Console settings page. Turn on streaming in Midaz when you need the facts outside the platform, because publication is off by default.
  </Step>
</Steps>

## Bring your own

***

* **Your cloud.** Run the platform in Lerian Cloud, or bring your own cloud and deploy the official Helm charts yourself.
* **Your event consumers.** Streaming Hub delivers to five sink kinds: webhook, pull, SQS, RabbitMQ, and EventBridge.
* **Your other databases.** One Reporter deployment reports over Midaz, over your own databases, and over both in the same template.
* **Your application stack.** Midaz exposes a REST API, and Lerian publishes SDKs for [Go](/en/midaz/midaz-sdk-go) and [TypeScript](/en/midaz/midaz-sdk-typescript).
* **Your reconciliation.** Add Matcher when you compare the ledger against banks and payment providers. See the [reconciliation](/en/solutions/reconciliation) solution.

## A worked example

***

A Pix cash-out moves BRL out of a customer account to an external account.

1. The customer account `customer_12345_brl` already exists. Midaz created the `@external/BRL` settlement account for you, together with the `BRL` asset.
2. Your application sends the amount, the accounts, and the context to Tracer. Tracer returns allow.
3. Your application submits 100.00 BRL against the `PIX_CASH_OUT` transaction route.
4. Midaz records two balanced operations, a debit on the customer account and a credit on `@external/BRL`. Both carry the same `transactionId`.
5. Midaz publishes `transaction.posted` on `lerian.streaming.ledger`.
6. Streaming Hub delivers that fact to your webhook, signed with an HMAC over the timestamp and the exact request body.
7. At the close of the day, Reporter renders your reconciliation file from the ledger tables.

The Pix rail itself is a separate composition. See the [payment rails](/en/solutions/payment-rails) solution.

## Start here

***

<Columns cols={3}>
  <Card title="Getting started" icon="https://mintcdn.com/lerian-49cb71fc/E8ayMkxDRO5pydGF/images/icons/code-yellow.png?fit=max&auto=format&n=E8ayMkxDRO5pydGF&q=85&s=5ff68ec60f9a6219649dc6d0457b5fa6" href="/en/getting-started" width="1249" height="1249" data-path="images/icons/code-yellow.png">
    Evaluate the platform, choose a deployment model, and run your first double-entry transaction.
  </Card>

  <Card title="Building a complete core banking" icon="vault" href="/en/building-a-complete-core-banking">
    The full stack diagram, and the wiring steps you run yourself.
  </Card>

  <Card title="Lerian Cloud and BYOC" icon="cloud" href="/en/deployment-models">
    Who operates the infrastructure in each model, and what stays on your side.
  </Card>

  <Card title="Installing Midaz" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/midaz-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=66030808cf88e9836f58b228bdb04718" href="/en/midaz/midaz-setup" width="270" height="270" data-path="images/icons/midaz-yellow.png">
    Run the full ledger environment locally with Docker Compose.
  </Card>

  <Card title="Tracer integration guide" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/tracer-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=445902f5ff57328953d7d23ffd3f3960" href="/en/tracer/integration-guide" width="270" height="270" data-path="images/icons/tracer-yellow.png">
    Where the validation call sits in your flow, and how to handle each decision.
  </Card>

  <Card title="Reporter quick start" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/reporter-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=9b7bb2c96d24d86b973ab98b82eb825b" href="/en/reporter/reporter-quick-start" width="270" height="270" data-path="images/icons/reporter-yellow.png">
    Upload a template, generate your first report, and verify the downloaded file.
  </Card>
</Columns>
