Multi-asset bonding surface for $MYCO token issuance with commitment-based minting channels
Go to file
Jeff Emmett 38e14a52c6 feat: add 208 tests and 4 deep-dive notebooks for new modules
Tests cover risk_tranching (54), conviction (54), crosschain (54), and
cadCAD integration (46). All 558 tests pass. Notebooks provide interactive
explorations of risk tranches, cross-chain simulation, conviction governance,
and cadCAD Monte Carlo analysis. Includes parameter sweep results (405 sims).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 12:20:55 -07:00
dashboard feat: add cadCAD simulation, risk tranches, cross-chain, and conviction governance 2026-04-03 12:11:15 -07:00
docs docs: add CRDT-native primitives design — mapping DeFi to off-chain tokens 2026-04-01 10:33:29 -07:00
notebooks feat: add 208 tests and 4 deep-dive notebooks for new modules 2026-04-03 12:20:55 -07:00
reference feat: complete MYCO bonding surface system — math specs, simulations, and tests 2026-04-01 00:12:00 -07:00
src fix: add apply_collateral_change for proper gain/loss rebalancing 2026-04-03 12:15:12 -07:00
tests feat: add 208 tests and 4 deep-dive notebooks for new modules 2026-04-03 12:20:55 -07:00
.dockerignore feat: add System Config tab, presets, JSON export/import, and Dockerize for simulate.rspace.online 2026-04-01 14:55:14 -07:00
.gitignore feat: complete MYCO bonding surface system — math specs, simulations, and tests 2026-04-01 00:12:00 -07:00
.gitleaksignore feat: complete MYCO bonding surface system — math specs, simulations, and tests 2026-04-01 00:12:00 -07:00
Dockerfile fix: set PYTHONPATH=/app in Dockerfile for dashboard imports 2026-04-01 15:38:31 -07:00
README.md feat: complete MYCO bonding surface system — math specs, simulations, and tests 2026-04-01 00:12:00 -07:00
docker-compose.yml fix: add Traefik priority to avoid rspace wildcard conflict 2026-04-01 15:04:39 -07:00
param_sweep_results.csv feat: add 208 tests and 4 deep-dive notebooks for new modules 2026-04-03 12:20:55 -07:00
param_sweep_v2.csv fix: add apply_collateral_change for proper gain/loss rebalancing 2026-04-03 12:15:12 -07:00
pyproject.toml feat: add cadCAD simulation, risk tranches, cross-chain, and conviction governance 2026-04-03 12:11:15 -07:00

README.md

MYCO Bonding Surface

Multi-asset bonding surface for $MYCO token issuance, combining N-dimensional ellipsoidal pricing with commitment-based minting channels and Gyroscope-inspired reserve management.

Architecture

                    ┌─────────────────────┐
                    │   $MYCO Token Mint   │
                    └─────────┬───────────┘
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
    ┌─────────────┐  ┌──────────────┐  ┌────────────┐
    │  Financial   │  │ Commitment   │  │  Staking   │
    │  Reserves    │  │  Channels    │  │  Lockups   │
    │ (N assets)   │  │ (labor/sub)  │  │ (duration) │
    └──────┬──────┘  └──────┬───────┘  └─────┬──────┘
           │                │                │
    ┌──────▼──────┐  ┌──────▼───────┐  ┌─────▼──────┐
    │ Ellipsoid   │  │ Contribution │  │ Time-weight │
    │ Bonding     │  │ Oracle /     │  │ Multiplier  │
    │ Surface     │  │ Attestation  │  │ Curve       │
    │ (N-CLP)     │  │              │  │             │
    └──────┬──────┘  └──────┬───────┘  └─────┬──────┘
           │                │                │
           ▼                ▼                ▼
    ┌─────────────────────────────────────────────┐
    │           Reserve Tranching Layer            │
    │  (target weights, safety checks, rebalance)  │
    └──────────────────┬──────────────────────────┘
                       │
              ┌────────▼────────┐
              │  P-AMM Redemption│
              │  Curve + Flow    │
              │  Dampening       │
              └─────────────────┘

What This Is

A research/simulation repo exploring advanced token issuance mechanics drawn from:

  • Balancer — Weighted constant product, StableSwap, concentrated liquidity, GradualValueChange, StableSurge fees
  • Gyroscope — E-CLP elliptical curves, P-AMM redemption, reserve tranching, flow dampening

The system extends these DeFi primitives into an N-dimensional bonding surface where $MYCO can be minted via:

  1. Financial deposits (ETH, USDC, DAI, ...) priced on an ellipsoidal invariant surface
  2. Labor contributions — proof-of-contribution attestations converted to tokens at governed rates
  3. Subscriptions — recurring pledges with loyalty multipliers
  4. Staking lockups — time-weighted bonus minting with concave (sqrt) reward curves

Primitives

# Primitive Source Purpose
1 Weighted Product Balancer N-asset constant product invariant
2 StableSwap Curve/Balancer Stable-pegged invariant (Newton solver)
3 Concentrated 2-CLP Gyroscope Virtual-reserve concentrated liquidity
4 Elliptical CLP Gyroscope A-matrix elliptical pricing
5 N-D Ellipsoid Surface Novel Generalized N-asset bonding surface
6 Reserve Tranching Gyroscope GYD Multi-vault weight targets + safety
7 P-AMM Redemption Gyroscope Backing-ratio-dependent redemption pricing
8 Dynamic Weights Balancer/QuantAMM Time-varying parameters + oracle multipliers
9 Flow Dampening Gyroscope Anti-bank-run exponential outflow memory
10 Imbalance Fees Balancer StableSurge Median-based surge fees
11 Commitment Issuance Novel Labor, subscription, staking channels

Each primitive has a math spec in docs/ and a Python simulation in src/primitives/ or src/commitments/.

Quick Start

# Install
pip install -e ".[dev]"

# Run tests (128 tests)
pytest tests/

# Run a simulation
python -c "
from src.composed.simulator import scenario_token_launch
result = scenario_token_launch(n_assets=3, n_depositors=50, duration=90)
print(f'Final supply: {result.supply[-1]:.2f}')
print(f'Final reserve: {result.reserve_value[-1]:.2f}')
print(f'Backing ratio: {result.backing_ratio[-1]:.4f}')
"

Project Structure

myco-bonding-curve/
├── docs/                    # Math specifications (0012)
├── src/
│   ├── primitives/          # Core invariants and mechanisms
│   ├── commitments/         # Labor, subscription, staking channels
│   ├── composed/            # Full MycoSystem + simulator
│   └── utils/               # Fixed-point, Newton solver, linear algebra
├── notebooks/               # Interactive exploration
├── reference/               # Existing Solidity contracts (read-only)
└── tests/                   # 128 property-based tests

Key Invariants

  1. supply >= 0 — never negative supply
  2. reserve_value >= 0 — never negative reserves
  3. redemption_amount <= reserve_value — never return more than exists
  4. sum(vault_weights) == 1.0 — weights always normalized
  5. flow_tracker.current_flow >= 0 — flow tracking non-negative
  6. commitment_minted <= cap * supply — commitment channels capped

Relationship to payment-infra

This repo sits alongside payment-infra (which has the existing polynomial bonding curve + USDC reserve). This is the research/advanced design track exploring multi-asset surfaces and commitment-based issuance. Both repos coexist.

Dependencies

  • Python >= 3.11
  • numpy, scipy, matplotlib, sympy
  • pytest, jupyter (dev)