Skip to content

neuron7xLab/GeoSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

103 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
GeoSync — Geometric Market Intelligence



modules-15 invariants-57 tests-10051 indicators-46 ADRs-16 license-MIT


Kuramoto synchronization  ·  Ricci curvature flow  ·  Free-energy thermodynamics  ·  Cryptobiosis

Physics-first quantitative infrastructure with 57 machine-checkable invariants. Every signal traces back to peer-reviewed science. Every clamp traces back to a law.


PR Gate CodeQL Main Validation Python Security Physics Gate Coverage

The Signal

GeoSync distils validated mechanisms from computational neuroscience, differential geometry, thermodynamics, and synchronization theory into a rigorous, production-oriented algorithmic infrastructure.

 Order Parameter R(t)
 1.0 ┤                    ╭──────
     │                 ╭──╯
 0.8 ┤              ╭──╯
     │           ╭──╯
 0.6 ┤        ╭──╯
     │     ╭──╯
 0.4 ┤  ╭──╯
     │╭─╯
 0.2 ┤╯
     │
 0.0 ┼──────────────────────────
     0    200   400   600   800  t

The core question: when do markets synchronize?

The Kuramoto order parameter R(t) quantifies instantaneous phase coherence across assets:

  • R → 0 desynchronized, independent motion
  • R → 1 full phase-lock, regime transition

When R crosses critical coupling Kc, the market undergoes a phase transition — the geometric signal that conventional factor models systematically miss.

dθᵢ/dt = ωᵢ + K · Σⱼ Aᵢⱼ sin(θⱼ − θᵢ)

Architecture

                    ┌─────────────────────────────────────────────────────┐
                    │                   G E O S Y N C                     │
                    │          Geometric Market Intelligence               │
                    └─────────────┬───────────────────┬───────────────────┘
                                  │                   │
              ┌───────────────────┼───────────────────┼───────────────────┐
              │                   │                   │                   │
     ┌────────▼────────┐ ┌───────▼────────┐ ┌────────▼────────┐ ┌───────▼────────┐
     │  DATA INGESTION │ │ FEATURE  STORE │ │ STRATEGY ENGINE │ │  RISK MANAGER  │
     │  CCXT · Alpaca  │ │ Redis · Feast  │ │ Policy  Router  │ │  TACL · Gates  │
     │  Polygon · WS   │ │ Parquet · PG   │ │ Walk-Forward    │ │  Kill Switch   │
     └────────┬────────┘ └───────┬────────┘ └────────┬────────┘ └───────┬────────┘
              │                  │                    │                  │
              └──────────────────┼────────────────────┼──────────────────┘
                                 │                    │
                    ┌────────────▼────────────────────▼────────────┐
                    │            EXECUTION  FABRIC                  │
                    │    OMS · Smart Routing · Capital Optimizer    │
                    │    Paper Trading · Compliance · Audit Trail   │
                    └──────────────────────┬───────────────────────┘
                                           │
                    ┌──────────────────────▼───────────────────────┐
                    │          OBSERVABILITY  STACK                 │
                    │  Prometheus · OpenTelemetry · 400-day Audit   │
                    │  Reliability Tests · Deterministic Replay     │
                    └──────────────────────────────────────────────┘
Module Path Lang Purpose
COREcore/indicators/Python50+ geometric and technical indicators — Kuramoto, Ricci, entropy, fractal, Hurst
KURAMOTOcore/kuramoto/PythonRK4 · JAX/GPU · Sparse · Adaptive · Delayed · SecondOrder simulation engines
BACKTESTbacktest/PythonEvent-driven engine, walk-forward, Monte Carlo, property-based validation
EXECUTIONexecution/PythonOMS, smart routing, Kelly/MV sizing, compliance, paper trading
RUNTIMEruntime/PythonLive orchestration, kill switch, CNS stabilizer, recovery agent
TACLtacl/PythonThermodynamic autonomic control — free energy descent, protocol hot-swap
NEUROcore/neuro/PythonDopamine TD-learning, serotonin ODE stability, GABA inhibition gate, cryptobiosis survival
OBSERVEobservability/PythonPrometheus, OpenTelemetry, structured audit logging, dashboards
ACCELrust/geosync-accel/RustHigh-performance compute kernels for hot-path acceleration
UIui/dashboard/TypeScriptReact web interface — canonical interactive dashboard

Physics Kernel

