An open source ETRM being built for front-to-back commodity trading.
The product scope spans power, gas, crude, LNG and NGLs, in multiple currencies: trade capture, physical operations, valuation and risk, settlements, inventory costing and financial accounting. Current implementation covers bounded parts of that workflow. NGL operations, full parcel/cargo accounting, ISO charge reconciliation and portfolio margin methodologies remain planned, alongside the accounting gaps below. See the practitioner coverage map.
LeanETRM runs on a standard, unmodified PostgreSQL database. Exact quantity and cash arithmetic, explicit numerical policies and retained source lineage make calculations auditable; corrections never overwrite history. Traders, schedulers, risk, settlements and accounting teams—and their authorized AI agents—share the same retained business facts and explicit capability boundaries.
Status: an implemented baseline with a controlled hosted deployment and bounded verification. See the verified release for the deployed version and limits. Use synthetic data for local previews; broader workflows and installation-specific production qualification remain open.
For a worked PPA example, follow the PPA tester guide for synthetic booking, graphical break-even pricing and settlement previews.
Local implementation in progress: P&L supports original endpoint knowledge and common-cutoff restatement; the FX baseline has managed curve, cash and reporting consumers. FX report integration and full lifecycle/population qualification remain open. This branch is not a deployed capability statement.
The mandatory instrument contract requires every
financial product to derive from Instrument. Futures and exchange-traded options
are the only Side-free products; all others must compose concrete Sides that own
their schedules and PV. Independent signed memberships and trade quantities remain
separate. Implemented composition and remaining qualification work are
recorded in the plan.
Four foundational contracts govern storage, pricing and risk across every desk:
- Bi-temporal ledger on stock PostgreSQL: Every business fact and relationship
retains independent effective-time (
effective_from/effective_to) and commit-certified knowledge-time (known_from/known_to) coordinates on unmodified PostgreSQL withtrack_commit_timestamp=on—never overwriting history and never leaking later corrections or closes into earlier views (D22–D26, D375). See historical context and temporal data and architecture §7. - Connected calculation graph: Primitive quotes, basis spreads, rolling
contract selectors and custom curve recipes compile into one acyclic dependency
graph (
DependencyPlan/GraphSession<T>) with lazy paged memoization, reverse affected-closure traversal and copy-on-write frame advances. See connected curve calculation and the graph kernel benchmark. - Immutable scenario layers and ephemeral runtime contexts: Financial
contexts are constructed per authorized operation and released before commit
(no saved context stores, D434–D435). Price, clock and volatility shocks are
immutable sparse overlay layers (up to 64 levels deep) over admitted inputs;
risk applies shocks once to a shared scenario and asks the portfolio to value
through its normal
PVcontract. See valuation context layers, runtime context cutover and nested scenarios. - Unit instruments, reusable Sides and external quantity scaling: Every
instrument values one normalized unit; signed quantities, books, parties and
lifecycle state stay outside on
Trade. Economic parameters marked with[EconomicDefinition]/[IdentityField]establish canonical equivalence so identical instruments (and shared immutableSides across instruments) are evaluated once per affected scenario and scaled across applicable trades and books (D11, D145–D147, D417, D516). See unit instruments and trade bindings, architecture §3.1 & §5.2 and the shared scenario benchmark.
Inventory checked against this source tree on 2026-11-30. Implemented capabilities are grouped below. Hosted activation is qualified separately; each linked guide defines the supported contract and limits.
Integration PR #409 is merged: schedule tables/pivots, facility diagrams, gas amendment/payment extensions, close-driven lifecycle work, readable labels and fresh-preview startup fixes are included in the implemented inventory.
- Trade capture: futures, listed American and European options on futures, financial gas and power swaps, factor swaps and PPAs with exact party references and retained history. New trade groups instruments by product family. From a supported position in the Blotter, review an amendment or run trade risk; futures and financial swaps also support close-out and quantity-adjustment drafts. General termination and novation remain open; PPA termination has its own supported contract. See the Blotter workbench. Close-out creates an offsetting trade; it does not terminate the original.
- Agreements, credit and confirmations: versioned legal entities and counterparties, executed agreements with retained PDF evidence, product-specific credit clearance, and matched/disputed confirmations against the exact trade revision. Booking and economic amendments check the applicable agreement and clearance. Book/memo-only changes retain the earlier commercial confirmation. See the commercial desk workflow.
- Exchange futures: exact product/series specifications, dated lot quantities, execution price provenance, long/short lots and execution P&L. Native variation margin, final settlement and qualified physical-delivery handoffs have explicit lifecycle policies. See exchange futures and delivery and settlement.
- Execution commissions: clearing/executing broker references, versioned fee schedules and determined fee cash for futures and listed futures-option executions. Missing coverage is explicitly unassessed. Holdings and the Blotter state unpaid and paid commissions by exact currency; trading P&L states commission payments separately from economic P&L and still refuses futures holdings. Net P&L, book/pivot commission totals and exercise/assignment fees remain outside scope. See execution commissions.
- Scheduled swaps: persistent booking, amendments and inspection of up to 120 monthly periods per side, with explicit quantities, observations, payment rules and discounting. Running amendments lock started months and change eligible future months; amendments behind settlement require separate authority. See quantity contracts.
- Cross-commodity factor swaps: two floating Sides with an explicit contractual quantity ratio, including heat-rate swaps. Each Side keeps its own observation calendar, projection, spread and payment dates. Units are converted explicitly; no cross-currency payment is inferred. See factor swaps.
- Swap settlement: opt-in immutable determinations, corrections, same-trade gross/net allocations, manual cash recording, reversals and a closing-context P&L bridge; see the bounded lifecycle.
- Cross-trade swap netting: explicit versioned agreements combine eligible obligations into one observed settlement, including partial and zero-net discharge, allocation repair and group reversal. Lifecycle → Cross-trade netting uses shared filterable, sortable tables for agreements, obligations and settlement history, with paging and row details. See the implemented contract and workflow. Deployment remains separate.
- Futures margin: the explicitly selected native-margin profile retains determinations, corrections, variation-margin cash, partial payments and remaining value; see the bounded lifecycle
- Lifecycle scheduling: source-derived tasks run supported futures margin, listed-option expiry, swap determinations and supported fixed-price gas billing under explicit manual, review or automatic policies. Option exercise/assignment retains its generated futures obligation; option premiums are paid up front, not margined. See lifecycle execution and listed option scope. Indexed gas billing requires reviewed fixing selection. Explicit close-sweep enrollments dispatch eligible futures margin, option expiry and swap determinations, with occurrence outcomes in Jobs. Interactive previews start the lifecycle worker; hosted scheduler installation remains separate. See close-driven sweeps.
- Physical gas: multi-month delivery with independent fixed/indexed payment Sides, explicit quantity/fuel links, separate receipt/delivery locations and versioned delivery setup. Pre-delivery PV and interactive/queued risk retain independent physical and payment forecasts; started trades retain remaining value, accrued unsettled cash and payments under the selected policy. Running amendments preserve earlier bindings and facts, and eligible service accounts carry forward within their pool. Imbalance cash-out values and settles each binding's own days; an eligible carried account continues month-to-date. Any new account lacking its eligible opening balance leaves the whole mid-month opening month unassessed. Retained charges can be cut between payment rows when successor economics are unchanged. Exercise and daily quantity rights carry across an amendment: each binding keeps and values its own exercise groups and swing days with their elections; an election from the effective day onward refuses until its withdrawal is in force, and an exercise group the effective day would cut refuses. A swing month or term coupled by a per-period total or a changed-day count that the effective day cuts is divided by each binding's stated limits for its days, which its elections and valuation use, and the ticket fills a pro rata suggestion of the totals for review (D503). Later operations and cuts inside charge rows also constrain amendments. See gas contracts and the deal ticket.
- Gas exercise and swing rights: physical exercise elections and automatic cash exercise over selected gas entries, plus bounded daily quantity elections with explicit daily/period limits and remaining-right valuation. Models consume selected volatility/correlation marks; an election does not silently nominate, dispatch or settle gas. See rights and model limits.
- Gas billing and payments: final daily fixed/indexed determinations from accepted quantities and published fixings, corrections, monthly gross bills and adjustment notes, plus binding-specific payment recording and allocation review. Shared payment occurrences show coverage across related bindings with backend split suggestions and allocation totals. Independent lump-sum/capacity charges keep their own schedules. See daily billing, monthly bills and charge contracts.
- Settlement terms and counterparty statements: an explicit settlement terms election per agreement (procedure, due grouping, tax treatment), and a monthly statement per legal entity, counterparty and agreement over issued gas trade bills, with receive/pay totals per due group, net only where elected, and each blocking trade named, in a new Settlements → Statements page; terms are recorded under Reference Data → Parties. No document is issued yet. See settlement statements.
- Gas delivery desk: before-flow, intraday and retro nominations, separate counterparty/pipeline acknowledgments, reviewed schedule adoption, statement balances and after-flow imbalance transfers. Two-location confirmations and pipeline outlook show retained daily quantities. Route choices respect the selected knowledge view and current read authority. Explicit imbalance cash-out terms connect eligible statement balances to valuation. External pipeline/EDI submission remains open. See delivery operations and daily quantities.
- Owned gas and obligations: independent titled stock, lot reservations, operator claims/debts, commodity-loan returns and qualified physical-future delivery obligations survive the source trade. Evidence-backed performance, cash-out and payment records remain separate. See owned holdings.
- Quantity-aware gas accruals and settlement reconciliation: explicitly opted-in delivery quantities feed expected cash, accrued unsettled cash and valuation. Final billing compares contractual, scheduled and final quantities. These are foundations for shadow P&L; a retained estimate matched to physical statements with monetary variance reconciliation remains open. WACOG and financial-accounting postings are also separate remaining work. See gas accounting coverage.
- Gas services. Park and Loan supports title transfer with a fixed fee or a fee on the outstanding balance. Retained-title parking tracks custody and returns. A Transport agreement can value a whole package of rights from a published mark and track its fixed fee separately. See Park and Loan, balance fees, custody and Transport rights.
- Transport capacity and routes: versioned entitlements and dated agreement/receipt/delivery/path limits, shared capacity claims, replacement and release of chosen plans. Retained multi-segment routes check declared fuel, losses, lag and conservation at supported exact-point handoffs. Delivery scopes link route quantities to booked obligations and reviewed nomination batches. See capacity, routes and delivery workbench.
- Gas storage. Book capacity with inventory limits, daily injection and withdrawal ratchets, fuel and charges. Value a recorded plan before the term starts, or compare it with a plan proposed from daily forward prices. Recording the proposal makes it available for valuation. See the gas storage contract.
- Storage asset operations: versioned physical inventory bounds and ratchets, opening inventory evidence, chosen activities, complete-window actuals and explicit allocations. Assess inventory paths and rate breaches without clipping valid measurements. Search facility records and inspect inventory/ratchet diagrams. Physical asset limits remain separate from commercial storage entitlements. See storage operations.
- Facility quantities: shared reported quantities, explicit trade/Side allocation plans, versioned operating maxima and historical views for retained gas days; see the implemented scope
- Facility trading desk: link storage, thermal and eligible financial trades to commercial facility profiles. Inspect pricing, contracted capacity and volumes from booked schedules through nominated, confirmed, scheduled, measured and allocated quantities. See Trades and volumes.
-
PPAs and capacity agreements: fixed or indexed physical PPAs, virtual fixed-for-floating PPAs, basis-cash compositions and accredited-capacity agreements. Compose independent delivery/payment Sides, optional charges and certificate legs, with asset forecast/meter or flat/TOU quantities, 15/60-minute energy and flat, stepped or anniversary prices. Book, amend, extend eligible forward terms, terminate and inspect retained schedules. See PPA coverage.
-
PPA delivered and overdue measures: retain future/held value, known and estimated overdue cash, and realised delivery value separately. Asset forecasts, eligible meters and contractual profiles keep their selected quantity policies. Complete PV is unavailable when any overdue row exists. Delivered value is a valuation measure, not booked accounting profit or proof of payment. See PPA measures.
-
PPA draft pricing and settlement preview: solve an explicitly selected break-even strike without booking, inspect energy, price and cash charts, and retain the rounding residual and input evidence. A separate monthly gross cash preview uses certified meter finality; cash acceptance and payments remain open. See break-even pricing and settlement previews.
-
Physical power: published daily/monthly product curves, curve-owned hourly LMP resolution, explicit DA availability replay, booked fixed physical Sides and shaped ATC quantities/prices. Close comparisons reconcile fixing, marks and captured corrections for unchanged contractual quantities. ISO statement charge reconciliation and resettlements remain open. See support and limits.
-
Power interval delivery value: calculate submitted MW/MWh quantities at captured DA/RT interval prices with explicit clock, unit and source evidence. The result is an unsaved calculation, not an accepted settlement or payment. See interval delivery value.
-
Thermal tolls: supplied-plan feasibility covers minimum/maximum output, ramps, startup/shutdown limits, minimum up/down times, startup notice, start budgets and fuel consumption. Guaranteed and modeled fuel remain separate. Book the supported right and inspect its independent economic Sides. Search exact facility versions and inspect battery/thermal/solar diagrams of saved operating limits; live telemetry and optimization remain separate. See operating constraints. Booked operating-right valuation is pre-delivery only; started delivery needs further lifecycle support.
-
Battery and solar rights: battery plans enforce stored-energy and power limits, separate charge/discharge efficiencies, terminal energy and optional throughput budgets. Solar rights use an explicit production plan and entitlement. Supported future rights can be booked and valued; optimized dispatch, degradation, ancillary services and measured operating performance remain open. See operating-right trading.
-
Heat-rate call options. Book a daily strip of calls on power against fuel at a contractual heat rate. Booked valuation uses both forwards and recorded volatility and correlation marks. Exercise determination and settlement remain open. See the heat-rate call contract.
-
Operating-right hedge comparison: compare an explicit set of futures, swaps, heat-rate swaps, listed options or heat-rate calls against a saved operating right under shared price shocks. Reports show operating, hedge and net scenario P&L, delta and gamma. The supplied operating plan stays fixed. See hedge comparisons.
-
REC forwards and inventory: book eligible certificate forwards by class and vintage; record serial-range receipts, reserve/release delivery allocations, transfer and retire certificates with evidence and correction history. Inventory conserves ownership and delivery capacity. Automatic issuance, registry submission and inventory costing remain open. Forward valuation is pre-delivery only; started-delivery valuation and its cash lifecycle remain open. See certificate workflows.
- Physical crude: fixed standard-volume booking, contractual pre-delivery PV and interactive/queued risk, plus bounded receipts, title transfer, inventory-lot allocation to sales, purchase invoices/payments, dispatch-backed sales invoices/collections and cash-record corrections. Receipts cannot exceed the booked zero-tolerance quantity; partial receipt/invoicing does not waive the remainder. Monthly assessment-indexed purchases add provisional/final receipt pricing, correction documents, allocated payments, refunds and reviewed same-component credits; see indexed crude cash. See the contract and operations. Inventory costing, COGS and cost-based realised margins remain open.
- Physical LNG: future cargo booking with separate loading/discharge terms, explicit discharge-energy quantity or retained mass-to-energy conversion, Incoterms and fixed consideration. Retained trading views and interactive/queued risk support contractual PV before loading starts. A separate certified-cargo profile records load/discharge certificates, fixed-price determinations, freight and handling, documents, allocated payments and corrections; legacy bookings retain forecast-only terms. Certified energy can exceed the unchanged booked forecast. In-term valuation, cargo inventory costing, boil-off/loss attribution, off-spec acceptance and richer logistics remain open. See the cargo contracts and certified cargo cash.
- Physical operations: gas and crude workflows are worked under Scheduling, which lists one desk at a time: Gas, Power, Crude or LNG. Gas, crude and LNG share a read-only delivery grid with native intervals, quantities and source status. LNG certificate and billing actions are available only for bookings under the certified cargo cash profile; legacy bookings retain forecast-only terms. The delivery workbench links chosen gas routes to booked delivery quantities and can prepare reviewed batches of manual nominations. See physical operations, the delivery grid and the workbench.
Power, crude and LNG have different cash and valuation boundaries. The accounting coverage matrix distinguishes estimates, commercial payment reconciliation, missing shadow P&L statement reconciliation and financial-accounting work for each.
- Curves. Use Curves & prices for contract prices and hourly or sub-hourly prices. Open Curve builder from Reference Data to author a curve. Futures, gas and power forwards, basis and interest rates are built from explicitly selected prices, with a diagram showing which inputs built each contract's price. The custom-curve workbench supports visual/formula recipes and explicit weighted contract baskets, reusable published curve outputs and guided combinations of computed curves with matching periods and units; all keep their upstream graph links; the swap editor selects compatible published outputs for monthly or exact daily projections. Effective-version timelines resolve under the selected business date and knowledge cutoff. Explicit delivery splices and whole-interval lookups retain selected source evidence; see curve evaluation. Selecting a curve loads its declared dependencies. The price result and first-use catalog are read separately. See curve read coverage.
- Curve and publication setup: validate, preview, save, publish and admit native futures, forward and interest-rate definitions; author contract pricing, settlement/publication rules and explicit observation-to-contract mappings. Published versions preserve existing consumers. See curve authoring and native definitions.
- Market charts: contract and delivery-price histories with exact-value tooltips, backend-calculated simple/exponential moving averages and rolling ranges, plus chart drawing tools. Missing observations remain gaps. See the Markets desk.
- Price and volatility marks: publish direct point TraderMarks with review, predecessor checks and immutable corrections. The volatility/correlation editor offers monthly grids, pair matrices, term strips, TSV paste, atomic batch publication and history. Missing marks remain visible gaps. See point marks and curve marks.
- Interval curves: hourly and sub-hourly prices marked directly or shaped exactly from monthly peak and off-peak marks, delivered hours resolved to collected actuals under an explicit due rule, with lineage for every price, see the implementation record
- Interval series: audited per-interval values on any market clock (price shapes, capacity-factor forecasts, metered energy) with CSV import, corrections, a change log and reads at a chosen knowledge time. Shaped interval curves consume price shapes; PPA quantity/valuation consumes forecast and meter series; see the implementation record
- Multi-currency valuation and yield curves: supported trades can use separate currency-denominated forward/index inputs and their own yield/zero-rate curves for payment-date discounting. USD, GBP, EUR and CAD have synthetic working examples. Curves retain explicit day-count, compounding, interpolation and extrapolation policies. Amounts, prices, risk and reports preserve exact currency and quantity units, with currency-specific rounding. Currency totals remain separate: FX translation, cross-currency settlement, quanto/compo pricing and an AECO product are not implemented. See currency contracts, yield curves and regional examples.
- Calendars, schedules and contract sequences: versioned market clocks, holidays and TOU rules, DST-aware MW-to-energy integration, reusable published date schedules/mappings, rolling contract windows and explicit prompt/dated observation selection. Delivery, observation, publication and payment dates stay distinct. See time and schedules and schedule authoring.
- Reference data workspace: grouped categories, cross-category search, consolidated product details, readable versioned metadata and price-index names, exact delivery setup and source relationships. Economic-specification correction and assisted external lookup remain separate work. See reference data and workspace scope.
- Exchange connectors and margin adapters (managed interfaces & synthetic proxies, D519, local):
unified managed interfaces, centralized contract-enforcement facades
(
ExchangeConnectors,MarginAssessment) and clean-room wire adapters for CME STP (FIXML), ICE Trade Capture (FIX 4.4), generic broker drop-copy, CME/ICE settlements, unified ISO interval power and reference capture, and CME/ICE clearing statement reconciliation, plus margin methodology adapters for nativeRiskEnginefutures PV scenario scans (NativeScenarioScanMarginAdapter), legacy SPAN risk arrays, CME SPAN 2, ICE IRM 1/2, ISDA SIMM and BCBS–IOSCO standardized schedule—each paired with explicitly labelled synthetic loopback proxies (SyntheticProxy), an offline CLI demo (tools/OpenEtrm.ExchangeDemo), and zero proprietary SDKs or parameter files. Database persistence, UI screens and live exchange/clearing qualification remain planned. See exchange connectors and margin adapters.
- P&L and risk: futures execution P&L and swap/PPA PV using pinned actuals and projections. Trading P&L compares two retained close contexts with attribution and an explicit Run then Save workflow; unsupported scope refuses rather than silently excluding holdings. Connected quote and computed-output scenarios calculate delta and gamma from shared scenario PV evaluations; generated-close jobs retain mixed futures-and-swaps reports. Interactive and queued portfolio risk also cover supported PPA, gas, crude and LNG bindings; generated gas, crude and LNG closes refuse. A delta ladder shows each shocked contract's totals by book and measure, see the delta ladder. P&L explain currently attributes price delta/gamma and supported mixed effects with explicit time diagnostics; separate volatility-level, skew/smile, correlation and rate contributions are incomplete and remain in the residual. Listed-option price shocks hold each series' calibrated volatility: up/down PV does not resample the fitted smile or recalibrate to a shocked settlement. Explicit volatility scenarios exist only for supported consumers. See attribution limits. Whole-book P&L refuses books containing independently owned gas; supported trade-specific reports remain available. Cross-clock Transport and custody comparisons also require continuations that are not yet supported. See physical P&L limits.
- Curve shock defaults: a curve owns the default size of its price shock, an amount in its price unit or a number of trading ticks. Futures and forward curve definitions and custom curves are published with one; seeded curves receive one by dated revision. The risk catalog states each target's default or why it has none, and the Risk view's presets can run with them while every request still states its sizes. Existing-close risk can size each factor by its curves' default and refuses a job with a factor that has none (D506). Generated pilot closes, volatility and rate defaults are not yet covered. See curve shock defaults.
- Joint stresses and cross-gamma: named scenarios move multiple factors together, with book/holding P&L and loss. Selected finite differences calculate delta, gamma and mixed-factor gamma at half, nominal and double steps, retaining agreement diagnostics. Interactive and durable runs share reports. Supported gas exercise-right scenarios also admit explicit volatility shifts. See joint scenario risk and gas exercise risk.
- VaR / expected shortfall: guided portfolio/book/trade setup, visible editable defaults, automatic end-of-day history alignment, official-close priority with explicit approved price-type alternatives, aligned-factor coverage grids and correlation/covariance graphics; see how to run VaR and the parametric model. Full-PV Monte Carlo adds explicit seeded correlated Gaussian shocks, full PV and convergence/sampling diagnostics. Optional PCA / hybrid qualification adds loadings, residual diagnostics and every-path candidate comparisons with user-selected fallback and cost. Hybrid Monte Carlo valuation separately predicts the distribution with sampled full-PV validation and visible approximate/observed/fallback graphics. Fallback starts off and requires explicit opt-in. Full-PV historical simulation adds empirical loss distributions, signed book/trade allocations, sample PV drilldown and a matching normal comparison
- Lifecycle-aware horizon risk: supported historical and Monte Carlo runs project to the next configured close, accounting for eligible margin, expiry, physical/ownership transitions and cash. Explicit price-path and cash-carrying policies separate no-shock economic P&L from market-only change. Hypothetical events never write actual settlements or payments; event-aware parametric risk remains open. See economic horizon risk and projection contracts.
- Volatility fitting, surface definitions, product bindings, shocks and option analytics:
calibrate each listed series to its settlement; fit a quadratic log-moneyness
smile per expiry, with fit residuals, term structure, rich/cheap heat maps and
linked 3D views. Background fit jobs retain inputs, revisions and per-series
delta/gamma/vega/relative-vega/theta. Under
D513
and
D514
(merged on
master, Increments 1 and 2 of D512), Reference Data → Curves → Surface definitions governs versioned surface definitions, dated default volatility shocks and certified per-product surface bindings inmarket_datawithout requiringReadTrades, D408 option analytics consume each definition's pinned active default shock, and portfolio Risk offers explicit opt-in surface-backed option valuation (vol_surface_bound_v1/surface-bound-v1) with pinned worker replay and bit-for-bit parity against defaultoption_implied_volatility_held_v1. Under D518 (merged onmaster, PR #461, Increment 4), surface definitions also support datedrelativedefault shocks(0, 0.5)alongsideabsolute, D408 option fits/positions/strategies compute bothvegaandrelativeVegafrom one parallel surface axis without doubling tree solves, and opt-invol_surface_bound_v1portfolio Risk admits parallelabsolute(vega,CCY / vol pt) andrelative(relativeVega,CCY / 1% vol) surface shocks and sequential additive/multiplicative volatility stress layers with volatility-layeredPriceStepsrefresh. Pending review in PR #462 on branchvol-surface-close-sweep(D521, Phase B, not yet merged or deployed), Jobs → Volatility surface close sweep (vol_surface_close_sweep_v1) adds explicit per-session close-triggered fitting enrollments that dispatch standardvol_surface_fit_v1jobs intorisk.jobsunder minimal surface-fitting authority (noAmendTrade/BookTrade; no agents) while unconfigured sessions fit nothing. On the local branchvol-surface-sticky-moneyness(D522, Increment 3, stacked on pending PR #462; not yet merged or deployed), surface definitions add an explicit nullabletransport_wing_rule(model_continuation_v1orrefuse, zero backfill), opt-invol_surface_bound_v1portfolio Risk (sensitivity, joint scenarios/derivatives, interactive and queued) admits explicitvolatilityDynamics(sticky_strike_v1orsticky_moneyness_model_v1) with smooth-model smile transport, curve-stressPriceStepsrefresh and dynamics-named Delta/Gamma/Cross-gamma measures, and Trading P&L offers explicit opt-in fixed-strike versus fixed-moneyness option volatility attribution (opening_central_greeks_with_volatility_v1). The option strategy view combines legs on one expiry/underlying and accepts an explicit volatility shift. See volatility surfaces and listed options. - Correlation and stochastic risk modeling: aligned historical factors feed explicit sample covariance/correlation estimation, parametric risk, correlated Gaussian Monte Carlo and PCA/loadings/residual diagnostics. Separately authored monthly vol/correlation marks feed supported gas-right and heat-rate-call pricing. A marks editor is not an automatic calibration of those pricing inputs. See covariance estimation, PCA and mark boundaries.
- Risk jobs and Docker Swarm mini-grid: queue mixed-book runs, apply nested stresses, inspect retained results or cancel work. A registered pool runs one or two workers on eligible nodes, with heartbeats, diagnostics, drain controls and replacement/retry. Node details explain unavailable controls; a searchable console shows authorized worker events and scheduled jobs offer run history. Node cards show owners their active risk method and admitted books, with a link to the retained job. Workers process complete runs; one calculation is not split across the grid. Queued reports above the former 30 MB limit use verified chunks and reconstruct complete results for inspection/export. Specific multi-minute, two-node synthetic workloads are qualified; general capacity remains unqualified. See risk execution, measured grid workloads and adding a worker node.
- Blotter: booked positions appear while initial valuation runs, with bounded pricing memory and bounded parallel PPA, gas and swap calculations. A PPA booking gives the page back once saved, its booked row pending until its values arrive (D517). Opening a new future reads its current catalog without repricing the portfolio. PPA frame choices and discount receipts avoid repeating dense market inputs. The automated journey benchmark measures fresh sign-in, complete grid paint, curve rendering and booking-form readiness; synthetic results do not establish hosted latency or concurrent-user capacity. Filters, pivots, saved views, charts, exports, docked trade details, pop-out, maximize/restore for every pane, shared portfolio/book selectors, personal sidebar pins and backend-prepared close-out drafts. Side schedule tables show every Side across months, with filters and calculation detail. Physical delivery, Gas outlook and PPA details also expose cross-month tables and backend pivots over all authorized records, including unread pages. Saved schedule pivot views, charts and drill-through remain open. Inspection exposes pricing, source/calculation detail and native lifecycle state for swaps, PPAs, gas, crude and LNG; unsupported values retain explicit reasons. See the workbench and Side inspection limits
- Dashboard: account-owned layouts, curve levels/history and positions from saved risk run definitions; see implemented widgets and limits
- History: browse supported market and trade history at explicit business and knowledge times; trading-history cutover boundaries refuse earlier trade contexts. Close-based views use the latest close in force for the selected session and business day, including in historical views. Each signed-in tab keeps its As of selection. Back restores the previous cutoff and chosen close. Saved calculations retain their original inputs. See historical context and regional closes.
- Live corrections: push updates through the shared header context, with visible refresh/stale status; policy and limits
- Asynchronous reads: selected curve, trading, Risk and option-strategy reads complete independently through correlated SSE responses, with per-view progress and cancellation. Commands and durable jobs retain their existing contracts; see coverage and limits
- Access control: roles enforced by PostgreSQL row-level security, with people and AI agents as separate principals; agent actions require an explicit delegation
- Page assistant: bounded delegated reads, human-approved business proposals, page guidance, selection questions and presentation walkthroughs, plus recorded conversations, provider configuration and usage accounting. You can enable search of your own chat history for an individual question. Walkthroughs use supported native controls and stop at unsaved edits; see workspace operations and walkthrough limits
- Agent curve drafts: authorized agents can read curve ingredients, prepare a pinned preview and propose a bounded custom-curve draft. Saving uses the ordinary authorized operation after explicit human approval; publishing remains a person’s action
- Assistant configuration: versioned agents, explicit consent/delegation, installation-owned application/page/tool prompts, provider capability and pricing configuration, provider tests and usage accounting. Installed adapters cover OpenAI, Anthropic, Google, xAI and Meta under their admitted model contracts. No real token prices ship. See provider adapters and assistant configuration.
- Issue reporting: signed-in users review and submit reports to the installation's configured tracker, with retained request status and issue links. The assistant can draft a report for human authorization; automatic submission remains open. See issue reports.
- Jobs and infrastructure: create and amend bounded scheduled jobs, inspect runs and retained outcomes, pause/resume/cancel/run again, manage collection schedules, and drain approved workers. Registered container jobs use approved execution profiles; retries and uncertain outcomes retain their original identities. See jobs and infrastructure.
- Private pilot mode: invited user accounts and scheduled PJM and ERCOT day-ahead and real-time price collection; see private pilot operations
- Operating settings and profiles: versioned assistant/access policies under separate administration permissions, account-owned display preferences, explicit process/connection budgets, and server-supplied risk/request limits. Timestamp displays and manual instant entry use the profile timezone, including knowledge cutoffs, trade tickets and physical views. Repeated local hours require an explicit offset choice, while contractual dates and market clocks retain their own meaning. See time and schedules. Gas, crude and LNG execute retained instrument schedules under their exact commodity contracts; see implemented consumers and remaining work
Open PR scope checked on 2026-12-01. These features are not yet claims about master or the hosted release.
- Shared swing budgets across running amendments: instead of stating each binding's limits for a cut swing period (D503), an amendment may keep it as one budget of the right's own limits shared by the bindings; it chooses one or the other explicitly. Elections on any binding draw on that budget, and each binding values the period once over all its days and is attributed exactly its share by gas days, in base, up and down risk. Turning a shared budget into stated shares later is refused for now under the owner's policy. See gas contracts and D508 in decisions.
Development status as of 2026-11-30; these workstreams are separate from the implemented inventory above and do not establish deployed capabilities.
- Assistant/agent browser and Python terminal: execution tools are in progress, separate from the existing page reads, typed navigation and reviewed business proposals. Execution boundaries and qualification remain in the assistant tools design.
- Storage extrinsic modeling: stochastic flexibility beyond supplied-plan value and the implemented deterministic intrinsic plan search is in progress. See storage model scope.
- Heat-rate/toll extrinsic modeling: broader stochastic operating flexibility is in progress. Existing daily heat-rate calls already have option time value from their spread-call model; this is distinct from an optimized constrained thermal toll. See heat-rate scope and operating rights.
- Compute-grid refinement: further worker-grid performance and operating refinement is in progress, with workload-specific measurement still required. See managed risk workers.
ISO power products: FTR trading is not implemented as a complete product. Current LMP components, market calendars and power curves do not establish FTR booking, valuation, risk or settlement support. INC/DEC bids, ISO virtual supply/demand trades and point-to-point (P2P) transmission/congestion products also remain outside current product coverage. Virtual PPAs are a separate, supported contract type. Transmission scheduling is explicitly TBD in the Scheduling roadmap. The implementation records do not establish performance as the sole remaining FTR blocker.
ISO settlement charges are planned front-to-back scope. Energy/deviation, ancillary-service, uplift/make-whole, transmission/congestion, capacity/performance and administrative lines need market-specific charge codes and billing determinants. The proposed ISO settlement modules cover statement versions, estimates, resettlements, disputes, payment reconciliation and accounting handoffs. Importing an official amount, independently calculating it and matching cash are separate capabilities; none is established by an LMP feed alone.
Crude parcel and LNG cargo accounting: receipt lots and certified cash are implemented foundations. Parcel/lifting splits, in-transit and terminal inventory, landed costs, voyage/charter charges, laytime/demurrage, LNG heel/boil-off and inventory-to-sales cost allocation remain open. See parcel and cargo accounting.
NGLs: no qualified NGL booking, operating or settlement workflow is implemented. The publication placeholder is non-executable. Y-grade and purity-product trading, component accounting, processing/fractionation, residue gas/fuel/shrinkage, processor statements and inventory costs are intended scope requiring their own contracts and independent examples; see NGL coverage.
FX-linked products and fuller P&L attribution: currency-specific yield curves
are implemented, but FX translation, cross-currency commodity settlement and
quanto/compo products are not. A CAD-linked index payable in USD needs explicit
FX terms; a currency label alone selects no payoff. Governed volatility surface
definitions, dated default shocks driving D408 option analytics
(D513)
and certified per-product surface bindings with explicit opt-in surface-backed
option valuation (vol_surface_bound_v1 / surface-bound-v1,
D514)
are merged on master; parallel absolute/relative surface volatility shocks,
relative defaults and dual vega/relativeVega analytics are merged on master (PR #461)
(D518;
not yet deployed), scheduled close-triggered fitting (Phase B) is pending review
in PR #462 on branch vol-surface-close-sweep
(D521,
not yet merged or deployed), and smooth-model sticky-moneyness dynamics plus
explicit opt-in first-order fixed-strike / fixed-moneyness option volatility P&L
attribution (Increment 3) are implemented locally on branch
vol-surface-sticky-moneyness
(D522,
not yet merged or deployed). Model-parameter/per-slice vegas, SVI/OTC/structured
bindings, and fuller vomma, skew-slope, correlation and rate effects in P&L
explain remain planned increments in
D512.
See currency scope,
volatility surfaces and
P&L scope.
Cross-margining remains planned in separate bilateral and cleared phases. Swap payment netting is implemented; it creates no margin assessment, margin call or collateral account. Bilateral work covers complete exposure, internal assessments, calls and cash collateral. Cleared work covers account/program eligibility, internal assessments and external requirement reconciliation. See the design and phased plan. Later methods, permitted cross-account offsets and collateral extensions have separate qualification gates. SPAN, SPAN 2 (SPAN2), ICE IRM methods, bilateral SIMM/standardized schedules, broker add-ons, operational margin calls and collateral reconciliation are not implemented. Proposed methodology adapters connect qualified calculations to native margin operations. Internal stress estimates, external calculations, clearing statements and customer calls retain separate identities; an IM result is not proof of collateral movement.
Inventory costing and financial accounting: WACOG means weighted average cost of gas. Owned-gas quantity lots exist, but WACOG cost pools, withdrawal/COGS allocation and cost-based realized margins do not. Accrued unsettled cash and MTM valuation are implemented economic measures; accrual accounting journals, accounting-period close, financial statements and qualified US GAAP/FASB or hedge-accounting policies are not implemented. Full shadow P&L reconciliation against anticipated and received physical statements remains open, including monetary differences caused by settled quantities differing from booked notionals. See accounting scope. Power, crude and LNG also lack qualified financial-accounting postings; their implemented valuation measures and commercial cash workflows have the separate commodity boundaries.
Open product work includes heat-rate call exercise and settlement, valuation of started storage rights from measured inventory, and dispatch and metered performance for structured power rights. Broader futures settlement, inventory costing, post-delivery crude valuation and PPA cash acceptance and payment also remain open. External pipeline connectivity, operator storage-statement reconciliation, broader crude movement/blending and LNG terminal/voyage/laytime workflows remain in the Scheduling roadmap. Other gaps include EVT and operating backtests, broader agent credential management, broader workload and installation qualification, and general swap/PPA portfolio execution from compact retained programs. See the delivery plan. If you want to help with any of these, start with CONTRIBUTING.md.
LeanETRM is free under Apache 2.0 and will stay that way. If you want help putting it to work, three things are available from the author.
Pilot. We run LeanETRM beside your current system, on your own trades, for a fixed scope and a fixed fee. Typical scope is one desk and one commodity through a month-end. You get a written comparison of valuations, positions and P&L against your system of record, and a list of what would have to be built before production.
Implementation. Product coverage for your book, integrations with your market data, scheduling and accounting systems, data migration, and the controls and sign-on your security team requires.
Support. Ongoing fixes, upgrades and new products under an annual agreement.
The hosted release evidence does not qualify your book or integrations. A pilot establishes what your installation would still need before production.
Contact: Joe Isaac, joe@trustygenius.com or LinkedIn.
You need the .NET SDK pinned in global.json, Node with npm (version in
.node-version), Python 3.12+ with assertions enabled and PostgreSQL 19.
CI runs on Ubuntu 24.04.
git clone https://github.com/zerodrift/leanetrm.git
cd leanetrm
python3 tools/run_preview.py --pg-bin /path/to/postgresql/bin --dotnet /path/to/dotnetOpen the http://127.0.0.1:PORT address it prints. You start as a read-only demo
user. Use Curves & prices and the header's close-session/date controls to
inspect the synthetic market. To book trades or correct prices, switch demo users
under Profile → Preview access; New trade opens the product booking workflows.
The preview builds the app, creates its own throwaway PostgreSQL cluster seeded with synthetic data, and deletes it when you stop it with Ctrl+C. It never connects to an existing database.
With Docker instead of local toolchains, the preview container runs the same launcher; publish it on host loopback port 8080 exactly as shown:
docker build -f deploy/preview.Dockerfile -t leanetrm-preview .
docker run --rm -it -p 127.0.0.1:8080:8081 leanetrm-previewAdd --with-regional-seed for regional currency examples:
NYC and UK closes plus working GBP, EUR and CAD swaps with independent discount
curves. The preset uses explicitly synthetic 2020 history and preserves the
original USD examples.
For swap payment netting, follow the workspace walkthrough. It requires explicit netting-role grants, an agreement, recorded swap determinations and a financial snapshot covering settlement time. Standard sample trades are not automatically enrolled or ready to net.
Practitioner coverage
- Front-to-back workflow and commodity coverage
- Crude parcel, LNG cargo and NGL accounting
- ISO/RTO settlement charges and reconciliation
- Accounting coverage and policy boundary
- Netting, margin methodologies and collateral design
- Multi-currency valuation and remaining accounting scope
Design
- Architecture and domain contracts
- Delivery plan and acceptance criteria
- Decisions, proposals and unresolved choices
- Historical context and temporal data
- Connected curve calculation, booked projections and scenarios
- Valuation context and scenario layers
- Runtime context cutover (ephemeral contexts)
- Unit instruments, reusable Sides and trade bindings
- Events and lifecycle
- Market model proposal and key linkages
Implementation
- Current implementation and verification
- Asynchronous workbench reads: coverage, protocol and limits
- Blotter workbench
- Description-driven deal ticket (physical gas)
- Scheduled financial swaps
- Financial swap settlement and P&L
- Cross-trade swap payment netting and shared-table workflow
- PPA and heat-rate portfolio consumers
- Heat-rate call options and commercial gas storage
- Structured power operating rights, hedges and REC inventory
- Physical gas booking and quantities and Transport rights
- Physical crude booking and delivery-to-cash operations
- Physical LNG cargo booking and valuation
- Native curve definition authoring and publication
- Market dashboard and saved risk runs
- Booked executable schedule storage and remaining cutover
- Business scenarios, settlement gaps and shared scenarios
- Market-data contracts
- Reference data and futures
- CME/ICE futures example
- Listed American and European options on futures
- Volatility surfaces
- Time, delivery calendars and TOU
- Schedules and contract sequences
- Physical power curves, hourly settlement and current limits
- Booked peak and shaped ATC close comparisons
- Power example and its limits
- Risk calculation benchmark
- Connected curve calculation, booked projections and scenarios
- Large dependency-graph benchmark
- Nested market scenarios and durable risk jobs
- Native one-session parametric VaR/ES
- Full-PV historical simulation VaR/ES
- Full-PV Monte Carlo VaR/ES
- PCA diagnostics and hybrid qualification
- Identity, agent login kinds and authorization
- Reference schema and disposable verification
Operations
- Physical operations workspace and common delivery view
- Manual gas delivery operations
- Final daily gas cash determinations and corrections
- Shared facility quantities, physical Side allocations and operating limits
- Regional close sessions and historical-view policy
- Workspace assistant operations and human approval
- Assistant digests and presentation walkthroughs
- Connected-curve cutover prerequisites
- Jobs, workers and infrastructure and managed risk worker pools
- Private pilot operations
- Operating policies, user preferences and process configuration
- Local verification and CI
The documents distinguish implemented contracts, dated verification and proposed work. Historical plans and benchmark environments are not current setup instructions. The hosted release baseline records what was verified on leanetrm.com; committed features can be newer than that release.
LeanETRM is built to be maintained primarily by AI, with human customization and contributions welcome. Explicit contracts, schema invariants and thorough behavior tests are the durable assets. We prioritize correct behavior, speed and exhaustive verification ahead of stylistic polish; internal code is meant to be improved or replaced, not treated as precious. Unit tests with independently derived expectations, backed by integration and end-to-end checks, let stronger models refactor or rewrite internals over time without breaking documented behavior.
Read the project instructions, architecture and delivery plan before changing the application.
python3 tools/check_standalone.pychecks dependency boundaries.- Add
--checkto the preview command to run the HTTP integration checks, then clean up. npm test --prefix webruns presentation checks, including isolated browser-control checks whenCHROME_BINnames an installed browser. The complete verification command passes its explicit--browserselection to these checks.- Local verification and CI has the complete check command and hosted-runner boundaries.
Small fixes are welcome. Sign off contribution commits with git commit -s
under the Developer Certificate of Origin.
See the contribution guide; designated core contributors also
sign the Core Contributor Agreement.
Copyright (c) 2026 Trusty Genius LLC.
Licensed under the Apache License, Version 2.0.
The local frontend uses pinned public presentation dependencies for its trading
grid and analytical charts. The build serves their assets locally and includes
required license notices under web/dist/vendor. Business calculations remain
in the managed backend; see implemented capabilities.