Skip to main content
Version: Next

Domain Events

Lana Bank publishes domain events via the transactional outbox pattern. These events can be consumed by external systems for integration, analytics, and audit purposes.

All events are serialized as JSON and include metadata for tracing and ordering.


Event Structure​

Each event is wrapped in an envelope with the following structure:

{
"id": "uuid",
"event_type": "core.credit.facility-activated",
"payload": { ... },
"recorded_at": "2024-01-15T10:30:00Z",
"trace_id": "trace-uuid"
}

Access Events​

Events related to user and role management.

EventDescriptionPayload Fields
UserCreatedA new user was createdemail, id, role_id
RoleCreatedA new role was createdid, name

Accounting Events​

Events related to chart of accounts and accounting operations. Ledger account, membership, transaction, entry, and effective-balance payloads use GL-qualified field names (such as gl_account_id and gl_transaction_effective_date), independent of the underlying ledger engine. Transaction-template payloads retain their template field names.

EventDescriptionPayload Fields
ChartNodeCreatedA chart of accounts node was createdaccount_set_id, chart_id, code, id, name, normal_balance_type, parent
LedgerAccountCreatedA general-ledger account was createdgl_account_code, gl_account_entity_id, gl_account_entity_type, gl_account_external_id, gl_account_id, gl_account_name, gl_account_normal_balance_type
LedgerAccountSetMemberCreatedAn account or nested account set was added to a general-ledger account setgl_account_set_id, gl_member_id, gl_member_type
LedgerAccountSetMemberRemovedAn account or nested account set was removed from a general-ledger account setgl_account_set_id, gl_member_id, gl_member_type
LedgerTransactionCreatedA general-ledger transaction was posted, including its effective date and closing-transaction flaggl_journal_id, gl_transaction_created_at, gl_transaction_effective_date, gl_transaction_id, gl_transaction_modified_at, gl_transaction_template_id, is_closing_gl_transaction
LedgerEntryCreatedA general-ledger entry was posted with its direction, layer, currency, and native amountgl_account_id, gl_entry_amount_native, gl_entry_currency, gl_entry_direction, gl_entry_id, gl_entry_layer, gl_entry_type, gl_journal_id, gl_transaction_id
LedgerTxTemplateCreatedA transaction template was created with its entry definitionscode, description, entries, id, version
LedgerEffectiveBalanceAn effective-date general-ledger balance was captured during end-of-day processinggl_account_id, gl_balance_currency, gl_balance_effective_date, gl_balance_encumbrance_cr, gl_balance_encumbrance_dr, gl_balance_pending_cr, gl_balance_pending_dr, gl_balance_settled_cr, gl_balance_settled_dr, gl_journal_id

Credit Events​

Events related to credit facility lifecycle and operations.

