Skip to main content
Midaz emits domain events as CloudEvents 1.0 messages in binary content mode over Kafka, published through lib-streaming. Every event travels in the shared envelope: ce-type names the event as studio.lerian.<resource>.<event>, ce-subject carries the aggregate id, ce-tenantid the owning tenant (absent in single-tenant scope), and ce-schemaversion the payload version — 1.0.0 for every event below. ce-source is deployment-configured through the STREAMING_CLOUDEVENTS_SOURCE environment variable and has no default: when streaming is enabled, the ledger fails to boot if it is unset. Topics do not derive from the source — Midaz routes each event to an explicit topic that folds the owning service segment into the first token (lerian.streaming.ledger_<resource>.<event> for the ledger core; the CRM and Fees capabilities below use crm_ and fee_) and normalizes hyphens to underscores in the topic tail. The ce-type keeps its hyphens (for example, balance.config-changed lands on topic lerian.streaming.ledger_balance.config_changed but keeps ce-type studio.lerian.balance.config-changed). Money amounts — balances, transaction and operation amounts — cross the wire as decimal strings, never floats.

Ledger events

Facts the ledger emits as organizations, accounts, balances, and transactions change.

Organization

Ledger

Account

Asset

Portfolio

Segment

Operation route

Transaction route

Balance

Transaction

The four lifecycle events share one payload schema; optional fields fill in per flow — route and routeId when the transaction was routed, parentTransactionId only on reverted.

Fees events

Midaz’s Fees capability manages fee and billing packages and records when fees are applied to a transaction. Its events are emitted by the consolidated ledger service, so they share the ledger’s ce-source — but they keep their own topic segment, landing under lerian.streaming.fee_*. Fees resources carry the fee- domain prefix in their keys and ce-types; the topic fold strips that prefix before adding the fee_ service segment, so fee-packages lands on fee_packages — never fee_fee_packages — unlike CRM, whose resource names carry no domain prefix.

CRM events

Midaz’s CRM capability manages account holders and their instruments. Its events are emitted by the consolidated ledger service: they share the ledger’s ce-source but keep their own topic segment, landing under lerian.streaming.crm_*, and they follow the same envelope and versioning as every other Midaz event.

Holder

Instrument

An instrument is a regulated entity, so document, banking details, and regulatory fields are PII and never cross the wire — only stable identifiers, the org/holder/ledger/account scope, the type classification, and a reduced related-party list (each entry carries just relatedPartyId and a non-PII role).