GeoSync is a verified physical system, not a test-coverage theatre. The physics kernel (.claude/physics/) defines 57 machine-checkable invariants across 15 modules. Every test is a mathematical witness of a specific physical law, not a line-coverage artefact.

                     ┌──────────────────────────────────────┐
                     │   57 INVARIANTS  ·  15 MODULES       │
                     │   Every assert derives its tolerance  │
                     │   from the law's formula, not from    │
                     │   a magic literal.                    │
                     └──────────┬───────────────────────────┘
                                │
          ┌─────────────────────┼─────────────────────────┐
          │                     │                         │
  ┌───────▼────────┐   ┌───────▼────────┐   ┌────────────▼──────────┐
  │ GENERATORS     │   │ SUSTAINERS     │   │ PROTECTORS            │
  │ Kuramoto (K1-7)│   │ ECS (FE1-2)   │   │ GABA (GABA1-5)       │
  │ Dopamine (DA1-7)│  │ Serotonin tonic│   │ Serotonin veto (5HT7)│
  │ HPC (HPC1-2)  │   │ (5HT1-6)      │   │ Cryptobiosis (CB1-8) │
  │ Kelly (KELLY1-3)│  │ Thermo (TH1-2)│   │                       │
  └────────────────┘   └───────────────┘   └───────────────────────┘

Protectors have unconditional priority over Generators. A system without a gradient cannot use a gradient. See CLAUDE.md §0 for the full gradient ontology.

Metric Value
Physics invariants 57 across 15 modules (P0: 37, P1: 17, P2: 3)
Grounded witnesses 67 tests with INV-* docstrings and 5-field error messages
C1/C2 code audit 0 undocumented physics clamps in core/
CI gate physics-kernel-gate.yml — self-check + L1-L5 validation + C1/C2 audit
OOS walk-forward alpha +78% vs equal-weight, drawdown -53% (5/5 folds protected)

Key invariants:

ID Law Module
INV-K2 K < K_c ⟹ R → 0 (subcritical decay, ε = 3/√N) Kuramoto
INV-5HT7 stress ≥ 1 OR |drawdown| ≥ 0.5 → veto Serotonin
INV-CB1 DORMANT ⟹ multiplier == 0.0 EXACTLY Cryptobiosis
INV-FE1 Free energy non-increasing under active inference ECS
INV-DA7 ∂δ/∂r = 1 (RPE linear in reward) Dopamine
INV-RC1 Ollivier-Ricci κ ≤ 1 (universal upper bound) Ricci

Geometric Indicators

    ╭─╮
   ╱ θ ╲
  │phase│
   ╲   ╱
    ╰─╯

Kuramoto
Phase synchrony

   ╭───╮
  ╱ Ric ╲
 │curva- │
 │ ture  │
  ╲     ╱
   ╰───╯

Ricci Flow
Regime geometry

   ┌───┐
   │ H │
   │ = │
   │ Σ │
   │-pln│
   └───┘

Entropy
Shannon / Tsallis

   ╱╲╱╲
  ╱╲╱╲╱╲
 ╱╲╱╲╱╲╱╲
╱╲╱╲╱╲╱╲╱╲
   fractal

Fractal
Multi-scale self-similarity

   ┌─────┐
   │ H(q)│
   │  ↕  │
   │0←→1 │
   └─────┘

Hurst
Long-range dependence

   t₁─┐
   t₂─┤►Σ
   t₃─┘
  multi
  scale

Multi-Scale
Timeframe decomposition

TACL — Thermodynamic Autonomic Control

The governing brain of system stability. Every autonomous change must respect Monotonic Free Energy Descent.

  Free Energy F = U − T·S

  where   U = Σᵢ wᵢ · penalty(metricᵢ)       internal energy
          T = 0.60                              control temperature
          S = stability headroom                entropy term

  Envelope:  F ≤ 1.35   (12% safety margin)
  Rest:      F = 1.00   (stabilised baseline)
  Kill:      F > 1.35   (emergency halt)

Monitored Metrics

Metric Threshold Weight
latency_p95 85 ms 1.6
latency_p99 120 ms 1.9
coherency_drift 0.08 1.2
cpu_burn 0.75 0.9
mem_cost 6.5 GiB 0.8
queue_depth 32 msg 0.7
packet_loss 0.005 1.4

Safety State Machine

              ┌──────────────┐
              │   NOMINAL    │ F ≤ 1.00
              └──────┬───────┘
                     │ F ↑
              ┌──────▼───────┐
              │   STRESSED   │ 1.00 < F ≤ 1.35
              └──────┬───────┘
                     │ F > 1.35
              ┌──────▼───────┐
              │  KILL SWITCH │ dual-approval
              │   ENGAGED    │ or auto-rollback
              └──────────────┘

