fuggers_py.calc

Pricing routers, shared output DTOs, orchestration, and runtime wiring.

.. py:module:: fuggers_py.calc

Public calc-layer surface for orchestration, routing, and output records.

This package exports the synchronous pricing facade, the reactive runtime components underneath it, the routing/specification helpers, the graph and scheduler primitives, and the typed output records used by the engine.

.. py:class:: AlertPublisher(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.AlertPublisher

Protocol for publishing alert messages.

.. py:class:: AnalyticsCurves(discount_curve=None, forward_curve=None, government_curve=None, benchmark_curve=None, credit_curve=None, repo_curve=None, collateral_curve=None, fx_forward_curve=None, multicurve_environment=None, projection_curves=, inflation_curve=None, inflation_curves=, vol_surface=None) :module: fuggers_py.calc :canonical: fuggers_py.market.state.AnalyticsCurves

Container for the curve roles used by analytics and pricing flows.

The container keeps role-based access explicit so callers can distinguish discount, projection, repo, inflation, and volatility inputs without relying on positional arguments or implicit fallbacks.

.. py:method:: AnalyticsCurves.get(role) :module: fuggers_py.calc

  Resolve a curve by canonical role name or projection alias.

  The lookup accepts the named top-level roles defined on the container
  plus ``projection:<name>`` and ``inflation:<name>`` aliases for keyed
  sub-curves.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`object\` \| \:py\:obj\:\`None\``

.. py:class:: AnalyticsPublisher(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.AnalyticsPublisher

Protocol for publishing any supported analytics output.

.. py:class:: BatchPricingResult(outputs=, errors=) :module: fuggers_py.calc :canonical: fuggers_py.calc.pricing_router.BatchPricingResult

Container for successful and failed batch-pricing outputs.

Successes and failures preserve insertion order to match the original batch request as closely as possible.

.. py:property:: BatchPricingResult.successes :module: fuggers_py.calc :type: tuple[~fuggers_py.calc.output.BondQuoteOutput, …]

  Return the successful outputs in insertion order.

.. py:property:: BatchPricingResult.failures :module: fuggers_py.calc :type: tuple[~fuggers_py.calc.pricing_router.PricingFailure, …]

  Return the structured failures in insertion order.

.. py:class:: BasisSwapQuoteOutput(instrument_id=None, pricing_path=None, basis_spread=None, present_value=None, pay_leg_pv=None, receive_leg_pv=None, dv01=None, pv01=None, warnings=(), notes=(), settlement_date=None, timestamp=None, source=None, is_stale=False, quality_score=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.BasisSwapQuoteOutput

Basis-swap pricing output with raw decimals and signed DV01/PV01.

The basis spread is quoted as a raw decimal. The record preserves the pay and receive leg PVs so callers can inspect the leg contribution separately.

.. py:class:: BenchmarkReference(curve_id=None, tenor=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.pricing_specs.BenchmarkReference

Benchmark selector by curve identifier or tenor string.

Exactly one of curve_id or tenor should be set. The object is used to route spread calculations and benchmark-dependent analytics without forcing the caller to resolve the benchmark upfront.

.. py:method:: BenchmarkReference.by_curve(curve_id) :module: fuggers_py.calc :classmethod:

  Create a benchmark reference from a curve identifier.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.pricing\_specs.BenchmarkReference\``

.. py:method:: BenchmarkReference.by_tenor(tenor) :module: fuggers_py.calc :classmethod:

  Create a benchmark reference from a validated tenor string.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.pricing\_specs.BenchmarkReference\``

.. py:method:: BenchmarkReference.tenor_object() :module: fuggers_py.calc

  Return the parsed tenor object when a tenor was supplied.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.tenor.Tenor\` \| \:py\:obj\:\`None\``

.. py:class:: BidAskSpreadConfig(bid_adjustment=Decimal(‘0’), ask_adjustment=Decimal(‘0’)) :module: fuggers_py.calc :canonical: fuggers_py.calc.pricing_specs.BidAskSpreadConfig

Mid-to-side spread adjustments expressed in decimal units.

The adjustments are added to a mid value to produce the bid or ask quote. Positive values move the quote away from mid on the ask side and toward the bid side on the bid side only if the caller supplies symmetric widths via :meth:symmetric.

.. py:method:: BidAskSpreadConfig.symmetric(width) :module: fuggers_py.calc :classmethod:

  Build symmetric bid/ask adjustments from a total width.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.pricing\_specs.BidAskSpreadConfig\``

.. py:method:: BidAskSpreadConfig.asymmetric(*, bid_adjustment, ask_adjustment) :module: fuggers_py.calc :classmethod:

  Build bid and ask adjustments from explicit offsets.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.pricing\_specs.BidAskSpreadConfig\``

.. py:method:: BidAskSpreadConfig.adjust(mid_value, side) :module: fuggers_py.calc

  Return the side-specific quote implied by ``mid_value``.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~decimal.Decimal\``

.. py:class:: BondQuoteOutput(instrument_id=None, pricing_path=None, clean_price=None, dirty_price=None, accrued_interest=None, yield_to_maturity=None, yield_to_worst=None, current_yield=None, modified_duration=None, effective_duration=None, macaulay_duration=None, dv01=None, convexity=None, effective_convexity=None, key_rate_durations=, z_spread=None, g_spread=None, i_spread=None, oas=None, discount_margin=None, spread_duration=None, asset_swap_spread=None, benchmark_info=None, option_value=None, projected_next_coupon=None, next_reset_date=None, warnings=(), notes=(), settlement_date=None, timestamp=None, source=None, is_stale=False, quality_score=None, bid_price=None, mid_price=None, ask_price=None, ytc=None, pv01=None, cs01=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.BondQuoteOutput

Bond pricing output with explicit unit-bearing fields.

clean_price and dirty_price are percent-of-par price levels, unsuffixed yield and spread fields are raw decimals, and dv01/pv01 use the shared signed convention. Optional fields are left unset when the selected pricing path does not compute them.

.. py:class:: BuiltCurve(curve_id, curve, curve_inputs=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.curve_builder.BuiltCurve

Named curve bundle returned by the builder.

The wrapper preserves the curve identifier, the built curve object itself, and the original serialized inputs when available.

.. py:method:: BuiltCurve.of(curve_id, curve, *, curve_inputs=None) :module: fuggers_py.calc :classmethod:

  Create a built-curve wrapper from a curve identifier and payload.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.curve\_builder.BuiltCurve\``

.. py:method:: BuiltCurve.unwrap() :module: fuggers_py.calc

  Return the wrapped curve object.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`object\``

.. py:method:: BuiltCurve.reference_date() :module: fuggers_py.calc

  Return the curve reference date when it can be resolved.

.. py:class:: CalculationGraph(_nodes=) :module: fuggers_py.calc :canonical: fuggers_py.calc.calc_graph.CalculationGraph

Mutable dependency graph with cached node values and dirty tracking.

Nodes can be added lazily, marked dirty, updated with new cached values, and assigned to shards for distributed orchestration.

.. py:method:: CalculationGraph.add_node(node_id, *, value=None, shard_key=None, metadata=None) :module: fuggers_py.calc

  Register a node and optionally seed its cached value.

  Existing nodes are updated in place. This keeps node identity stable
  while allowing metadata, shard hints, and initial cached values to be
  attached lazily.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: CalculationGraph.has_node(node_id) :module: fuggers_py.calc

  Return ``True`` when the graph already contains the node.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``

.. py:method:: CalculationGraph.add_dependency(node_id, depends_on) :module: fuggers_py.calc

  Add a dependency edge from ``node_id`` to ``depends_on``.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: CalculationGraph.dependencies(node_id) :module: fuggers_py.calc

  Return the direct dependencies for a node.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: CalculationGraph.dependents(node_id) :module: fuggers_py.calc

  Return the direct dependents for a node.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: CalculationGraph.mark_dirty(node_id, *, propagate=True, include_self=True) :module: fuggers_py.calc

  Mark a node and, optionally, its dependents as dirty.

  :type node_id: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\` \| \:py\:class\:\`str\``
  :param node_id: Root node to mark.
  :type propagate: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``
  :param propagate: When ``True``, recursively mark downstream dependents.
  :type include_self: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``
  :param include_self: When ``False``, only downstream dependents are marked dirty.

  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: CalculationGraph.mark_dependents_dirty(node_id) :module: fuggers_py.calc

  Mark the downstream dependents of a node as dirty.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: CalculationGraph.clear_dirty(node_id) :module: fuggers_py.calc

  Clear the dirty flag for a node.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: CalculationGraph.query_dirty() :module: fuggers_py.calc

  Return all dirty nodes in deterministic order.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: CalculationGraph.update_node_value(node_id, value, *, revision=None, source=None, mark_clean=True) :module: fuggers_py.calc

  Store a new cached value and optionally clear the dirty flag.

  The revision is incremented automatically unless an explicit revision is
  supplied. Values are timestamped in UTC at the time of the update.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeValue\``

.. py:method:: CalculationGraph.get_node_value(node_id) :module: fuggers_py.calc

  Return the cached value for a node, if one exists.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeValue\` \| \:py\:obj\:\`None\``

.. py:method:: CalculationGraph.revision(node_id) :module: fuggers_py.calc

  Return the current cached revision for a node.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`int\``

.. py:method:: CalculationGraph.node_metadata(node_id) :module: fuggers_py.calc

  Return a copy of the node metadata.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`dict\`\\ \\\[\:py\:class\:\`str\`\, \:py\:class\:\`object\`\]`

.. py:method:: CalculationGraph.shard_assignment(node_id, config) :module: fuggers_py.calc

  Resolve the shard index and owner for a node.

  The shard index is derived from the node's explicit shard key when
  present, otherwise from the node identifier. Owners are selected either
  by modulo or by consistent hashing depending on ``config.strategy``.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.ShardAssignment\``

.. py:class:: CdsQuoteOutput(instrument_id=None, pricing_path=None, par_spread=None, upfront=None, present_value=None, cs01=None, pv01=None, risky_duration=None, recovery_rate=None, warnings=(), notes=(), settlement_date=None, timestamp=None, source=None, is_stale=False, quality_score=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.CdsQuoteOutput

CDS pricing output with spread, upfront, and recovery fields.

Par spread, upfront, PV, and PV01/CS01 are stored as raw decimals. Recovery rate is also kept as a raw decimal rather than a percentage.

.. py:class:: CronScheduler(node_ids, *, expression, check_interval_seconds=30.0) :module: fuggers_py.calc :canonical: fuggers_py.calc.scheduler.CronScheduler

Emit updates when a cron expression becomes due.

.. py:method:: CronScheduler.tick(now=None) :module: fuggers_py.calc :async:

  Emit a cron update when the next scheduled run has arrived.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: CurveBuilder(_curves=, _curve_inputs=) :module: fuggers_py.calc :canonical: fuggers_py.calc.curve_builder.CurveBuilder

Cache and name curves built from raw market data inputs.

The builder handles zero, discount, and forward curves. It sorts input points by tenor, handles single-pillar curves with a flat term structure, and stores the original :class:CurveInputs alongside the built result.

.. py:method:: CurveBuilder.add_zero_curve(curve_id, points, reference_date, *, interpolation=’linear’) :module: fuggers_py.calc

  Build and store a zero curve from raw curve points.

  The input points are sorted by tenor before calibration, and a single
  pillar is turned into a flat term structure so the builder still returns
  a usable curve object.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.market.curves.wrappers.rate\_curve.RateCurve\``

.. py:method:: CurveBuilder.add_discount_curve(curve_id, points, reference_date, *, interpolation=’log_linear’) :module: fuggers_py.calc

  Build and store a discount curve from raw curve points.

  The input points are sorted by tenor before calibration, and a single
  pillar is turned into a flat term structure so the builder still returns
  a usable curve object.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.market.curves.wrappers.rate\_curve.RateCurve\``

.. py:method:: CurveBuilder.add_forward_curve(curve_id, points, reference_date, *, interpolation=’linear’) :module: fuggers_py.calc

  Build and store a forward-rate view over the supplied points.

  The builder first stores the underlying zero curve, then wraps it in a
  forward-rate view so downstream code can query either representation.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.curve\_builder.ForwardRateCurve\``

.. py:method:: CurveBuilder.add_from_inputs(curve_inputs) :module: fuggers_py.calc

  Build a curve from a serialized :class:`~fuggers_py.market.market_data.CurveInputs` record.

  The `curve_kind` field selects whether the inputs produce a zero,
  discount, or forward curve.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`object\``

.. py:method:: CurveBuilder.get(curve_id) :module: fuggers_py.calc

  Return a previously built curve by identifier.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`object\``

.. py:method:: CurveBuilder.built_curve(curve_id) :module: fuggers_py.calc

  Return the curve together with the stored curve-input record.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.curve\_builder.BuiltCurve\``

.. py:method:: CurveBuilder.inputs_for(curve_id) :module: fuggers_py.calc

  Return the stored curve inputs for a curve identifier.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.market.market\_data.CurveInputs\``

.. py:method:: CurveBuilder.bundle(*, discount_curve=None, forward_curve=None, government_curve=None, benchmark_curve=None) :module: fuggers_py.calc

  Return an :class:`AnalyticsCurves` bundle from stored curve names.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.market.state.AnalyticsCurves\``

.. py:class:: CurveInputUpdate(*, timestamp=, source=None, curve_inputs) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.CurveInputUpdate

Update carrying new curve inputs.

.. py:exception:: CurveNotFoundError :module: fuggers_py.calc :canonical: fuggers_py.calc.errors.CurveNotFoundError

Raised when a named curve or stored curve input cannot be found.

.. py:class:: CurvePublisher(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.CurvePublisher

Protocol for publishing curve snapshots or inputs.

.. py:class:: CurveUpdate(*, timestamp=, source=None, curve_id, curve=None, curve_inputs=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.CurveUpdate

Update carrying a built curve or curve placeholder.

.. py:class:: EngineConfig(engine_name, as_of=None, update_frequency=UpdateFrequency.ON_DEMAND, nodes=(), allow_stale_data=True, timeout_seconds=30, default_pricing_config_id=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.config.EngineConfig

Top-level engine configuration.

:type engine_name: :sphinx_autodoc_typehints_type:\:py\:class\:\str`    :param engine_name: Stable engine identifier.    :type as_of: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.core.types.Date` | :py:obj:`None`    :param as_of: Optional valuation date used as the default settlement date.    :type update_frequency: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.calc.config.UpdateFrequency`    :param update_frequency: Cadence for the engine as a whole.    :type nodes: :sphinx_autodoc_typehints_type::py:class:`tuple`\ \[:py:class:`~fuggers_py.calc.config.NodeConfig`, :py:data:`…<Ellipsis>`]    :param nodes: Registered node configurations.    :type allow_stale_data: :sphinx_autodoc_typehints_type::py:class:`bool`    :param allow_stale_data: Whether stale market data may still be consumed.    :type timeout_seconds: :sphinx_autodoc_typehints_type::py:class:`int`    :param timeout_seconds: Default orchestration timeout.    :type default_pricing_config_id: :sphinx_autodoc_typehints_type::py:class:`str` | :py:obj:`None`` :param default_pricing_config_id: Optional pricing-configuration identifier.

.. rubric:: Notes

engine_name is normalized as a non-empty string. nodes are frozen into a tuple, timeout_seconds must be positive, and as_of is reused as the default settlement date when the builder does not supply one explicitly.

.. py:exception:: EngineConfigurationError :module: fuggers_py.calc :canonical: fuggers_py.calc.errors.EngineConfigurationError

Raised when an engine component is missing a required dependency.

.. py:exception:: EngineError :module: fuggers_py.calc :canonical: fuggers_py.calc.errors.EngineError

Base exception for calc-layer failures.

.. py:class:: EodScheduler(node_ids, *, run_time=None, check_interval_seconds=60.0) :module: fuggers_py.calc :canonical: fuggers_py.calc.scheduler.EodScheduler

Emit once per date after the configured end-of-day time.

.. py:method:: EodScheduler.due(now) :module: fuggers_py.calc

  Return ``True`` when the scheduler should emit for ``now``.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``

.. py:method:: EodScheduler.tick(now=None) :module: fuggers_py.calc :async:

  Emit an EOD update once the configured time has been reached.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: EtfAnalyticsOutput(etf_id=None, gross_market_value=Decimal(‘0’), nav=None, inav=None, shares_outstanding=Decimal(‘1’), weighted_duration=None, weighted_convexity=None, aggregate_dv01=None, weighted_z_spread=None, weighted_g_spread=None, weighted_i_spread=None, holding_count=0, priced_count=0, fully_priced=False, settlement_date=None, timestamp=None, source=None, is_stale=False, quality_score=None, bid_price=None, mid_price=None, ask_price=None, pv01=None, cs01=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.EtfAnalyticsOutput

ETF analytics output with explicit units and signed risk aliases.

Market value, NAV, holdings-weighted risk, and spread metrics are stored as raw decimals. aggregate_dv01 and pv01 are treated as aliases.

.. py:class:: EtfPublisher(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.EtfPublisher

Protocol for publishing ETF analytics outputs.

.. py:class:: ForwardRateCurve(curve) :module: fuggers_py.calc :canonical: fuggers_py.calc.curve_builder.ForwardRateCurve

Forward-rate view over a zero-rate curve.

The wrapper keeps the underlying zero-curve object but exposes forward-rate accessors for code that expects a forward-curve interface.

.. py:method:: ForwardRateCurve.reference_date() :module: fuggers_py.calc

  Return the curve reference date.

.. py:method:: ForwardRateCurve.forward_rate_at(tenor) :module: fuggers_py.calc

  Return the zero rate at a tenor using the wrapped curve.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`float\``

.. py:method:: ForwardRateCurve.forward_rate(start, end) :module: fuggers_py.calc

  Return the implied forward rate between two dates.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`float\``

.. py:class:: FundingPricingRouter() :module: fuggers_py.calc :canonical: fuggers_py.calc.funding_pricing_router.FundingPricingRouter

Price repo trades against an optional repo curve.

.. py:method:: FundingPricingRouter.price_repo(trade, *, repo_curve=None) :module: fuggers_py.calc

  Price a repo trade and report carry and spread diagnostics.

  The funding spread is reported as ``trade.rate - curve_zero_rate`` so a
  positive spread indicates the trade funds above the curve. When no repo
  curve is supplied, the curve-derived fields are left unset.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.RepoPricingResult\``

.. py:method:: FundingPricingRouter.price_batch(trades, *, repo_curve=None) :module: fuggers_py.calc

  Price a batch of repo trades against the same curve input.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.output.RepoPricingResult\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: FutureQuoteOutput(instrument_id=None, pricing_path=None, futures_price=None, fair_value=None, implied_repo_rate=None, net_basis=None, gross_basis=None, conversion_factor=None, dv01=None, pv01=None, ctd_instrument_id=None, warnings=(), notes=(), settlement_date=None, timestamp=None, source=None, is_stale=False, quality_score=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.FutureQuoteOutput

Future pricing output with price levels and signed DV01/PV01.

The record carries the futures price, implied repo, basis measures, and the cheapest-to-deliver reference instrument when one is resolved.

.. py:class:: FxRateUpdate(*, timestamp=, source=None, fx_rate) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.FxRateUpdate

Update carrying an FX rate.

.. py:class:: InMemoryLeaderElection(_leader=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.InMemoryLeaderElection

Single-leader in-memory election helper for deterministic tests.

.. py:method:: InMemoryLeaderElection.acquire(candidate_id) :module: fuggers_py.calc

  Acquire leadership for the candidate if no leader is set.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``

.. py:method:: InMemoryLeaderElection.release(candidate_id) :module: fuggers_py.calc

  Release leadership if the candidate currently owns it.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``

.. py:method:: InMemoryLeaderElection.leader() :module: fuggers_py.calc

  Return the current leader identifier, if any.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`str\` \| \:py\:obj\:\`None\``

.. py:class:: InMemoryPartitionRegistry(_assignments=) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.InMemoryPartitionRegistry

Deterministic in-memory partition registry for tests and research flows.

.. py:method:: InMemoryPartitionRegistry.assign(partition_id, owner_id) :module: fuggers_py.calc

  Assign a partition to an owner and bump the version.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.coordination.PartitionAssignment\``

.. py:method:: InMemoryPartitionRegistry.release(partition_id) :module: fuggers_py.calc

  Release a partition if it is currently assigned.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: InMemoryPartitionRegistry.owner(partition_id) :module: fuggers_py.calc

  Return the current owner for a partition.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`str\` \| \:py\:obj\:\`None\``

.. py:method:: InMemoryPartitionRegistry.list_assignments() :module: fuggers_py.calc

  Return all assignments in partition order.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.coordination.PartitionAssignment\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: InMemoryServiceRegistry(_registrations=) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.InMemoryServiceRegistry

Deterministic in-memory service registry for tests and research flows.

.. py:method:: InMemoryServiceRegistry.register(registration) :module: fuggers_py.calc

  Store a service registration and return it.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.coordination.ServiceRegistration\``

.. py:method:: InMemoryServiceRegistry.deregister(service_name, node_id) :module: fuggers_py.calc

  Remove a service registration if it exists.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: InMemoryServiceRegistry.get_service(service_name, node_id) :module: fuggers_py.calc

  Return a registered service instance for the given key.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.coordination.ServiceRegistration\` \| \:py\:obj\:\`None\``

.. py:method:: InMemoryServiceRegistry.list_services(service_name=None) :module: fuggers_py.calc

  Return registered services, optionally filtered by service name.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.coordination.ServiceRegistration\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: IndexFixingUpdate(*, timestamp=, source=None, fixing) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.IndexFixingUpdate

Update carrying an index fixing.

.. py:class:: InflationFixingUpdate(*, timestamp=, source=None, fixing) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.InflationFixingUpdate

Update carrying an inflation fixing.

.. py:class:: IntervalScheduler(node_ids, *, interval_seconds, immediate=False) :module: fuggers_py.calc :canonical: fuggers_py.calc.scheduler.IntervalScheduler

Emit updates on a fixed cadence.

.. py:method:: IntervalScheduler.tick(now=None) :module: fuggers_py.calc :async:

  Emit an interval update immediately when ticked.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: LeaderElection(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.LeaderElection

Protocol for single-leader coordination backends.

.. py:class:: MarketDataListener(calc_graph, curve_builder=None, quote_source=, curve_source=, fixing_source=, fx_rate_source=, inflation_fixing_source=, volatility_source=, throttle_manager=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.MarketDataListener

Translate market-data updates into graph updates and cache writes.

.. py:method:: MarketDataListener.quote_node_id(instrument_id) :module: fuggers_py.calc :staticmethod:

  Return the graph node identifier for a quote.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: MarketDataListener.curve_input_node_id(curve_id) :module: fuggers_py.calc :staticmethod:

  Return the graph node identifier for curve inputs.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: MarketDataListener.curve_node_id(curve_id) :module: fuggers_py.calc :staticmethod:

  Return the graph node identifier for a built curve.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: MarketDataListener.fixing_node_id(index_name, fixing_date) :module: fuggers_py.calc :staticmethod:

  Return the graph node identifier for a fixing.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: MarketDataListener.inflation_node_id(index_name, observation_month) :module: fuggers_py.calc :staticmethod:

  Return the graph node identifier for an inflation fixing.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: MarketDataListener.fx_node_id(currency_pair) :module: fuggers_py.calc :staticmethod:

  Return the graph node identifier for an FX rate.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: MarketDataListener.vol_surface_node_id(surface_id) :module: fuggers_py.calc :staticmethod:

  Return the graph node identifier for a volatility surface.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: MarketDataListener.handle_update(update) :module: fuggers_py.calc :async:

  Apply a market-data update to the caches and dependency graph.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: MarketDataListener.handle_scheduler_update(update) :module: fuggers_py.calc :async:

  Mark a scheduler-triggered node and its dependents dirty.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: MarketDataListener.drain_once(queue) :module: fuggers_py.calc :async:

  Drain a single item from a queue and route it through the listener.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: MarketDataPublisher() :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.MarketDataPublisher

Async fanout helper for broadcasting market-data updates.

.. py:method:: MarketDataPublisher.subscribe() :module: fuggers_py.calc

  Create and register a subscriber queue.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~asyncio.queues.Queue\``

.. py:method:: MarketDataPublisher.unsubscribe(queue) :module: fuggers_py.calc

  Remove a previously registered subscriber queue.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: MarketDataPublisher.publish(update) :module: fuggers_py.calc :async:

  Publish an update to all current subscribers.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:class:: MarketDataUpdate(*, timestamp=, source=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.MarketDataUpdate

Base record for a market-data event.

.. py:class:: NodeConfig(node_id, service_name, update_frequency=UpdateFrequency.ON_DEMAND, enabled=True, transport=None, partitions=(), tags=()) :module: fuggers_py.calc :canonical: fuggers_py.calc.config.NodeConfig

Configuration for a single engine node.

:type node_id: :sphinx_autodoc_typehints_type:\:py\:class\:\str`    :param node_id: Stable identifier for the node.    :type service_name: :sphinx_autodoc_typehints_type::py:class:`str`    :param service_name: Logical service that owns the node.    :type update_frequency: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.calc.config.UpdateFrequency`    :param update_frequency: Expected cadence for updates.    :type enabled: :sphinx_autodoc_typehints_type::py:class:`bool`    :param enabled: Whether the node participates in orchestration.    :type transport: :sphinx_autodoc_typehints_type::py:class:`str` | :py:obj:`None`    :param transport: Optional transport name used by external coordination layers.    :type partitions: :sphinx_autodoc_typehints_type::py:class:`tuple`\ \[:py:class:`str`, :py:data:`…<Ellipsis>`]    :param partitions: Optional partition labels associated with the node.    :type tags: :sphinx_autodoc_typehints_type::py:class:`tuple`\ \[:py:class:`str`, :py:data:`…<Ellipsis>`]` :param tags: Optional free-form tags for discovery and filtering.

.. rubric:: Notes

Text fields are stripped and validated as non-empty. partitions and tags are frozen into tuples so the record remains hashable and stable.

.. py:class:: NodeId(value) :module: fuggers_py.calc :canonical: fuggers_py.calc.calc_graph.NodeId

Normalized node identifier used throughout the engine graph.

Node identifiers are stripped, validated, and stored as canonical strings so graph lookups remain stable across the reactive runtime.

.. py:method:: NodeId.parse(value) :module: fuggers_py.calc :classmethod:

  Parse a node identifier from an arbitrary value.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: NodeId.from_string(value) :module: fuggers_py.calc :classmethod:

  Parse a node identifier from text.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: NodeId.as_str() :module: fuggers_py.calc

  Return the normalized node identifier as a string.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`str\``

.. py:class:: NodeUpdate(node_id, source, timestamp=, payload=None, detail=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.scheduler.NodeUpdate

Timestamped node update emitted by a scheduler or market-data path.

The payload is left generic so the reactive layer can carry scheduler, market-data, or graph-update objects through the same queue.

.. py:class:: NodeValue(value=None, revision=0, updated_at=None, source=None, stale=False) :module: fuggers_py.calc :canonical: fuggers_py.calc.calc_graph.NodeValue

Cached node payload stored in the calculation graph.

The record stores the cached value together with its revision, update timestamp, source label, and stale flag.

.. py:class:: OutputPublisher(quote_publisher=None, curve_publisher=None, etf_publisher=None, analytics_publisher=None, alert_publisher=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.OutputPublisher

Composite publisher that delegates to optional channel publishers.

The helper keeps the publish path optional: if a dedicated channel is not configured, the corresponding publish method becomes a no-op.

.. py:method:: OutputPublisher.publish_quote(quote) :module: fuggers_py.calc

  Publish a bond quote when a quote publisher is configured.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: OutputPublisher.publish_curve(curve_id, curve) :module: fuggers_py.calc

  Publish a curve payload when a curve publisher is configured.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: OutputPublisher.publish_etf(analytics) :module: fuggers_py.calc

  Publish ETF analytics when an ETF publisher is configured.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: OutputPublisher.publish_analytics(analytics) :module: fuggers_py.calc

  Publish analytics or fall back to the specific channel handlers.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: OutputPublisher.publish_alert(message, *, severity=’info’) :module: fuggers_py.calc

  Publish an alert when an alert publisher is configured.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:class:: PartitionAssignment(partition_id, owner_id=None, version=0) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.PartitionAssignment

Current owner and version of a partition.

.. py:class:: PartitionRegistry(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.PartitionRegistry

Protocol for partition ownership backends.

.. py:class:: PortfolioAnalyticsOutput(portfolio_id=None, total_market_value=Decimal(‘0’), total_dirty_value=Decimal(‘0’), weighted_duration=None, weighted_convexity=None, aggregate_dv01=None, weighted_z_spread=None, weighted_g_spread=None, weighted_i_spread=None, key_rate_durations=, sector_breakdown=, rating_breakdown=, position_count=0, priced_count=0, fully_priced=False, settlement_date=None, timestamp=None, source=None, is_stale=False, quality_score=None, pv01=None, cs01=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.PortfolioAnalyticsOutput

Portfolio analytics output with explicit units and signed risk aliases.

The record keeps market value, dirty value, weighted risk, and the optional key-rate, sector, and rating breakdowns used by portfolio analytics.

.. py:class:: PricingEngine(config, market_data_provider, reference_data_provider, storage_adapter=, output_publisher=, settlement_date=None, calc_graph=, curve_builder=, pricing_router=, etf_pricer=, portfolio_analyzer=, reactive_engine=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.builder.PricingEngine

Synchronous facade that owns the reactive runtime and shared services.

The facade is the stable entry point for research code. It holds the shared config, market-data and reference-data providers, the calc graph, the curve builder, the router, and the optional reactive runtime.

.. py:method:: PricingEngine.start() :module: fuggers_py.calc :async:

  Start the underlying reactive runtime if one is attached.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: PricingEngine.stop() :module: fuggers_py.calc :async:

  Stop the underlying reactive runtime if one is attached.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: PricingEngine.create(*, engine_config, market_data_provider, reference_data_provider, storage_adapter=None, output_publisher=None, settlement_date=None) :module: fuggers_py.calc :classmethod:

  Build a pricing engine with the default builder configuration.

  The helper is a convenience wrapper around :class:`PricingEngineBuilder`
  for callers that want the default wiring without using the fluent API.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngine\``

.. py:class:: PricingEngineBuilder(engine_config=None, market_data_provider=None, reference_data_provider=None, storage_adapter=, output_publisher=, settlement_date=None, calc_graph=None, curve_builder=None, pricing_router=None, etf_pricer=None, portfolio_analyzer=None, market_data_publisher=None, schedulers=) :module: fuggers_py.calc :canonical: fuggers_py.calc.builder.PricingEngineBuilder

Fluent builder for the pricing-engine and reactive-engine pair.

The builder keeps construction explicit: required providers must be set before build, optional schedulers and storage/publisher dependencies can be layered in, and curve inputs already exposed by the market-data provider are loaded before the reactive engine is created.

.. py:method:: PricingEngineBuilder.new() :module: fuggers_py.calc :classmethod:

  Return a fresh builder instance.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_engine_config(config) :module: fuggers_py.calc

  Set the top-level engine configuration.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_market_data_provider(provider) :module: fuggers_py.calc

  Set the required market-data provider.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_reference_data_provider(provider) :module: fuggers_py.calc

  Set the required reference-data provider.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_storage_adapter(adapter) :module: fuggers_py.calc

  Set the storage adapter used by the reactive runtime.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_output_publisher(publisher) :module: fuggers_py.calc

  Set the output publisher used by the reactive runtime.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_settlement_date(settlement_date) :module: fuggers_py.calc

  Set the default settlement date used by built engines.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_scheduler(scheduler) :module: fuggers_py.calc

  Attach a scheduler object to the reactive engine.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_default_interval_scheduler(node_ids, *, interval_seconds, immediate=False) :module: fuggers_py.calc

  Attach an interval scheduler using the built-in scheduler type.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.with_default_eod_scheduler(node_ids, *, run_time=None) :module: fuggers_py.calc

  Attach an EOD scheduler using the built-in scheduler type.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngineBuilder\``

.. py:method:: PricingEngineBuilder.validate() :module: fuggers_py.calc

  Check that the builder has the required provider dependencies.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: PricingEngineBuilder.build() :module: fuggers_py.calc

  Build the synchronous pricing engine and its reactive runtime.

  Curve inputs already available from the market-data provider are loaded
  into the curve builder before the reactive engine is created. Missing
  market-data or reference-data providers fail fast through
  :class:`EngineConfigurationError`.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.builder.PricingEngine\``

.. py:method:: PricingEngineBuilder.build_reactive() :module: fuggers_py.calc

  Build and return just the reactive runtime.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.reactive.ReactiveEngine\``

.. py:class:: PricingFailure(key, error_type, message) :module: fuggers_py.calc :canonical: fuggers_py.calc.pricing_router.PricingFailure

Structured failure record returned by batch pricing.

The record keeps the batch key, exception type, and message so a caller can report a partial failure without losing the request identity.

.. py:class:: PricingInput(instrument, settlement_date, market_price=None, pricing_spec=None, curves=None, curve_roles=, market_data=None, reference_data=None, instrument_id=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.pricing_router.PricingInput

Single pricing request used by the batch router.

:type instrument: :sphinx_autodoc_typehints_type:\:py\:class\:\object`    :param instrument: Instrument or bond reference data to price.    :type settlement_date: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.core.types.Date`    :param settlement_date: Economic settlement date for accrual and discounting.    :type market_price: :sphinx_autodoc_typehints_type::py:class:`object` | :py:obj:`None`    :param market_price: Input market price. For fixed and callable bonds this is interpreted as                         a clean price unless the pricing spec says otherwise.    :type pricing_spec: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.calc.pricing_specs.PricingSpec` | :py:obj:`None`    :param pricing_spec: Optional pricing directives.    :type curves: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.market.state.AnalyticsCurves` | :py:obj:`None`    :param curves: Optional curve bundle used by the pricing path.    :type curve_roles: :sphinx_autodoc_typehints_type::py:class:`dict`\ \[:py:class:`str`, :py:class:`~fuggers_py.core.ids.CurveId` | :py:class:`str`]    :param curve_roles: Convenience mapping from logical curve roles to curve identifiers.    :type market_data: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.market.market_data.MarketDataSnapshot` | :py:class:`~fuggers_py.market.market_data.MarketDataProvider` | :py:class:`~fuggers_py.market.market_data.QuoteSource` | :py:class:`~fuggers_py.market.market_data.IndexFixingSource` | :py:class:`~fuggers_py.market.market_data.InflationFixingSource` | :py:obj:`None`    :param market_data: Optional market-data snapshot or provider used to resolve quotes and                        fixings.    :type reference_data: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.reference.reference_data.BondReferenceData` | :py:class:`dict`\ \[:py:class:`~fuggers_py.core.ids.InstrumentId`, :py:class:`~fuggers_py.reference.reference_data.BondReferenceData`] | :py:obj:`None`    :param reference_data: Optional reference data used to resolve instruments and metadata.    :type instrument_id: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.core.ids.InstrumentId` | :py:class:`str` | :py:obj:`None`` :param instrument_id: Explicit instrument identifier override.

.. rubric:: Notes

The request object keeps the original batch shape so failures can be tied back to the request that produced them.

.. py:method:: PricingInput.resolved_instrument_id() :module: fuggers_py.calc

  Return the best-effort instrument identifier for the request.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.core.ids.InstrumentId\` \| \:py\:obj\:\`None\``

.. py:method:: PricingInput.key(index) :module: fuggers_py.calc

  Return a stable batch key for the request.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`str\``

.. py:class:: PricingRouter() :module: fuggers_py.calc :canonical: fuggers_py.calc.pricing_router.PricingRouter

Route bond instruments to the appropriate pricing path.

The router keeps fixed, floating, TIPS, and callable bond logic in one place while preserving clean-price semantics, curve lookups, and failure-isolated batch behavior.

.. py:method:: PricingRouter.price(instrument, settlement_date, *, market_price=None, pricing_spec=None, curves=None, market_data=None, reference_data=None, instrument_id=None) :module: fuggers_py.calc

  Price a single bond instrument.

  Fixed and callable bonds use clean-price semantics by default. Floating
  rate notes use their coupon/fixing path and may interpret the supplied
  market price as dirty or clean depending on the pricing spec.

  The router resolves instrument references, sources quotes and fixings
  from the provided market-data inputs when needed, and raises
  :class:`RoutingError` when the instrument type is unsupported.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.BondQuoteOutput\``

.. py:method:: PricingRouter.price_batch(inputs) :module: fuggers_py.calc

  Price a batch of bonds and isolate failures per request.

  Each request is priced independently. A failure in one item is captured
  as a :class:`PricingFailure` entry without aborting the remaining batch.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.pricing\_router.BatchPricingResult\``

.. py:method:: PricingRouter.price_fixed(instrument, settlement_date, *, instrument_id=None, market_price=None, pricing_spec=None, curves=None, market_data=None) :module: fuggers_py.calc

  Price a fixed, zero-coupon, or callable bond from a clean price.

  The input market price is treated as clean unless ``pricing_spec``
  explicitly marks it as dirty. The method derives dirty price, accrued
  interest, yields, and optional risk measures from that clean-price
  anchor. When market data is supplied, the method can source the quote
  side requested by the pricing spec instead of requiring the caller to
  pre-resolve the market price.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.BondQuoteOutput\``

.. py:method:: PricingRouter.price_tips(instrument, settlement_date, *, instrument_id=None, market_price=None, pricing_spec=None, market_data=None) :module: fuggers_py.calc

  Price a TIPS bond from a clean or dirty market price and solve a real yield.

  The pricing path uses inflation fixings from the provided market-data
  inputs when available and reports the projected next coupon in real
  terms.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.BondQuoteOutput\``

.. py:method:: PricingRouter.price_callable(instrument, settlement_date, *, instrument_id=None, market_price=None, pricing_spec=None, curves=None, market_data=None) :module: fuggers_py.calc

  Price a callable bond and optionally attach an OAS analysis.

  Callable bonds are priced through the Hull-White helper so option value,
  yield-to-worst, and callable spreads stay tied to the same pricing
  path.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.BondQuoteOutput\``

.. py:method:: PricingRouter.price_floating(instrument, settlement_date, *, instrument_id=None, market_price=None, pricing_spec=None, curves=None, market_data=None) :module: fuggers_py.calc

  Price a floating-rate note using fixing-aware accrued-interest logic.

  Floating notes can source market prices, curve inputs, and fixings from
  the supplied market-data bundle before the coupon path is evaluated.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.BondQuoteOutput\``

.. py:class:: PricingSpec(quote_side=QuoteSide.MID, market_price_is_dirty=None, compute_spreads=True, compute_risk=True, compute_key_rates=False, compute_current_yield=True, compute_yield_to_worst=True, include_asset_swap=False, asset_swap_type=ASWType.PAR_PAR, route_callable_with_oas=True, route_floating_with_discount_margin=True, callable_mean_reversion=Decimal(‘0.03’), callable_volatility=Decimal(‘0.01’), benchmark_reference=None, bid_ask=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.pricing_specs.PricingSpec

Pricing engine configuration and output selection toggles.

This record controls how the router interprets the market price, which risk and spread fields to compute, whether callable and floating paths should use auxiliary spread measures, and which benchmark or bid/ask adjustments to apply. Rates, spreads, and vol inputs remain in raw decimal units.

.. py:class:: QuotePublisher(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.QuotePublisher

Protocol for publishing bond quote outputs.

.. py:class:: QuoteSide(value) :module: fuggers_py.calc :canonical: fuggers_py.market.state.QuoteSide

Canonical quote-side selector used across market records.

.. py:class:: QuoteUpdate(*, timestamp=, source=None, quote) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.QuoteUpdate

Update carrying a new quote.

.. py:class:: ReactiveEngine(calc_graph, curve_builder, pricing_router, market_data_provider, reference_data_provider, storage_adapter=, output_publisher=, market_data_publisher=, schedulers=(), settlement_date=) :module: fuggers_py.calc :canonical: fuggers_py.calc.reactive.ReactiveEngine

Async runtime for graph-driven pricing and market-data processing.

The engine connects the calc graph, listener, curve builder, pricing router, storage adapter, and output publishers. It listens for market-data and scheduler events, resolves pricing inputs, and publishes any resulting updates.

.. py:method:: ReactiveEngine.cache_reference_data(reference_data) :module: fuggers_py.calc

  Cache bond reference data for later pricing-node evaluation.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: ReactiveEngine.subscribe_updates() :module: fuggers_py.calc

  Return a queue that receives all published node updates.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~asyncio.queues.Queue\``

.. py:method:: ReactiveEngine.unsubscribe_updates(queue) :module: fuggers_py.calc

  Remove a previously subscribed update queue.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: ReactiveEngine.publish_market_data_update(update) :module: fuggers_py.calc :async:

  Publish a market-data update through the shared fanout path.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: ReactiveEngine.register_pricing_node(node_id, pricing_input, *, dependencies=()) :module: fuggers_py.calc

  Register a pricing node and its graph dependencies.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.calc\_graph.NodeId\``

.. py:method:: ReactiveEngine.start() :module: fuggers_py.calc :async:

  Start relays and scheduler tasks for the reactive runtime.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: ReactiveEngine.stop() :module: fuggers_py.calc :async:

  Stop relays, schedulers, and subscriptions for the reactive runtime.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:method:: ReactiveEngine.process_once(*, timeout=None) :module: fuggers_py.calc :async:

  Process one incoming event and evaluate any newly dirty pricing nodes.

  Pricing failures are isolated into :class:`PricingFailure` payloads so a
  single bad node does not abort processing of the rest of the batch. Any
  updates produced while processing the event are fanned out to external
  subscribers before the method returns.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:method:: ReactiveEngine.drain_once(*, timeout=None) :module: fuggers_py.calc :async:

  Alias for :meth:`process_once` used by the test surface.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.calc.scheduler.NodeUpdate\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:attribute:: ReactiveEngineBuilder :module: fuggers_py.calc

alias of :py:class:~fuggers_py.calc.builder.PricingEngineBuilder

.. py:class:: RatesPricingRouter() :module: fuggers_py.calc :canonical: fuggers_py.calc.rates_pricing_router.RatesPricingRouter

Price swaps, FRAs, basis swaps, and OIS instruments.

All methods expect an already-assembled :class:AnalyticsCurves bundle and return typed output records with signed DV01/PV01 aliases.

.. py:method:: RatesPricingRouter.price_swap(instrument, *, curves) :module: fuggers_py.calc

  Price a swap-style instrument and attach signed DV01/PV01.

  The returned record keeps the par rate and leg PV split consistent with
  the shared swap pricer while adding the routed pricing-path label.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.SwapQuoteOutput\``

.. py:method:: RatesPricingRouter.price_fra(instrument, *, curves) :module: fuggers_py.calc

  Price an FRA and return the routed FRA result record.

  The returned record keeps the forward rate, year fraction, discount
  factor, and sensitivity aliases aligned with the FRA pricer.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.RoutedFraPricingResult\``

.. py:method:: RatesPricingRouter.price_basis_swap(instrument, *, curves) :module: fuggers_py.calc

  Price a basis swap and attach signed DV01/PV01.

  The returned output carries the quoted basis spread together with the
  pay-leg and receive-leg PVs so callers can inspect the leg split.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.BasisSwapQuoteOutput\``

.. py:method:: RatesPricingRouter.price_zero_coupon_inflation_swap(instrument, *, curves) :module: fuggers_py.calc

  Price a zero-coupon inflation swap.

  The inflation leg PV is preserved in the `floating_leg_pv` field and
  called out in the notes so the output remains readable downstream.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.SwapQuoteOutput\``

.. py:method:: RatesPricingRouter.price_standard_coupon_inflation_swap(instrument, *, curves) :module: fuggers_py.calc

  Price a standard coupon inflation swap.

  The method expects the standard-coupon inflation result type and keeps
  the routed output aligned with the zero-coupon inflation path.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.output.SwapQuoteOutput\``

.. py:method:: RatesPricingRouter.price(instrument, *, curves) :module: fuggers_py.calc

  Dispatch a rates instrument to the appropriate pricer.

  Unsupported instrument types raise :class:`TypeError` so callers can
  separate routing problems from pricing failures.

.. py:method:: RatesPricingRouter.price_batch(instruments, *, curves) :module: fuggers_py.calc

  Price a batch of rates instruments using a shared curve bundle.

  Every instrument sees the same curve bundle so batch pricing remains
  deterministic across the routed rates products.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`object\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: RepoPricingResult(collateral_value, haircut_amount, cash_lent, year_fraction, interest_amount, repurchase_amount, curve_zero_rate=None, forward_rate=None, funding_spread=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.RepoPricingResult

Structured repo pricing output with raw-decimal rate fields.

The record keeps collateral value, haircut, cash lent, accrued interest, and repo-curve diagnostics for funding workflows.

.. py:class:: RoutedFraPricingResult(instrument_id=None, pricing_path=None, forward_rate=None, present_value=None, year_fraction=None, discount_factor=None, dv01=None, pv01=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.RoutedFraPricingResult

Structured FRA pricing output with signed DV01/PV01 aliases.

The record keeps the forward rate, discount factor, year fraction, and the alias pair used by the rest of the calc layer for rate sensitivity.

.. py:exception:: RoutingError :module: fuggers_py.calc :canonical: fuggers_py.calc.errors.RoutingError

Raised when the router cannot dispatch or complete a pricing path.

.. py:class:: RvSignalOutput(instrument_id=None, signal_name=None, score=None, z_score=None, direction=None, bucket=None, horizon=None, timestamp=None, source=None, notes=()) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.RvSignalOutput

Relative-value signal output with normalized direction metadata.

Direction is normalized to lowercase and the record keeps the score, z-score, bucket, and horizon metadata used for relative-value screening.

.. py:exception:: SchedulerError :module: fuggers_py.calc :canonical: fuggers_py.calc.errors.SchedulerError

Raised when a scheduler cannot be configured or run.

.. py:class:: ServiceRegistration(service_name, node_id, endpoint, metadata=()) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.ServiceRegistration

Registration record for a service instance.

:type service_name: :sphinx_autodoc_typehints_type:\:py\:class\:\str`    :param service_name: Logical service name that owns the registration.    :type node_id: :sphinx_autodoc_typehints_type::py:class:`str`    :param node_id: Stable node identifier within that service.    :type endpoint: :sphinx_autodoc_typehints_type::py:class:`str`    :param endpoint: Network or transport endpoint for the instance.    :type metadata: :sphinx_autodoc_typehints_type::py:class:`tuple`\ \[:py:class:`tuple`\ \[:py:class:`str`, :py:class:`str`], :py:data:`…<Ellipsis>`]` :param metadata: Optional sorted key/value metadata carried with the registration.

.. py:class:: ServiceRegistry(*args, **kwargs) :module: fuggers_py.calc :canonical: fuggers_py.calc.coordination.ServiceRegistry

Protocol for service registration backends.

.. py:method:: ServiceRegistry.register(registration) :module: fuggers_py.calc

  Register a virtual subclass of an ABC.

  Returns the subclass, to allow usage as a class decorator.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.calc.coordination.ServiceRegistration\``

.. py:class:: ShardAssignment(node_id, shard_key, shard_index, owner=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.calc_graph.ShardAssignment

Resolved shard index and owner for a node.

.. py:class:: ShardConfig(shard_count=1, owners=(), strategy=ShardStrategy.CONSISTENT_HASH, virtual_nodes=16) :module: fuggers_py.calc :canonical: fuggers_py.calc.calc_graph.ShardConfig

Shard layout used by the calculation graph.

:type shard_count: :sphinx_autodoc_typehints_type:\:py\:class\:\int`    :param shard_count: Number of shards to map nodes across.    :type owners: :sphinx_autodoc_typehints_type::py:class:`tuple`\ \[:py:class:`str`, :py:data:`…<Ellipsis>`]    :param owners: Optional ordered list of shard owners.    :type strategy: :sphinx_autodoc_typehints_type::py:class:`~fuggers_py.calc.calc_graph.ShardStrategy`    :param strategy: Owner selection strategy when owners are present.    :type virtual_nodes: :sphinx_autodoc_typehints_type::py:class:`int`` :param virtual_nodes: Number of virtual nodes per owner for consistent hashing.

.. py:class:: ShardStrategy(value) :module: fuggers_py.calc :canonical: fuggers_py.calc.calc_graph.ShardStrategy

Strategy used to map nodes to shard owners.

.. py:class:: SwapQuoteOutput(instrument_id=None, pricing_path=None, par_rate=None, present_value=None, fixed_leg_pv=None, floating_leg_pv=None, annuity=None, dv01=None, pv01=None, warnings=(), notes=(), settlement_date=None, timestamp=None, source=None, is_stale=False, quality_score=None) :module: fuggers_py.calc :canonical: fuggers_py.calc.output.SwapQuoteOutput

Swap pricing output with raw-decimal rates and signed DV01/PV01.

The record captures the par rate, PV decomposition, annuity, and signed risk aliases for fixed-float swaps and OIS instruments.

.. py:class:: ThrottleManager(min_interval_seconds) :module: fuggers_py.calc :canonical: fuggers_py.calc.scheduler.ThrottleManager

Simple per-key throttle used to suppress rapid repeated updates.

Each key tracks the last accepted timestamp so repeated market-data bursts can be rate-limited without dropping unrelated keys.

.. py:method:: ThrottleManager.allow(key, *, now=None) :module: fuggers_py.calc

  Return ``True`` when an update is outside the throttle window.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``

.. py:method:: ThrottleManager.remaining(key, *, now=None) :module: fuggers_py.calc

  Return the remaining throttle window in seconds.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`float\``

.. py:method:: ThrottleManager.reset(key=None) :module: fuggers_py.calc

  Reset the throttle state for one key or for all keys.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:obj\:\`None\``

.. py:class:: UpdateFrequency(value) :module: fuggers_py.calc :canonical: fuggers_py.calc.config.UpdateFrequency

Cadence labels used to describe how often an engine node updates.

.. py:class:: UpdateSource(value) :module: fuggers_py.calc :canonical: fuggers_py.calc.scheduler.UpdateSource

Origin of a node update entering the reactive engine.

.. py:class:: VolSurfaceUpdate(*, timestamp=, source=None, surface) :module: fuggers_py.calc :canonical: fuggers_py.calc.market_data_listener.VolSurfaceUpdate

Update carrying a volatility surface.