EventDescriptionPayload Fields
FacilityProposalCreatedA credit facility proposal was createdamount, created_at, customer_id, id, partner_id, product_id, status, terms
FacilityProposalConcludedA credit facility proposal was concludedamount, created_at, customer_id, id, partner_id, product_id, status, terms
PendingCreditFacilityCollateralizationChangedCollateralization state changed for pending facilityamount, collateralization, completed_at, created_at, credit_facility_proposal_id, customer_id, id, partner_id, product_id, status, terms
PendingCreditFacilityCompletedA pending credit facility was completedamount, collateralization, completed_at, created_at, credit_facility_proposal_id, customer_id, id, partner_id, product_id, status, terms
FacilityActivatedA credit facility was activatedaccount_ids, accrual_spec, activated_at, activated_on, activation_tx_id, amount, collateral_id, collateralization, completed_at, customer_id, id, liquidation_trigger, maturity_date, partner_id, pending_credit_facility_id, product_id, public_id, terms
FacilityCompletedA credit facility was fully repaid and closedaccount_ids, accrual_spec, activated_at, activated_on, activation_tx_id, amount, collateral_id, collateralization, completed_at, customer_id, id, liquidation_trigger, maturity_date, partner_id, pending_credit_facility_id, product_id, public_id, terms
FacilityCollateralizationChangedCollateralization state changed for active facilityaccount_ids, accrual_spec, activated_at, activated_on, activation_tx_id, amount, collateral_id, collateralization, completed_at, customer_id, id, liquidation_trigger, maturity_date, partner_id, pending_credit_facility_id, product_id, public_id, terms
DisbursalInitializedA disbursal was initiated and is pending approvalamount, approved, cancelled, credit_facility_id, customer_id, due_date, id, obligation_id, partner_id, public_id, settlement, status
DisbursalApprovalConcludedA disbursal approval process was concludedamount, approved, cancelled, credit_facility_id, customer_id, due_date, id, obligation_id, partner_id, public_id, settlement, status
DisbursalSettledA disbursal was settledamount, approved, cancelled, credit_facility_id, customer_id, due_date, id, obligation_id, partner_id, public_id, settlement, status
DisbursalCancelledA disbursal was cancelledamount, approved, cancelled, credit_facility_id, customer_id, due_date, id, obligation_id, partner_id, public_id, settlement, status
AccrualPostedInterest accrual was postedcredit_facility_id, due_at, id, period, posting
FacilityMaturedNo description availableaccount_ids, accrual_spec, activated_at, activated_on, activation_tx_id, amount, collateral_id, collateralization, completed_at, customer_id, id, liquidation_trigger, maturity_date, partner_id, pending_credit_facility_id, product_id, public_id, terms
PartialLiquidationInitiatedA partial liquidation was initiatedfacility_accounts, facility_accrual_spec, facility_activated_at, facility_activated_on, facility_activation_tx_id, facility_amount, facility_collateral_id, facility_collateralization, facility_completed_at, facility_customer_id, facility_id, facility_liquidation_trigger, facility_maturity_date, facility_partner_id, facility_pending_credit_facility_id, facility_product_id, facility_public_id, facility_terms, id, initially_estimated_to_liquidate, initially_expected_to_receive, trigger_exchange_rate

CreditCollateral Events​

Events related to credit facility collateral management and liquidation.

EventDescriptionPayload Fields
CollateralUpdatedCollateral amount was updatedamount, id, last_posting, secured_loan_id
LiquidationCollateralSentOutCollateral was sent for liquidationamount, effective, ledger_tx_id, liquidation_id, secured_loan_id
LiquidationSaleRecordedAn executed collateral sale was recorded and its net proceeds recognized as a receivablecollateral_id, effective, ledger_tx_id, liquidation_id, net_proceeds, payment_id, secured_loan_id

CreditCollection Events​

Events related to credit facility obligations and payment collection.

EventDescriptionPayload Fields
PaymentCreatedA payment was createdamount, beneficiary_id, created_at, effective, id
PaymentAllocationCreatedA payment allocation was createdamount, beneficiary_id, created_at, effective, id, obligation_id, obligation_type, payment_id
ObligationCreatedA new obligation was createdbeneficiary_id, beneficiary_owner_id, completed_at, completing_payment_allocation_id, created_at, defaulted_at, due_at, effective, id, initial_amount, obligation_type, outstanding_amount, overdue_at
ObligationDueAn obligation became duebeneficiary_id, beneficiary_owner_id, completed_at, completing_payment_allocation_id, created_at, defaulted_at, due_at, effective, id, initial_amount, obligation_type, outstanding_amount, overdue_at
ObligationOverdueAn obligation became overduebeneficiary_id, beneficiary_owner_id, completed_at, completing_payment_allocation_id, created_at, defaulted_at, due_at, effective, id, initial_amount, obligation_type, outstanding_amount, overdue_at
ObligationDefaultedAn obligation defaultedbeneficiary_id, beneficiary_owner_id, completed_at, completing_payment_allocation_id, created_at, defaulted_at, due_at, effective, id, initial_amount, obligation_type, outstanding_amount, overdue_at
ObligationCompletedAn obligation was fully paidbeneficiary_id, beneficiary_owner_id, completed_at, completing_payment_allocation_id, created_at, defaulted_at, due_at, effective, id, initial_amount, obligation_type, outstanding_amount, overdue_at

Custody Events​

Events related to Bitcoin custody and wallet management.

EventDescriptionPayload Fields
WalletBalanceUpdatedNo description availableaddress, balance, id, network

Customer Events​

Events related to customer lifecycle and KYC.

