Skip to main content

stability-nexus

Stability Nexus multi-protocol simulation library.

Installation

pip install stability-nexus

Quick Start

from stability_nexus.stablecoins.gluon.reactors import GluonWReactor
from stability_nexus.stablecoins.gluon.types import (
    GluonReaction,
    GluonWReactorParameters,
    GluonWReactorState,
)

# Configure reactor parameters
params = GluonWReactorParameters(
    critical_neutron_ratio=0.5,
    fission_fee=0.01,
    fusion_fee=0.01,
    beta_decay_fee_slope=0.1,
    beta_decay_fee_intercept=0.005,
    volume_window=10.0,
)

# Initialize reactor state
state = GluonWReactorState(
    reserves=1000.0,
    neutron_circulating_supply=500.0,
    proton_circulating_supply=500.0,
    beta_decay_history=[],
)

# Create reactor instance
reactor = GluonWReactor(params, state)

# Execute a fission reaction (basecoins -> neutrons + protons)
result = reactor.execute(
    GluonReaction.FISSION,
    balance=100.0,
    neutron_target_price=1.0,
    reaction_time=1.0,
)
print(f"Received: {result.reactor_output}")
print(f"New reserves: {result.reactor_state.reserves}")

The Gluon W Reactor

GluonWReactor implements the Gluon W protocol:

  • the normalized neutron ratio is capped at the critical ratio (min(q, q*)), and
  • the beta decay fee is based on the signed sum of beta decay volumes within a sliding time window of length volume_window.

A Gluon Z variant (damped ratio, exponentially decaying volume) is planned once its specification is finalized.

Reactions

The Gluon protocol supports four reaction types:

  • FISSION: Convert basecoins into neutrons and protons
  • FUSION: Convert neutrons and protons back into basecoins
  • BETA_DECAY_PLUS: Convert protons into neutrons
  • BETA_DECAY_MINUS: Convert neutrons into protons

Types

The library uses type aliases for documentation:

  • Basecoin - Reserve currency amounts (float)
  • Neutron - Neutron token amounts (float)
  • Proton - Proton token amounts (float)
  • BasecoinPerNeutron - Price ratio (float)
  • BasecoinPerProton - Price ratio (float)
  • Tokeons - A dataclass containing neutrons and protons

Contributing

If you encounter bugs, need help, or have feature requests:

  • Please open an issue in this repository providing detailed information.
  • Describe the problem clearly and include any relevant logs or screenshots.

We appreciate your feedback and contributions!

© 2025 The Stable Order.

Metadata

Release files for stability-nexus 3.0.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 stability-nexus 3.0.0
File Size Uploaded Provenance Actions
stability_nexus-3.0.0.tar.gz 39.5 kB With provenance Details for stability_nexus-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stability-nexus 3.0.0
File Interpreter ABI Platform Actions
stability_nexus-3.0.0-py3-none-any.whl Python 3 none any Details for stability_nexus-3.0.0-py3-none-any.whl

Total release size: 46.3 kB

Release files / stability_nexus-3.0.0.tar.gz

Download URL stability_nexus-3.0.0.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
03c39a532290fa5aee063a0c860fcb6d0daead22b981692590256efe137014aa
BLAKE2b-256 checksum
How to use checksums
f3830412788c13f52519495b424fad3686e814f6f4913cc0daad98f28701140c
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 29, 2026.

Transparency log

Release files / stability_nexus-3.0.0-py3-none-any.whl

Download URL stability_nexus-3.0.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a72e4b3c4154bae8662d54b4897763136ed26ad59a432f21e69484f3e2df6bcf
BLAKE2b-256 checksum
How to use checksums
2b4fdb54b1a4c4f69ae7ca1120917665c6d697c5550bd6b446237aa7b1b01d2a
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 29, 2026.

Transparency log

Security for stability-nexus 3.0.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 stability_nexus-3.0.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 29, 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