Skip to main content
Version: 0.58.1-rc.5

Credit Module

The credit module manages the full lifecycle of Bitcoin-backed loans in Lana. It handles everything from initial proposal creation through collateralization, disbursement of funds, interest accrual, repayment tracking, and eventual facility closure. All credit operations are secured by Bitcoin collateral, with continuous monitoring of loan-to-value ratios to protect the bank against market risk.

How Credit Works in Lana

Lana provides credit facilities where a customer borrows USD backed by Bitcoin collateral. The fundamental flow is:

  1. A bank operator creates a proposal defining the loan amount and terms for a specific customer.
  2. The customer accepts the proposal, and it goes through governance approval (committee voting or auto-approval).
  3. Upon approval, the customer must post Bitcoin collateral sufficient to bring the loan-to-value (LTV) ratio at or below the initial limit.
  4. Once collateral requirements are met, the facility activates and the customer can draw funds through disbursals.
  5. Interest accrues daily on outstanding principal and is consolidated into payable obligations monthly.
  6. The customer makes payments that are automatically allocated to outstanding obligations in priority order.
  7. When all obligations are fully paid, the facility closes and collateral can be returned.

Throughout this lifecycle, the system continuously monitors the BTC/USD exchange rate and recalculates the LTV. If the LTV climbs above the configured safety thresholds, the system can trigger margin calls or initiate liquidation proceedings.

Entity Relationships

The credit module is built around five core entities:

  • A Credit Facility is the lending agreement that defines the credit limit, terms, and collateral requirements. It advances funds to a borrower through one or more disbursals.
  • A Disbursal represents a specific drawdown of funds from the facility to the customer. Each disbursal goes through its own approval process and, when confirmed, creates a principal obligation.
  • An Obligation tracks an individual amount owed by the borrower, either for principal (from a disbursal) or interest (from an accrual cycle). Obligations follow a time-driven lifecycle from not-yet-due through due, overdue, and potentially defaulted.
  • A Payment captures funds remitted by the borrower. Each payment is automatically broken down into payment allocations that settle specific obligations in priority order.
  • Terms define the interest rates, fee schedules, timing intervals, and collateral thresholds that govern the facility. Terms are set at proposal time and remain fixed for the life of the facility.

Collateral and Risk Management

Because Lana issues USD loans backed by Bitcoin, the relationship between collateral value and loan exposure is central to risk management. The system tracks three LTV (Loan-to-Value) thresholds defined in the facility terms (lower LTV is safer):

ThresholdPurpose
Initial LTV LimitThe maximum LTV permitted to activate the facility. The customer must post enough BTC so that the loan exposure is at or below this fraction of the collateral USD value.
Margin Call LTV LimitA safety buffer above the initial threshold. If the LTV climbs above this level due to BTC price declines, the system flags the facility for a margin call, alerting operators and the borrower that additional collateral may be needed. New disbursals are also blocked if they would push the LTV above this level.
Liquidation LTV LimitThe critical ceiling. If the LTV rises above this threshold, the system initiates a liquidation process where the bank can sell collateral to recover the outstanding debt.

These thresholds must maintain a strict hierarchy: Initial LTV Limit < Margin Call LTV Limit < Liquidation LTV Limit, and every value must satisfy 0% < limit < 100%. The system enforces this at proposal creation time.

The LTV is continuously recalculated as the BTC/USD price changes, as collateral is deposited or withdrawn, and as the outstanding loan balance changes through disbursals and payments. A hysteresis buffer prevents rapid oscillation between states when the LTV hovers near a threshold boundary.

Facility Lifecycle Overview

For detailed information on each stage, see Credit Facilities.

Interest Lifecycle

Interest accrual uses a two-level timing system. Daily accrual jobs record interest in the ledger as it is earned. Monthly cycle jobs consolidate those accruals into payable interest obligations. This design satisfies both accounting requirements (revenue recognized as earned) and borrower experience (predictable monthly billing).

For the full mechanics, see Interest Processing.

Module Pages

PageDescription
Credit FacilitiesCreating proposals, approval process, collateralization, activation, and facility states
DisbursalsDrawing funds from active facilities, approval flow, and settlement
ObligationsDebt tracking, obligation types, lifecycle states, and timing parameters
PaymentsPayment processing, allocation priority rules, and accounting impact
TermsInterest rates, fee schedules, timing intervals, LTV thresholds, and terms templates
Interest ProcessingDaily accrual, monthly cycles, obligation creation, and ledger entries
LedgerOverview of account sets and transaction templates