EventDescriptionPayload Fields
CustomerCreatedA new customer was createdcustomer_type, id, partner_id, party_ref_id, party_ref_type, public_id, status_change
CustomerFrozenA customer account was frozen, blocking financial operationscustomer_type, id, partner_id, party_ref_id, party_ref_type, public_id, status_change
CustomerUnfrozenA previously frozen customer account was unfrozen, restoring normal operationscustomer_type, id, partner_id, party_ref_id, party_ref_type, public_id, status_change
CustomerClosedCustomer account was closedcustomer_type, id, partner_id, party_ref_id, party_ref_type, public_id, status_change
CustomerPiiErasureScheduledPII erasure was scheduled for a closed customer's partycustomer_type, id, partner_id, party_ref_id, party_ref_type, public_id, status_change
CustomerPiiErasureCancelledA scheduled PII erasure for a customer's party was cancelled before executioncustomer_type, id, partner_id, party_ref_id, party_ref_type, public_id, status_change
CustomerPiiErasureCompletedA scheduled PII erasure for a customer's party was carried outcustomer_type, id, partner_id, party_ref_id, party_ref_type, public_id, status_change
CustomerDocumentCreatedA document was added to a customercustomer_id, id
CustomerDocumentArchivedA customer document was archivedcustomer_id, id
CustomerDocumentDeletionRequestedA customer document's deletion was requestedcustomer_id, id
CustomerNoteCreatedA note was added to a customercustomer_id, id
ProspectCreatedA new prospect was created for onboardingcustomer_type, id, partner_id, party_ref_id, party_ref_type, stage
ProspectConvertedA prospect was converted to a customercustomer_type, id, partner_id, party_ref_id, party_ref_type, stage
ProspectClosedA prospect was closed without convertingcustomer_type, id, partner_id, party_ref_id, party_ref_type, stage
ProspectPiiErasureScheduledPII erasure was scheduled for a closed prospect's partycustomer_type, id, partner_id, party_ref_id, party_ref_type, stage
ProspectPiiErasureCancelledA scheduled PII erasure for a prospect's party was cancelled before executioncustomer_type, id, partner_id, party_ref_id, party_ref_type, stage

Deposit Events​

Events related to deposit accounts and transactions.

EventDescriptionPayload Fields
DepositAccountProductCreatedA deposit account product was created for one customer type with its currency and accounting topologyaccounting_integration, currency, customer_type, id, name, partner_id
DepositAccountCreatedA deposit account was createdaccount_holder_id, activity, currency, id, product_id, public_id, status
DepositAccountFrozenNo description availableaccount_holder_id, activity, currency, id, product_id, public_id, status
DepositAccountUnfrozenNo description availableaccount_holder_id, activity, currency, id, product_id, public_id, status
DepositAccountClosedNo description availableaccount_holder_id, activity, currency, id, product_id, public_id, status
DepositAccountActivityUpdatedNo description availableaccount_holder_id, activity, currency, id, product_id, public_id, status
DepositBookedA deposit was bookedaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, public_id, reference, status
DepositRevertedA deposit was revertedaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, public_id, reference, status
WithdrawalInitializedA withdrawal was initiated and is pending approvalaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, payout_id, public_id, reference, status
WithdrawalApprovalConcludedA withdrawal approval process was concludedaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, payout_id, public_id, reference, status
WithdrawalDeniedA withdrawal was deniedaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, payout_id, public_id, reference, status
WithdrawalConfirmedA withdrawal was confirmedaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, payout_id, public_id, reference, status
WithdrawalCancelledA withdrawal was cancelledaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, payout_id, public_id, reference, status
WithdrawalRevertedA confirmed withdrawal was revertedaccount_holder_id, amount, deposit_account_id, id, ledger_tx_id, payout_id, public_id, reference, status

Exchange Events​

Events related to bitcoin purchases executed for customers.

EventDescriptionPayload Fields
BitcoinPurchaseExecutedA customer's fiat was exchanged for bitcoin and both deposit accounts were settledbitcoin_amount, customer_id, destination_deposit_account_id, fiat_amount, id, ledger_tx_id, public_id, source_deposit_account_id

Partner Events​

Events related to partner and partner user lifecycle.

EventDescriptionPayload Fields
PartnerUserCreatedA partner user was createdemail, id, partner_id
PartnerCreatedA partner was createdid, name, status
PartnerRenamedA partner was renamedid, name, status
PartnerActivatedA partner was activatedid, name, status
PartnerClosedA partner was closedid, name, status