Protocol Hot-Swap — dynamic switching between RDMA, CRDT, gRPC, Shared Memory, Gossip with admissibility guards. Any swap that increases F beyond tolerance triggers automatic reversion within 30s.

Quick Start

git clone https://github.com/neuron7xLab/GeoSync.git
cd GeoSync
python -m venv .venv && source .venv/bin/activate
make install

First Analysis

from core.indicators.kuramoto_ricci_composite import GeoSyncCompositeEngine
import numpy as np, pandas as pd

index  = pd.date_range("2024-01-01", periods=720, freq="5min")
prices = 100 + np.cumsum(np.random.normal(0, 0.6, 720))
volume = np.random.lognormal(9.5, 0.35, 720)
bars   = pd.DataFrame({"close": prices, "volume": volume}, index=index)

engine   = GeoSyncCompositeEngine()
snapshot = engine.analyze_market(bars)

print(f"Phase:      {snapshot.phase.value}")
print(f"Confidence: {snapshot.confidence:.3f}")
print(f"Entry:      {snapshot.entry_signal:.3f}")
=== GeoSync Market Analysis ===
Phase:      transition
Confidence: 0.893
Entry:      0.000

Kuramoto Simulation

from core.kuramoto import KuramotoConfig, run_simulation

cfg = KuramotoConfig(N=50, K=3.0, dt=0.01, steps=1000, seed=42)
result = run_simulation(cfg)

print(f"Trajectory: {result.phases.shape}")       # (1001, 50)
print(f"Final R:    {result.order_parameter[-1]:.4f}")

Backtest

from backtest.event_driven import EventDrivenBacktestEngine
from core.indicators import KuramotoIndicator

indicator = KuramotoIndicator(window=80, coupling=0.9)
prices = 100 + np.cumsum(np.random.default_rng(42).normal(0, 1, 500))

def signal(series):
    order = indicator.compute(series)
    s = np.where(order > 0.75, 1.0, np.where(order < 0.25, -1.0, 0.0))
    s[:min(indicator.window, s.size)] = 0.0
    return s

result = EventDrivenBacktestEngine().run(prices, signal, initial_capital=100_000)

CLI

tp-kuramoto simulate --N 50 --K 3.0 --steps 2000 --seed 42
geosync-server --allow-plaintext --host 127.0.0.1 --port 8000

Kuramoto ODE Engine

Six specialized integrators for every scale:

Engine Method Use Case
Standard RK4 General-purpose, N < 10K
JAX XLA-compiled GPU/TPU acceleration
Sparse O(E) coupling Large networks, sparse topology
Adaptive Dormand-Prince / LSODA Error-controlled step size
Delayed DDE Time-delayed coupling
SecondOrder Inertia + damping Swing equations, power grids
Standard ODE:    dθᵢ/dt = ωᵢ + (K/N) · Σⱼ≠ᵢ sin(θⱼ − θᵢ)
Adjacency ODE:   dθᵢ/dt = ωᵢ + K · Σⱼ Aᵢⱼ sin(θⱼ − θᵢ)
Order Parameter: R(t) = |1/N · Σⱼ exp(iθⱼ)| ∈ [0, 1]
Parameter Default Description
N 10 Coupled oscillators (int >= 2)
K 1.0 Global coupling strength
omega N(0,1) Natural frequencies (rad/time)
dt 0.01 RK4 integration step
steps 1000 Integration steps
adjacency None Weighted coupling matrix
theta0 U(0, 2pi) Initial phases
seed None RNG seed for reproducibility

Testing & Quality

 10,051 collected  ·  681 passing  ·  71% line coverage  ·  57 physics invariants  ·  67 witnesses  ·  0 mypy errors
Unit
tests/unit/
Integration
tests/integration/
Property
tests/property/
Fuzz
tests/fuzz/
Contract
tests/contracts/
Mutation
mutmut
pytest tests/                          # full suite
pytest tests/ -m "not slow"            # fast feedback
pytest tests/property/                 # hypothesis-driven
mutmut run --use-coverage              # mutation testing
cd ui/dashboard && npm test            # UI smoke

CI Merge Gates: ruff, mypy (strict), bandit, pip-audit, CodeQL, Semgrep, TruffleHog, CycloneDX SBOM generation.

Performance

Design targets — NOT measured results. See METRICS_CONTRACT.md.

  Backtesting throughput     1M+ bars/second
  Order latency              < 5 ms (exchange-dependent)
  Signal generation          < 1 ms (cached indicators)
  Memory steady-state        ~ 200 MB live trading
  Hot-path budget            > 30% → Rust accelerator fallback

