Skip to content

NEO Trading Engine Overview

Goal

Build a profitable, low-capital market making system on XRPL using controlled experiments. Focus: reduce toxicity, maintain participation, achieve inventory balance, maximize realized spread.

Why

This is a real, capital-efficient trading system — not a theoretical model. It has real financial impact (live trading eventually), requires precision and discipline (one-variable experiments), and builds a reusable system, not a one-off strategy. Claude's role is to support structured execution and help maintain discipline in experiments — not to redesign the system or introduce unnecessary complexity.

Tangible Outcomes

  • A stable, production-ready market making engine
  • A clear playbook for tuning and operating it
  • A set of validated parameters for different conditions
  • A repeatable workflow for testing and improving the system
  • The engine maintains consistent two-sided participation, controlled toxicity, balanced inventory, and positive realized spread

How to Run

Run from: C:\Users\Katja\Documents\NEO GitHub\neo-2026

DB: neo_live_stage1.db — always use this for live sessions.

Pre-session realignment check (run before every session after a DEGRADED halt):

python tools/realign_inventory_to_onchain.py --config config/config_live_stage1.yaml --db neo_live_stage1.db --dry-run
If delta > dust, run with --confirm before starting the session.

10 minutes:

python run_paper_session.py --config config/config_live_stage1.yaml --db neo_live_stage1.db --duration-seconds 600 --live

30 minutes:

python run_paper_session.py --config config/config_live_stage1.yaml --db neo_live_stage1.db --duration-seconds 1800 --live

1 hour:

python run_paper_session.py --config config/config_live_stage1.yaml --db neo_live_stage1.db --duration-seconds 3600 --live

2 hours (default — Atlas-locked FLAG-044):

python run_paper_session.py --config config/config_live_stage1.yaml --db neo_live_stage1.db --duration-seconds 7200 --live

Start the dashboard:

streamlit run dashboard.py --server.port 8501
Opens at: http://localhost:8501

Post-session — Segment B analysis:

python scripts/segment_b_summary.py --db <path-to-db> --session-id <N>


Open Problems

Active (current focus)

  1. Bid-side toxicity — Buy fills experiencing adverse selection (negative markout). Need to reduce toxicity while maintaining participation.
  2. Toxicity vs participation tradeoff — Pulling bids back reduces toxicity but may reduce fills. Need to find the stable operating zone.
  3. Inventory balance — System drifts long XRP when bids are too aggressive. Need near-neutral inventory without overcorrecting.
  4. Control limits of spread-only tuning — Adjusting bid distance alone may not fully solve toxicity. Need to determine if a new control (directional logic, anchor adjustment) is required.
  5. Reliable experimental framework — Isolate one variable per test, ensure fill logic and reference prices are aligned, confirm results reflect real behavior.

Secondary (later phases)

  1. Directional protection logic — Avoid buying during short-term downward moves.
  2. Structural quoting improvements — Laddering or multi-level quoting only if single-order reaches its limits.
  3. Monitoring and observability — Improve visibility into system performance and decision-making.