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

# About Midaz

> High-level overview of Midaz architecture and core components

export const GMetadata = ({children}) => <Tooltip headline="Metadata" tip="Additional key-value information attached to entities like accounts or transactions — such as external IDs, reference numbers, or department codes." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GAccountType = ({children}) => <Tooltip headline="Account Type" tip="A classification defining the nature and purpose of an account — such as checking, savings, escrow, or settlement — enabling proper transaction routing." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GAuditTrail = ({children}) => <Tooltip headline="Audit trail" tip="A chronological, immutable record of every action and transaction in the system — essential for regulatory compliance and dispute resolution." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GOperation = ({children}) => <Tooltip headline="Operation" tip="The atomic unit of movement in the ledger — a single debit or credit. Every transaction is composed of one or more operations, providing precise traceability for compliance and reporting." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GOperationRoute = ({children}) => <Tooltip headline="Operation Route" tip="A reusable template that defines the rules for one leg of a financial transaction — specifying which accounts participate, in what direction, and under what accounting annotation." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GTransactionRoute = ({children}) => <Tooltip headline="Transaction Route" tip="A complete transaction blueprint composed of multiple Operation Routes — defining all the debits and credits involved in a transaction type, ensuring double-entry compliance every time." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GSegment = ({children}) => <Tooltip headline="Segment" tip="A classification applied to accounts that share characteristics — like customer tiers (VIP, Student) or regional divisions — enabling differentiated rules and pricing." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GPortfolio = ({children}) => <Tooltip headline="Portfolio" tip="A grouping of accounts belonging to the same customer, business unit, or purpose — tying together checking, savings, and investment accounts for a unified view." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GAsset = ({children}) => <Tooltip headline="Asset" tip="A unit of value tracked in the ledger — traditional currencies (BRL, USD), digital currencies (BTC), or custom units like loyalty points. Every account is linked to exactly one asset." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GSourceAvailable = ({children}) => <Tooltip headline="Source-available" tip="A licensing model where the source code is publicly accessible for inspection, modification, and self-hosting, while certain commercial uses may require a license." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GDoubleEntry = ({children}) => <Tooltip headline="Double-entry accounting" tip="Every financial movement is recorded as at least two operations: a debit from one account and a credit to another, ensuring the system always balances." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

export const GLedger = ({children}) => <Tooltip headline="Ledger" tip="The core financial book that records all transactions, balances, and operations for an organization — the single source of truth for a business unit's finances." cta="See glossary" href="/en/glossary">
    {children}
  </Tooltip>;

Midaz is the backbone of modern financial infrastructures, designed to help institutions build, operate, and scale transactional ecosystems with agility and precision. As a <GSourceAvailable>source-available</GSourceAvailable> core <GLedger>ledger</GLedger>, Midaz offers a modular and extensible foundation, empowering clients to shape their financial operations with independence.

At its core, Midaz is structured around two essential domains: **Onboarding** and **Transaction**. Together, they provide a complete framework to configure, execute, and govern financial flows at scale.

<Note>
  This domain-driven architecture ensures that configuration (Onboarding) and execution (Transaction) remain clearly separated yet fully integrated — enabling performance, traceability, and business agility.
</Note>

## Domains and APIs

***

### Onboarding domain

The **Onboarding Domain** is where institutions structure their financial operations by configuring the essential entities of their ledger. This domain establishes the rules, accounts, and relationships that govern how transactions will be recorded and interpreted.

#### Components of the Onboarding Domain

* **Organizations**: Represent a business entity — such as a bank, fintech, or subsidiary — operating within Midaz. Each organization holds its own ledgers, configurations, and access controls, enabling multi-entity operations under one platform.
* **Ledgers**: The core financial book of an organization. <GLedger>Ledgers</GLedger> track every balance, transaction, and operation, ensuring integrity across all financial data. Think of a ledger as the single source of truth for a business unit's finances.
* **<GAsset>Assets</GAsset>**: Define the units of value tracked in the ledger — such as BRL, USD, BTC, or loyalty points. This flexibility allows institutions to manage traditional currencies, digital assets, and custom reward programs within the same system.
* **<GAccountType>Account Types</GAccountType>**: Classifications that define the nature and purpose of accounts (e.g., checking, savings, escrow, settlement). These types enable proper transaction routing and ensure that business rules are applied consistently across account categories.
* **Accounts**: The fundamental units of value storage — where money (or any asset) actually lives. Accounts are always linked to an Asset and can be organized further into segments or portfolios to reflect your business structure.
* **<GPortfolio>Portfolios</GPortfolio>**: Group multiple accounts belonging to the same customer, business unit, or purpose. For example, a single client may hold checking, savings, and investment accounts across different currencies — a portfolio ties them together for a unified view.
* **<GSegment>Segments</GSegment>**: Enable the grouping of accounts under shared characteristics, like customer tiers (e.g., VIP, Student) or regional divisions. Segments help enforce differentiated rules, pricing, or benefits across your customer base.

<Tip>
  The Onboarding Domain configures how your financial world is structured, ensuring consistency before any transaction takes place.
</Tip>

### Transaction Domain

Once the Onboarding Domain is configured, the **Transaction Domain** takes over — powering the real-time execution, movement, and reconciliation of funds.

#### Components of the Transaction Domain

* **Balances**: Retrieve the current balance of any account, including its available, on-hold, and reserved amounts. This is the real-time financial snapshot that supports validations, pre-transaction checks, and customer-facing displays.
* **<GOperationRoute>Operation Routes</GOperationRoute>**: Reusable templates that define the rules for each "leg" of a financial transaction — specifying which accounts participate, in what direction (source/destination), and under what accounting annotation. They ensure every transaction type follows consistent business rules.
* **<GOperation>Operations</GOperation>**: The atomic unit of movement in the ledger — a single debit or credit. Every financial movement is broken down into operations, providing a complete <GAuditTrail>audit trail</GAuditTrail> and precise traceability for compliance and reporting.
* **<GTransactionRoute>Transaction Routes</GTransactionRoute>**: Complete transaction blueprints composed of multiple Operation Routes. For example, a "Pix Transfer" route defines all the debits and credits involved, ensuring <GDoubleEntry>double-entry</GDoubleEntry> compliance every time that transaction type is executed.
* **Transactions**: The actual movement of value between accounts. Transactions can involve multiple **Operations** (e.g., fees, taxes, splits), enabling complex financial flows like marketplace payouts or multi-party settlements in a single atomic event.

<Tip>
  The Transaction Domain ensures that every movement is processed accurately, transparently, and in compliance with business and accounting rules configured upstream.
</Tip>

## In short

***

Midaz is a domain-driven ledger platform designed for reliability, flexibility, and governance.

| Domain          | Purpose                                                      | Key APIs                                                                      |
| :-------------- | :----------------------------------------------------------- | :---------------------------------------------------------------------------- |
| **Onboarding**  | Structure and configuration of the financial ecosystem.      | Organizations, Ledgers, Assets, Account Types, Accounts, Portfolios, Segments |
| **Transaction** | Execution, movement, and accounting of financial operations. | Balances, Transaction Routes, Transactions, Operation Routes, Operations      |

With this architecture, Midaz enables financial institutions to structure their data with precision and operate at scale, all while maintaining full control and transparency over their financial ecosystem.