Security

  Framework       NIST SP 800-53  ·  ISO 27001  (design aligned)
  Encryption      AES-256 at rest  ·  TLS 1.3 in transit
  Secrets         HashiCorp Vault  ·  AWS Secrets Manager
  Auth            JWT + MFA for admin operations
  Compliance      GDPR · CCPA · SEC · FINRA patterns
  Audit           400-day immutable append-only log
  Supply chain    pinned SHA actions · dependency hash verification
  CVE target      < 7-day remediation
  Type safety     mypy strict · Pydantic 2.0 · 0 type errors

Deployment

# Docker Compose (dev/staging)
cp .env.example .env && docker compose up -d

# Kubernetes (production)
terraform -chdir=infra/terraform/eks apply -var-file=environments/production.tfvars
kubectl apply -k deploy/kustomize/overlays/production

Configuration via Hydraconf/, config/, configs/, envs/, .env. Override anything from CLI:

geosync run strategy.capital=200000 data.timeframe=4h

Technology Stack

  NUMERICAL       NumPy 2.3  ·  SciPy 1.16  ·  Pandas 2.3  ·  Numba 0.60
  ML              PyTorch 2.1  ·  scikit-learn  ·  Optuna
  GRAPH           NetworkX 3.5
  API             FastAPI 0.120  ·  Strawberry GraphQL
  DATABASE        PostgreSQL + SQLAlchemy 2.0  ·  Alembic
  CACHE           Redis 7.0
  MESSAGING       Apache Kafka (aiokafka)
  OBSERVABILITY   Prometheus  ·  OpenTelemetry
  CONFIGURATION   Hydra-core 1.3  ·  OmegaConf 2.3
  VALIDATION      Pydantic 2.12  ·  Pandera 0.20
  INFRASTRUCTURE  Docker  ·  Kubernetes  ·  Helm  ·  Terraform
  ACCELERATION    Rust (geosync-accel)  ·  CuPy (GPU optional)
  QUALITY         ruff · black · mypy · pytest · Hypothesis · mutmut

Project Status

  VERSION         v0.1.0   Pre-Production Beta
  CORE ENGINE     stable   production-ready
  INDICATORS      stable   50+ geometric + technical
  BACKTESTING     stable   event-driven, walk-forward
  LIVE TRADING    beta     active development
  DASHBOARD       alpha    early preview
  DOCUMENTATION   85%      170+ files

Roadmap

  Q1 2026         v1.0 production release
  Q2 2026         options & derivatives support
  Q3-Q4 2026      multi-asset portfolio optimization

Path to v1.0: 98% coverage gate activation, dashboard auth hardening, external security audit, P99 benchmark suite, SBOM publication.

Documentation

Getting Started

Architecture

Operations

Research

Institutional Overview | Roadmap | Security Framework | Contributing | Full Documentation

Contributing

git clone https://github.com/neuron7xLab/GeoSync.git && cd GeoSync
python -m venv .venv && source .venv/bin/activate
make dev-install

make test          # core test suite
make lint          # ruff + mypy + bandit
make format        # black + isort
make audit         # security audit
make golden-path   # full workflow demo
make help          # all commands

Contributing Guide | Code of Conduct | Good First Issues

Citation

If you use GeoSync in academic research, industry reports, or derivative work, please cite it. A machine-readable manifest lives in CITATION.cff; GitHub renders a ready-to-copy citation in the sidebar of the repository page.

@software{geosync_2026,
  title   = {GeoSync: Geometric Market Intelligence Platform},
  author  = {Vasylenko, Yaroslav},
  year    = {2026},
  version = {1.0.0},
  url     = {https://github.com/neuron7xLab/GeoSync},
  license = {MIT}
}

Risk Disclosure

Trading financial instruments involves substantial risk of loss. GeoSync provides quantitative research infrastructure and execution tooling — it does not constitute investment advice, and no component guarantees profitable performance. Live trading modules are in pre-production beta. Backtested results do not guarantee future performance. Users bear full regulatory responsibility.

                            *       .        *       .       *
                 .      *        .        *        .      *
              *     .        *        .        *     .        *
           .     *     .        *        .     *     .
              *     .     *        .     *     .     *
                 .     *     .     *     .     *
                    *     .     *     .     *
                       .     *     .     *
                          *     .     *
                             .     *
                                *

GeoSync — Geometric Market Intelligence

neuron7xLab · Poltava, Ukraine 🇺🇦

MIT

Built on peer-reviewed science. Physics-first, 57 invariants, every clamp documented.

About

Geometric market intelligence platform — Kuramoto synchronization · Ollivier-Ricci curvature · fractal dynamics · neuro-symbolic control · institutional-grade quantitative research infrastructure

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors