Skip to main content

pygluon

Gluon simulator library for Python. Simulates the Gluon protocol's reactor mechanics including fission, fusion, and beta decay reactions.

Installation

pip install pygluon

Quick Start

from pygluon.reactors import GluonZReactor
from pygluon.reactors.types import (
    GluonReaction,
    GluonZReactorParameters,
    GluonZReactorState,
    Tokeons,
)

# Configure reactor parameters
params = GluonZReactorParameters(
    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_decay_factor=0.99,
)

# Initialize reactor state
state = GluonZReactorState(
    reserves=1000.0,
    neutron_circulating_supply=500.0,
    proton_circulating_supply=500.0,
    prev_volume_delta=0.0,
    prev_reaction_time=0.0,
)

# Create reactor instance
reactor = GluonZReactor(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}")

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

License

MIT

Metadata

Release files for pygluon 1.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 pygluon 1.0.0
File Size Uploaded Provenance Actions
pygluon-1.0.0.tar.gz 3.8 kB Without provenance Details for pygluon-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygluon 1.0.0
File Interpreter ABI Platform Actions
pygluon-1.0.0-py3-none-any.whl Python 3 none any Details for pygluon-1.0.0-py3-none-any.whl

Total release size: 8.7 kB

Release files / pygluon-1.0.0.tar.gz

Download URL pygluon-1.0.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0560c1b30f49833d284f161666c6d6e3a02721ec6df26ea3cf0ad408732f318b
BLAKE2b-256 checksum
How to use checksums
09cb8143560a3b558462b9c5903f0515953e70d1768eb7e8042f490a8d2d05f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / pygluon-1.0.0-py3-none-any.whl

Download URL pygluon-1.0.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0d91bb2bcca7c29a8b6c9c5b04cdac557783db33ce71430f1c0f997481ab908
BLAKE2b-256 checksum
How to use checksums
8cd4da9929411b75b3505e0e1107e4187d84a7eaa36b55d066261af54e3f3a0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for pygluon 1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

1.0.0 This release

2 release files No 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