Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

risk-kernel

The risk model liquidation kernels as a standalone package — pure compute (numpy + stdlib), zero DB access, no write path. This package is the source of truth for kernel logic: both core and core-api install it and run the kernels in-process.

One model namespace plus one shared:

  • risk_kernel.common — model-version-neutral vocabulary shared by every consumer: the liquidator dataclass contract (BorrowerPosition, MarketDescriptor, MarketContext, PricePaths, SellOrderbook, CRRSummary, …) and slippage_for_amount.
  • risk_kernel.v3 — the v3 market-clearing kernel: clearing kernel, impact law, CRR stats, liquidation-wall curve math, FHS residuals/simulator. Entry points risk_kernel.v3.kernel.run_clearing_kernel / run_multi_asset_kernel on KernelInputs / MultiAssetKernelInputs.

The Laniakea concentration engine (risk_kernel.concentration, 0.3.0–0.7.x) moved into core in office #1329 (core ADR 0006): its September 2026 methodology is portfolio-dependent per position and reads history series at run time, so it no longer fits a pure-constants kernel.

Loading inputs from a database is the consumer's job, never this package's.

Consumers

Both install balabs-risk-kernel from PyPI and run the kernels in-process:

  • core — the production risk model. Consumes the pure kernel here and keeps only the impure orchestration in-tree (src/core_model/: datasources, pipelines, tasks, models, persistence, calibration). The pure compute modules were removed from core in office #553 — they live here now.
  • core-api — runs the kernels for the on-demand LTV↔CRR estimator endpoint (office #490 / #537).

Both pin an exact balabs-risk-kernel release in their pyproject.toml.

Change flow

Kernel logic changes land here first. Release, then bump consumers:

  1. Make the change in src/risk_kernel/.
  2. Merge with a conventional-commit message. After ci.yml passes on main, release.yml runs python-semantic-release to create a tag and GitHub release, then dispatches publish.yml to build that tag and publish to PyPI with OIDC. Package versions come from Git tags; no version-bump commit is needed.
  3. Bump the pin in consumers (core, core-api pyproject.toml).

The PyPI trusted publisher for balabs-risk-kernel must authorize the publish.yml workflow. To retry a publish, manually run Publish with the existing release tag as its tag input.

There is no per-model commit pin and no diff-against-core sync step: this repo no longer mirrors core. core is a consumer, not the origin.

What the package deliberately excludes

The kernels here are pure compute only — the impure layers that live in core (datasources, pipelines, persistence, tasks, calibration, forecasters, wall fetchers/sources) are intentionally not vendored.

Metadata

Release files for balabs-risk-kernel 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for balabs-risk-kernel 1.0.2
File Size Uploaded Provenance Actions
balabs_risk_kernel-1.0.2.tar.gz 39.1 kB With provenance Details for balabs_risk_kernel-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for balabs-risk-kernel 1.0.2
File Interpreter ABI Platform Actions
balabs_risk_kernel-1.0.2-py3-none-any.whl Python 3 none any Details for balabs_risk_kernel-1.0.2-py3-none-any.whl

Total release size: 86.2 kB

Release files / balabs_risk_kernel-1.0.2.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL balabs_risk_kernel-1.0.2.tar.gz
Size 39.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d0860dac52092ee3bba8aae17e9ceb572a75d3063480fdbbb2fe3596bbc62bf8
BLAKE2b-256 checksum
How to use checksums
38d5a45c02d60f2a47f8e37fe0d1d5d376c1fa7eb985626d8fed8e462429bda3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / balabs_risk_kernel-1.0.2-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL balabs_risk_kernel-1.0.2-py3-none-any.whl
Size 47.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68410de5f8f830c0f590d7ae7800c5c96658c1f9e89770f394ed6d1f3bd0b465
BLAKE2b-256 checksum
How to use checksums
18eb4e07cbc688b29f998ade6e2c5875f90d8a2544fc4ba13c86efb16fd22eef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for balabs-risk-kernel 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Change of provenance

The configuration that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for balabs_risk_kernel-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page