Skip to main content

XXFIN

Install

Install the consumer package:

pip install py10x-fin-base
# or: uv pip install py10x-fin-base

That pulls py10x-fin-base-cxx transitively (import cxxfin). Do not depend on the cxx dist directly. Requires Python >=3.11,<3.14 and a published py10x-core (plus its kernel/infra).

To also use the AADC JIT-compiled path (see below), install the aadc extra: pip install "py10x-fin-base[aadc]" (forwards to py10x-core[aadc]).

In this monorepo the packaging root is xx_fin/. Domain developers use the py10x development install (./xx-build init, then plain uv sync, from the repo root: fin-base and cxxfin come editable from this tree) — see CONTRIBUTING.md.

from xxfin.ccy import Ccy
import cxxfin  # native extension from py10x-fin-base-cxx

About

xxfin (py10x-fin-base) is the first subject domain of 10x Genaxy.

The package serves a dual purpose:

  • to illustrate how a subject domain might use the capabilities of the substratum of 10x Genaxy (py10x-core) by implementing a sufficiently rich example solving an important problem in an important subject domain
  • to provide a complete working implementation of the most foundational valuation problem in the financial domain: calculating today's price of a fixed amount of a future cash flow denominated in any currency.

To achieve this goal, one needs to determine the relevant currency/foreign exchange (FX) rates and discount factors in a manner consistent with the current market data. Hence, we define all the necessary data structures for market data, including:

  • an ingestion/translation facility for collecting market data from any chosen data providers
  • generation/population/storage objects for standard quoted market data
  • models for calibrating complex/"synthetic" objects (forward curves), allowing calculation of rates/values that are not directly observable but are consistent with all the relevant markets

The sequence of the valuation steps is as follows:

  • We create market data objects ("quotables") that contain the market quotes and are stored in a user-specified market data store.
  • The user specifies an external market data provider.
  • An adapter is needed to translate the market data from the provider's format and populate our quotables.
    • We may provide such an adapter for a commonly used provider (e.g., Bloomberg), and, at a later date, add more adapters if demand warrants it.
    • We create a sample set of quotables which allow us to illustrate the use of market data.
  • Each piece of market data is quoted as a number (or a collection of numbers) representing values/parameters of certain standard financial contracts, and the set of specifications sufficient to describe and value such standardized contracts is saved in "market convention" objects.

The subset of all market quotables used to build/calibrate synthetic market data (forward curves) is called a market assembly. It usually consists of the most liquid contracts that provide the most precise view of market participants on the market (e.g., the most liquid swap or FX forward quotes). Once we ingest the market quotes from the data provider(s) into the quotables, we use a market assembly to build/calibrate the forward curve using a chosen calibration procedure. The subsequent use of the curves built this way is completely agnostic to the curve calibration choices. Hence, the market assembly, as well as the calibration analytics, can be replaced by the user's preferred choices (see Choosing the curve builder).

The discount curve for a discount rate in a given currency is built using that currency-denominated standard cash deposit and fixed-floating swap market quotes, with that rate as the underlying/reference floating rate for the instruments listed in a market assembly (e.g., for the SOFR curve we use USD cash deposits and SOFR standard annual fixed/floating swap quotes).

For FX forward curve construction, we currently use FX spot and FX forward (point) quotes for rates funded/collateralized in the same currency (e.g., USD). We build an FX curve for a market assembly-specified set of FX spot and FX USD-collateralized forwards consistent with the funding currency's discount curve.

Such an FX forward curve allows us to calculate the present value, in any given currency, of a cash flow denominated in any other currency.

Choosing the curve builder

Instruments and FX curves never name the discount-curve class: they build ZeroRateCurve.selected_class(), the class registered for ZeroRateCurve in a SelectableTraitableRecord (py10x-core's SelectableTraitableClass), or ZeroRateCurve itself, the native bootstrap, when none is. To calibrate your own way, subclass ZeroRateCurve, override payload_get() to return the bootstrapped RateCurve, and register the subclass:

from core_10x.selectable_traitable_class import SelectableTraitableRecord
from xxfin.ir_zero_rate_curve import ZeroRateCurve
from xxfin.ir_zero_rate_curve_ql import ZeroRateCurveQL

SelectableTraitableRecord(selectable_base_class = ZeroRateCurve, selected_class = ZeroRateCurveQL, _replace = True).save()

The record is saved to the store, so the choice holds for every process that uses it; no call site changes. An unsaved record selects the class for the current process only. ZeroRateCurveQL (ir_zero_rate_curve_ql.py), a QuantLib PiecewiseLinearZero bootstrap of deposits and OIS swaps, is the worked example of such a subclass, and the tests use it to check the native Python and C++ bootstraps against QuantLib.

Optional JIT acceleration via AADC

Install the aadc extra first -- see Install. xxfin's curve/valuation code is one consumer of xxcommon's generic AadcExec JIT-recording facility -- see xxcommon/README.md for what it is and how it's used. xxfin itself works fully without it. AadcExec records the Python implementations: leave XXFIN_USE_CXXFIN off (the default) when recording, since the cxxfin C++ implementations compute on plain doubles and are not recorded on the AADC tape.

The facility used to be xxfin.jit_aadc; it is now xxcommon.jit_aadc in py10x-core, and the old module is archived under xxfin/attic/jit_aadc/.

An easy setup to start playing with xxfin package

  • install mongodb on your machine and run without authentication (default)
  • set environment variables:
    • XX_MAIN_TS_STORE_URI=mongodb://localhost/xx_fin (or any other MongoDb)
    • XXFIN_DEFAULT_PRICING_CONTEXT_NAME=Abu Dhabi 20251010
  • run xxfin/dev_data_helpers/RUN_ME.py (it will store a number of objects)
  • you are ready to go!

Metadata

Release files for py10x-fin-base 0.2.0

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

Source distribution (sdist)

Source distribution for py10x-fin-base 0.2.0
File Size Uploaded Provenance Actions
py10x_fin_base-0.2.0.tar.gz 130.2 kB With provenance Details for py10x_fin_base-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py10x-fin-base 0.2.0
File Interpreter ABI Platform Actions
py10x_fin_base-0.2.0-py3-none-any.whl Python 3 none any Details for py10x_fin_base-0.2.0-py3-none-any.whl

Total release size: 260.3 kB

Release files / py10x_fin_base-0.2.0.tar.gz

Download URL py10x_fin_base-0.2.0.tar.gz
Size 130.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bcee35346e43a3519b4eaa8e06f926223bc899a15cab9995799e335c0151d8ad
BLAKE2b-256 checksum
How to use checksums
894ab1a00ae156bd080afe47b37406d3f2d428fdf78c7ad0458c75cd934934d6
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 Nov 18, 2026.

Transparency log

Release files / py10x_fin_base-0.2.0-py3-none-any.whl

Download URL py10x_fin_base-0.2.0-py3-none-any.whl
Size 130.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e4eafc6197bfe49f568b6e1f992665bdc159fccb5e4eed57f9e1da99723baad
BLAKE2b-256 checksum
How to use checksums
a5cc415e84c27a55572bd761fdc47aac486a21483cb728ff2c9b26d71a81de6d
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 Nov 18, 2026.

Transparency log

Security for py10x-fin-base 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for py10x_fin_base-0.2.0.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 Nov 18, 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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