Skip to main content
Version: 0.45.0

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 createdentity
RoleCreatedA new role was createdentity

Credit Events

Events related to credit facility lifecycle and operations.

Facility Lifecycle

EventDescriptionPayload Fields
FacilityProposalCreatedA credit facility proposal was createdentity
FacilityActivatedA credit facility was activatedentity
FacilityCompletedA credit facility was fully repaid and closedentity

Collateral Events

EventDescriptionPayload Fields
PendingCreditFacilityCollateralizationChangedCollateralization state changed for pending facilityentity
FacilityCollateralizationChangedCollateralization state changed for active facilityentity

Payment Events

EventDescriptionPayload Fields
DisbursalSettledA disbursal was settledentity
AccrualPostedInterest accrual was postedentity

Liquidation Events

EventDescriptionPayload Fields
PartialLiquidationInitiatedA partial liquidation was initiatedentity
EventDescriptionPayload Fields
FacilityProposalConcludedNo description availableentity
PendingCreditFacilityCompletedNo description availableentity
DisbursalApprovalConcludedNo description availableentity

Custody Events

Events related to Bitcoin custody and wallet management.

EventDescriptionPayload Fields
WalletBalanceUpdatedNo description availableentity

Customer Events

Events related to customer lifecycle and KYC.

EventDescriptionPayload Fields
CustomerCreatedA new customer was createdentity
CustomerKycUpdatedNo description availableentity
PartyCreatedNo description availableentity
PartyEmailUpdatedNo description availableentity
ProspectCreatedNo description availableentity
ProspectKycStartedNo description availableentity
ProspectKycPendingNo description availableentity
ProspectKycDeclinedNo description availableentity
ProspectConvertedNo description availableentity
ProspectClosedNo description availableentity

Deposit Events

Events related to deposit accounts and transactions.

EventDescriptionPayload Fields
DepositAccountCreatedA deposit account was createdentity
DepositInitializedA deposit was initializedentity
WithdrawalConfirmedA withdrawal was confirmedentity
WithdrawalApprovalConcludedNo description availableentity
DepositRevertedA deposit was revertedentity

Price Events

Events related to BTC/USD price updates.

EventDescriptionPayload Fields
PriceUpdatedBTC/USD price was updatedprice, timestamp

Report Events

Events related to report generation.

EventDescriptionPayload Fields
ReportRunCreatedA report run was initiatedentity
ReportRunStateUpdatedA report run state changedentity

Governance Events

Events related to approval workflows.

EventDescriptionPayload Fields
ApprovalProcessConcludedAn approval process was concludedentity

Event Types Reference

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

ModuleEvent Type Prefix
Accesscore.access.*
Creditcore.credit.*
Custodycore.custody.*
Customercore.customer.*
Depositcore.deposit.*
Pricecore.price.*
Reportcore.report.*
Governancegovernance.*

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. ETL pipelines - Via Meltano extraction

For integration details, contact the platform team.