[Exchange] Token earning mechanics — mint on productive actions done

← Capital Markets
Earning rules for debate, hypothesis, evidence, extraction, KG edges, predictions; inflation management

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (20)

[Verify] Work log: market bidding system implementation [task:exch-cm-03-BID]2026-04-25
[Exchange] Market bidding system — capital-backed positions on artifacts2026-04-25
Squash merge: orchestra/task/exch-cm--settlement-mechanics-resolve-positions-o (1 commits)2026-04-25
Squash merge: orchestra/task/exch-cm--settlement-mechanics-resolve-positions-o (2 commits)2026-04-25
Squash merge: orchestra/task/exch-cm--blockchain-bridge-prep-ledger-compatible (1 commits)2026-04-25
[Exchange] Portfolio management — positions, P&L, exposure, Sharpe [task:exch-cm-05-PORT]2026-04-25
Squash merge: orchestra/task/exch-cm--settlement-mechanics-resolve-positions-o (1 commits)2026-04-25
[Verify] Settlement mechanics atomicity — already resolved on main [task:exch-cm-06-SETL]2026-04-25
Squash merge: orchestra/task/exch-cm--settlement-mechanics-resolve-positions-o (2 commits)2026-04-25
Squash merge: orchestra/task/exch-cm--blockchain-bridge-prep-ledger-compatible (1 commits)2026-04-25
Squash merge: orchestra/task/exch-cm--blockchain-bridge-prep-ledger-compatible (1 commits)2026-04-25
[Exchange] Blockchain bridge prep — ledger EVM-compatible, export/import, migration guide [task:exch-cm-08-BRGE]2026-04-25
[Exchange] Portfolio management — positions, P&L, exposure, Sharpe [task:exch-cm-05-PORT]2026-04-25
[Verify] Capital-weighted resource allocation — already resolved on main [task:exch-cm-07-RALL]2026-04-25
[Exchange] Capital-weighted resource allocation — spec update [task:exch-cm-07-RALL]2026-04-25
[Exchange] Capital-weighted resource allocation — compute budget from demand [task:exch-cm-07-RALL]2026-04-25
Squash merge: orchestra/task/exch-cm--token-earning-mechanics-mint-on-producti (1 commits)2026-04-25
[Exchange] Wire missing reward_action hooks for hypothesis, evidence, experiment_extraction [task:exch-cm-02-EARN]2026-04-25
[Exchange] Work log: fix token_ledger DB path, verify all acceptance criteria [task:exch-cm-01-LEDG]2026-04-16
[Exchange] Fix token_ledger DB path to resolve via SCIDEX_DB env var; falls back to ~/scidex/scidex.db so it works from both main and worktree contexts [task:exch-cm-01-LEDG]2026-04-16
Spec File

Goal

Implement token minting rules: agents earn tokens by doing productive work in SciDEX.
The earning mechanics create the inflow of capital into the system. Rates must be calibrated
so the economy doesn't hyperinflate (too many tokens) or stagnate (too few).

Earning Rules

ActionBaseMultiplierCapHook Location
Debate round10x quality_score20post_process.py after debate
Hypothesis generation25x composite_score50post_process.py after synthesis
Evidence contribution5x 1.5 if contradicting15evidence_validator.py
Experiment extraction15x extraction_confidence30experiment_extractor.py
KG edge creation3x evidence_strength10post_process.py
Knowledge gap resolved30x priority_score100agent.py gap completion
Correct market prediction50x abs(price_delta)200settlement
Quality gate passed2x 12quality_gates.py

Acceptance Criteria

token_rewards.py module with reward_action(agent_id, action_type, context) function
☐ Each earning rule implemented with base, multiplier, cap
☐ Rewards are idempotent — same action can't mint twice (tracked by reference_id)
☐ Integration hooks in existing code:
- post_process.py: reward debate, hypothesis, KG edge creation
- evidence_validator.py: reward evidence contributions
- agent.py: reward gap resolution
☐ Daily minting cap per agent: 500 tokens (prevents runaway minting)
☐ System-wide daily minting cap: 10,000 tokens (prevents hyperinflation)
☐ Minting rate dashboard: tokens minted per day, per action type, per agent
☐ API: GET /api/token/earnings/{agent_id} — earning breakdown
☐ Calibration: after 7 days, verify token velocity is reasonable (not too fast/slow)

Inflation Management

Target: ~5% monthly supply growth

  • If growth exceeds 10%: reduce base earning rates by 20%
  • If growth below 2%: increase base earning rates by 20%
  • Adjustment reviewed monthly through Senate governance

Dependencies

  • exch-cm-01-LEDG — Token ledger must exist for minting

Dependents

  • exch-cm-03-BID — Agents need tokens to bid
  • exch-cm-07-RALL — Earning rates balance against resource costs

Work Log

2026-04-16 08:00 PT — Slot 0

  • Audit reopened: task previously marked done but no commits found. Re-evaluating against current main.
  • Analysis:
- emit_rewards.py (Driver #5) already exists and processes agent_contributionstoken_ledger
- post_process.py already has inline award_hypothesis_tokens, award_evidence_tokens, and KG edge token awards (direct ledger writes)
- Missing: debate round contribution recording, gap resolution contribution recording, unified token_rewards.py entry point, and /api/token/earnings/{agent_id} endpoint
  • Decision: Implement the missing integration hooks and new token_rewards.py module
  • Created: economics_drivers/token_rewards.py with reward_action() and get_earnings_breakdown() functions
- Idempotent via JSON metadata $.ref field check against agent_contributions
- 8 earning rules: debate_round, hypothesis, evidence, kg_edge, knowledge_gap_resolved, market_prediction, quality_gate_passed, experiment_extraction
- Each rule has base/multiplier_field/cap
  • Modified: scidex/agora/scidex_orchestrator.py — added reward_action call for each debate round (inside the round loop, after INSERT)
  • Modified: post_process.py — added reward_action calls for KG edge creation (after inline token award) and gap resolution (in update_gap_statuses when status='resolved')
  • Modified: api.py — added GET /api/token/earnings/{agent_id} endpoint using get_earnings_breakdown()
  • Note: Existing direct token write functions (award_hypothesis_tokens, award_evidence_tokens, KG edge inline award, _award_debate_tokens) remain unchanged to avoid regression. New reward_action calls create agent_contributions records for emit_rewards.py processing in parallel.
  • Verified: All files pass python3 -m py_compile; idempotency query works against live DB

Sibling Tasks in Quest (Capital Markets) ↗