The economy cookbook

22 working economies, ready to apply.

Every pattern is a self-contained bundle of manifest primitives — instruments, account types, valuation rules and Starlark sagas — that solves a whole business problem. Copying a pattern into your tenant is the deployment. They're also browsable inside the live demo, where you can see each one's account graph before you run it.

default-stripe-payment

Stripe Payment via Financial Gateway

End-to-end Stripe payment saga via the Financial Gateway. Resolves the party's default payment method, reserves funds with a lien, dispatches to Stripe through the typed financial_gateway.dispatch_payment API, posts double-entry ledger entries on webhook confirmation, and executes the lien to finalize the debit.

2 sagas
payment-gateway-stripe

Stripe Payment Gateway

Stripe payment integration via the Financial Gateway. Includes payment rail configuration, Financial Gateway dispatch for typed payment APIs, and a multi-step saga with gateway dispatch and double-entry ledger posting.

2 sagas 2 account types
tote-betting

Tote (Parimutuel) Betting Platform

Syndicate-based parimutuel betting with pooled stakes, equal-entry bets tracked as voucher instruments, market-data-driven settlement, 15% platform commission, and Stripe Connect payouts via the Financial Gateway.

4 sagas 4 account types BET_UNIT
carbon-offset

Carbon Credit Registry

Carbon credit trading and retirement with verified emission reductions (VERs) and certified emission reductions (CERs). Tracks credit provenance by vintage year and project, with a permanent retirement account for irrevocable credit retirement.

2 sagas 2 account types TONNE_CO2E · VER · CER
default-dividend-distribution

Dividend Distribution

Org-scoped syndicate dividend distribution saga. Lists all active participants, retrieves each participant's allocation share via structuring data, resolves their org-scoped account via composite account references, and credits each participant's position proportionally.

1 saga
default-dunning-escalation

Dunning Escalation

Progressive dunning escalation saga for handling payment failures. Escalates through three levels: first notice (level 1), second notice with retry scheduling (level 2), and final warning with account freeze and freeze notification (level 3). Each level sends a templated email via correspondence service.

1 saga
default-dunning-unfreeze

Dunning Unfreeze

Account unfreeze and payment retry saga triggered when a party updates their payment method on a frozen account. Unfreezes the account, resolves the updated payment method, reserves funds with a new lien, retries the gateway payment, and sends a resolution confirmation. Compensation re-freezes the account if the retry fails.

1 saga
default-payment-execution

Payment Order Execution

Orchestrates the complete payment order flow: reserves funds via a bucket-aware lien, sends the payment to an external gateway, posts double-entry ledger entries on webhook confirmation, and executes the lien to finalize the debit. Steps 3 and 4 are conditionally invoked via webhook callbacks.

1 saga
dynamic-capacity-pricing

Dynamic Capacity Pricing

Self-referential feedback loop pricing for compute tokens. Bills token consumption at rates derived from the platform's own utilisation forecasts per data centre region. Usage patterns drive pricing, and pricing shapes usage patterns.

1 saga TOKEN
entity-distribution

Entity Hierarchy Distribution

Distributes value across a party hierarchy based on structuring data (allocation shares). Triggered by market data events, traverses the party organization graph to find participants and their payout ratios, then books proportional position logs for each participant.

1 saga
payg-energy

Prepayment Energy Billing (PAYG)

Complete prepayment energy billing model with no-standing-charge block tariff, emergency credit, debt recovery waterfall, DCC smart meter integration, and MHHS-ready half-hourly settlement. Two-tier pricing (First Rate / Saver Rate) with VAT at top-up (HMRC Reg 86).

4 sagas 10 account types KWH_ELEC · KWH_GAS
phantom-cost-basis

Phantom Cost Basis Adjustment

Adjusts cost basis for all holdings of an instrument when a corporate action occurs. Handles phantom events where no cash or units move but the tax position changes, such as accumulating ETF dividends. The cost basis account position log serves as the HMRC audit trail.

1 saga
precious-metals

Precious Metals Trading

Precious metals trading platform with event-triggered valuation. When gold, silver, or platinum positions are captured, an event-driven saga automatically books the GBP settlement value at the current spot rate from LBMA/LPPM price fixes.

1 saga 2 account types GOLD · SILVER · PLATINUM
saas-billing

SaaS Compute Billing

Usage-based billing for cloud compute resources. Meters GPU hours, API calls, and storage consumption, then converts to USD charges via valuation rules. Includes platform credits as a voucher instrument.

3 sagas 4 account types GPU_HOUR · API_CALL · STORAGE_GB · CREDIT
time-of-use-pricing

Time-of-Use Energy Pricing

Extends energy settlement with temporal pricing awareness. Values kWh consumption at dynamic rates that vary by settlement period (half-hour), using forecast-derived price curves from Market Data. Peak, off-peak, and overnight rates are resolved from the event timestamp.

1 saga KWH
default-deposit

Current Account Deposit

Multi-step saga for depositing funds into a current account with double-entry ledger posting. Logs a CREDIT position in position keeping, initiates a booking log, posts DEBIT to clearing and CREDIT to customer account, then finalizes the booking to POSTED state.

1 saga 2 account types
default-reconciliation-adjustment

Reconciliation Adjustment

Ledger correction saga triggered when a reconciliation variance is resolved. Initiates a booking log for the adjustment, posts DEBIT and CREDIT entries to correct the ledger imbalance, and finalizes the booking to POSTED. Follows the immutable ledger pattern - compensation creates reversal entries rather than rolling back state.

1 saga
default-withdrawal

Current Account Withdrawal

Multi-step saga for withdrawing funds from a current account with double-entry ledger posting. Logs a DEBIT position in position keeping, initiates a booking log, posts DEBIT to customer account and CREDIT to clearing account, then finalizes the booking to POSTED state.

1 saga 2 account types
energy-settlement

Energy Usage-to-Value Settlement

Converts metered kWh into monetary value using market rates. Creates retail and wholesale GBP positions from energy consumption.

1 saga 3 account types KWH
kyc-compliance

KYC Compliance Workflow

Initiates KYC verification when an individual party is created. Uses the compliance marker pattern: books a zero-amount position log to track outstanding KYC obligations per jurisdiction. Compliance accounts are resolved via entity graph traversal.

1 saga 1 account type
base-fiat-gbp

Base Fiat Currency (GBP)

Foundation instrument for British Pound Sterling. Provides GBP instrument with standard 2-decimal precision.

GBP
base-fiat-usd

Base Fiat Currency (USD)

Foundation instrument for United States Dollar. Provides USD instrument with standard 2-decimal precision.

USD

Don't see your economy?

Patterns compose — and the manifest format is constrained enough that an AI assistant can draft a new one in conversation. Or we'll help you write it.