Public
Agentic Trading Network bot with CNOS cognitive resolution layer
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

ATN — Agentic Trading Network & CNOS Bot

Mutualize perception. Privatize execution.

One network. Many nodes. One intelligence.

Overview

This is the first deployed vertical of CNOS (Cognitive Network OS) — the missing cognitive resolution layer (Layer 6) that completes the AI agent stack. ATN enables traders to run private agentic desks that contribute structured market intelligence to a shared network while keeping execution, accounts, positions, and PnL completely private.

Architecture

Layer 6: Cognitive Resolution Layer (CNOS) ← THIS PROJECT
Layer 5: Agent Orchestration (TypeScript state machines)
Layer 4: Agent Communication (HTTP API)
Layer 3: Tool & Data Access (Market data via Yahoo Finance)
Layer 2: Model Layer (Computed indicators, no LLM required)
Layer 1: Infrastructure (Val Town managed runtime)

8-Stage Cognitive Resolution Cycle

Observe → Hypothesis → Proof → Contradiction → Invalidation
→ Resolution → Memory → Reuse → Repeat

File Structure

lib/
  db.ts           — SQLite schema, MarketCase/Observation storage
  market-data.ts  — Market data tools (quotes, OHLCV, technicals, levels, news)
  agents.ts       — 6 private desk agents (macro, structure, liquidity, risk, memory, execution)
  cnos.ts         — 8-stage cognitive resolution cycle engine
  settings.ts     — Settings system (blob storage)
  telegram.ts     — Telegram notification service
  dashboard.ts    — Dashboard HTML generator
api/
  main.ts         — HTTP API + dashboard (Hono)
cron/
  pipeline.ts     — Automated pipeline cron job

Features

Private Agentic Desk (6 Agents)

  • Macro Agent — Economic regime, cross-asset flows, VIX/DXY context
  • Structure Agent — Price action, SMC, swing analysis, multi-TF alignment
  • Liquidity Agent — VWAP, volume profiling, FVGs, premium/discount
  • Risk Agent — ATR-based risk assessment, position sizing suggestions
  • Memory Agent — RAG over resolved network memory
  • Execution Agent — Private signal generation (NEVER shared)

CNOS 8-Stage Cycle

  1. Observation — Agents produce structured observations
  2. Hypothesis — Best observation becomes a testable MarketCase
  3. Proof — Automated backtesting (win rate, profit factor, drawdown)
  4. Contradiction — Compare against other network cases
  5. Invalidation — Check if price hit invalidation level
  6. Resolution — CONFIRMED / REJECTED / REFINED / PENDING
  7. Memory — Verified cases enter resolved memory store
  8. Reuse — Future analysis benefits from resolved memory

Market Data Tools (MCP-style)

  • search_symbols — Fuzzy symbol resolution
  • get_quote — Real-time price snapshot
  • get_quotes_batch — Multi-symbol quotes
  • get_ohlcv — Historical OHLCV bars
  • get_technicals — RSI, MACD, EMAs, Bollinger, ATR, Stoch, ADX
  • get_technicals_rating — Aggregated buy/sell/neutral rating
  • analyze_multi_timeframe — Trend alignment across 15m, 1H, 4H, 1D
  • compute_levels — Support/resistance, swing levels, FVGs, premium/discount
  • get_news — Latest headlines for a symbol
  • run_screener — Filter symbols by indicator conditions
  • compare_symbols — Side-by-side comparison
  • calculate_correlation — Log-return correlation matrix

Telegram Integration

  • New MarketCase notifications
  • Resolution notifications (CONFIRMED/REJECTED)
  • Contradiction alerts
  • Pipeline run summaries
  • Error alerts
  • All configurable from the dashboard Settings tab

Dashboard

  • Dashboard tab — Network stats, recent cases, pipeline runs
  • MarketCases tab — Browse all cases, filter by resolution
  • Pipeline tab — Manually trigger pipeline, view run history
  • Settings tab — Configure Telegram, pipeline, desk, notifications
  • Market Tools tab — Interactive market data tool testing
  • Memory tab — Search resolved network memory

API Endpoints

MethodPathDescription
GET/Dashboard
GET/api/healthHealth check
GET/api/statsNetwork statistics
GET/api/casesRecent MarketCases (optional ?resolution= filter)
GET/api/pipelinePipeline run history
POST/api/pipeline/runManually trigger pipeline
GET/api/settingsCurrent settings
POST/api/settingsUpdate settings
POST/api/settings/resetReset to defaults
POST/api/telegram/testSend test Telegram message
GET/api/memory/search?q=Search resolved memory
POST/api/tools/search_symbolsSearch symbols
POST/api/tools/get_quoteGet quote
POST/api/tools/get_ohlcvGet OHLCV
POST/api/tools/get_technicalsGet technicals
POST/api/tools/get_technicals_ratingGet rating
POST/api/tools/analyze_multi_timeframeMulti-TF analysis
POST/api/tools/compute_levelsCompute levels
POST/api/tools/get_newsGet news
POST/api/tools/run_screenerRun screener
POST/api/tools/compare_symbolsCompare symbols
POST/api/tools/calculate_correlationCorrelation matrix
POST/api/cycle/:symbolRun full CNOS cycle for one symbol

Setup

  1. Open the dashboard (the live URL)
  2. Go to Settings tab
  3. Configure Telegram (bot token + chat ID from @BotFather)
  4. Configure Pipeline (symbols, timeframe, enable automation)
  5. Click Save Settings
  6. Go to Pipeline tab and click Run Pipeline Now to test
  7. Enable the automated pipeline toggle to run on schedule

Core Principles

  • Perception is mutualized
  • Execution remains private
  • Protocol before memory
  • Resolution creates trust
  • Memory compounds value

Value Flow

Observe → Structure → Normalize → MarketCase → Tag → Route
→ Resolve → Remember → Improve → Repeat

ONE NETWORK. MANY NODES. ONE INTELLIGENCE.