Price Events​

Official rate events published at end of day and on the hour tick; runtime price updates are ephemeral and never persisted.

EventDescriptionPayload Fields
ClosingRateCapturedOfficial closing rate for one currency pair on one business day, published by the capture-closing-rates EOD phase. Runtime prices are ephemeral.closing_time, day, pair, provenance, rate_major, window
RateSnapshotCapturedThe runtime's latest sanitized rate for one currency pair, republished as a persistent event on each hour tick. No provider fetch happens at the tick: the rate, sanitization window, and provenance come from the record the realtime aggregation pipeline already produced, so hourly-refreshed reports convert at exactly the rate the bank was using.hour, pair, provenance, rate_major, window

DwPipeline Events​

Telemetry for the data-warehouse refresh pipeline runs: EOD builds, intraday refreshes, and on-demand full or partial dbt refreshes. Report serving publishes no events.

EventDescriptionPayload Fields
PipelineRunInitializedA scheduled or on-demand pipeline run was queued to refresh the data warehouseday, id, kind, status
PipelineRunStartedThe pipeline run started dbt against the data warehouseday, id, kind, status
PipelineRunCompletedThe pipeline run finished refreshing the data warehouse for the dayday, id, kind, status
PipelineRunFailedThe pipeline run failed; the failure reason is recorded on the entityday, id, kind, status
PipelineRunSkippedThe pending scheduled run was superseded during queue compaction without running dbt or advancing report freshnessday, id, kind, status

Governance Events​

Events related to approval workflows.

EventDescriptionPayload Fields
ApprovalProcessConcludedAn approval process was concludedid, process_type, status, target_ref

Time Events​

Events related to end-of-day processing.

EventDescriptionPayload Fields
EndOfDayThe operational clock rolled past the closing time for the configured timezone; the raw day-boundary signal that day-scoped reactions and the EOD close process key offclosed_at, day, schedule
HourTickThe operational clock crossed into a new hour; the hourly intraday signal that periodic (non-EOD) reactions key off. Published at most once per hour boundary, with missed boundaries coalesced into one tickhour

Lifecycle Events​

Durable core banking lifecycle milestones, published once per database rather than on each process restart.

EventDescriptionPayload Fields
InitializationCompletedAll synchronous core banking startup initialization completed successfully. Triggers the initial full warehouse build; consumers may subscribe to perform other one-time setup. The marker and event are committed atomically, including across concurrent replicascompletedAt

Eod Events​

Events related to the end-of-day close process.

EventDescriptionPayload Fields
EodProcessInitializedAn end-of-day close process was created for a business dayday, id, status, timezone
EodProcessInProgressAn end-of-day close process advanced: a phase started, completed, or failedday, id, status, timezone
EodProcessCompletedAn end-of-day close process finished with every phase successful: the day's ledger mutations are all posted and its balances snapshotted, so the day is settled historyday, id, status, timezone
EodProcessStoppedAn end-of-day close process stopped, either after a blocking phase failure or once no phases remain to runday, id, status, timezone

DomainConfig Events​

Events related to runtime domain configuration. Only configs defined as published are reported.

EventDescriptionPayload Fields
UpdatedA published domain config was written, carrying its committed value rendered as text with its config typeconfig_type, id, key, value

Event Types Reference​

All event types follow the naming convention: core.<module>.<event-name>

ModuleEvent Type Prefix
Accesscore.access.*
Accountingcore.accounting.*
Creditcore.credit.*
CreditCollateralcore.credit-collateral.*
CreditCollectioncore.credit-collection.*
Custodycore.custody.*
Customercore.customer.*
Depositcore.deposit.*
Exchangecore.exchange.*
Partnercore.partner.*
Pricecore.price.*
DwPipelinecore.dw-pipeline.*
Governancegovernance.*
Timecore.time.*
Lifecyclecore.lifecycle.*
Eodcore.eod.*
DomainConfigcore.domain-config.*

Consuming Events​

Events are published via the transactional outbox and can be consumed through:

  1. Direct database polling - Query the outbox table
  2. Event streaming - Integration with message queues (implementation dependent)
  3. Reporting warehouse - Via the outbox relay into Postgres DW

For integration details, contact the platform team.