03 · Research system
Forex Mercatus Codex
A hosted Python terminal for charts, multi-market views, and a session-scoped paper bot — built so it cannot be mistaken for a brokerage.
Paper research desk
Challenge
Show market structure, multi-panel analysis, and a bot loop without letting a visitor believe they are placing a real order. The hard part is the boundary, not the chart.
Role and scope
Built, hosted, and bounded the desk
- Built a Python and Highcharts desk covering Chart, Multi, Whales, Flow, and Bot.
- Hosted it on the VPS. The process listens on port 8790 and is published over HTTPS.
- Gave each browser tab its own session-scoped paper bot instead of one shared tape.
- Fused public feeds (Yahoo, Kraken, Binance) and fell back to synthetic tape when a feed is unavailable.
- Cut inventory and load path so cold start and static serving are clearer on an ~87 MB app.
Architecture
01
Feeds
Public market data, with synthetic tape when a source is down. A delayed snapshot, not a broker feed.
02
Desk
Chart, multi-symbol compare, flow and whale views, and a paper bot. Highcharts for the portfolio demo.
03
Session
One paper bot per browser tab. Cap of 24 sessions. Idle sessions expire after 2 hours.
04
Policy
paper_only is true. Sign-in and journal edits stay off on the public desk. No order can be placed.
60–90 second demo
- Open the desk and confirm the paper label before you touch a symbol.
- Pick one symbol, then compare a second market in the multi view.
- Run one paper action. It should change simulated state only.
- Open the health JSON and check paper_only, the symbol list, and the session cap.
Flows to look at

Paper desk
Public entry: paper label, session scope, delayed quotes, and a four-step tour. The embedded chart loads after this screen.
AI behavior
- The bot is a constrained research assistant on simulated state.
- It can summarize retrieved data and propose a paper-only action.
- A policy gate blocks live orders. The simulated state is explicit.
- Useful provenance on a response: timestamp, data source, and whether the line is observation, analysis, or simulation.
Security
- No broker credentials and no order route.
- Public desk disables sign-in and journal edits.
- Each visitor session is isolated from other visitors’ paper state.
Monitoring
- Published health JSON: paper_only, symbols, data sources, session cap, idle TTL.
- Symbols on that health snapshot include SPX, NQ, BTC, XAU, and EURUSD.
- Data sources noted there include synthetic tape, Yahoo, Binance, CFTC, and Forex Factory.
Limits
- This is simulated research, not a brokerage, not an exchange, and not advice.
- Quotes are delayed public snapshots. A missing feed becomes synthetic tape, which is labelled.
- Highcharts is used as a non-commercial portfolio demo.
- Test suites are in the private source. The public check is the health endpoint plus the paper-only UI.