Architecture

System Overview

NODO consists of four main layers working together to deliver AI-powered market analysis.

┌─────────────────────────────────────────────┐
│              INTERFACE LAYER                 │
│     Telegram Bot  │  Web API  │  Dashboard  │
├─────────────────────────────────────────────┤
│              GATEWAY LAYER                   │
│   Auth  │  Rate Limiting  │  402 Payments   │
├─────────────────────────────────────────────┤
│              CORE SERVICES                   │
│  Scanner  │  AI Orchestrator  │  Consensus  │
├─────────────────────────────────────────────┤
│              DATA LAYER                      │
│   Polymarket API  │  AI Providers  │  Cache │
└─────────────────────────────────────────────┘

Component 1: Market Scanner

The Scanner fetches and filters markets from Polymarket's API.

What It Does

  1. Queries Polymarket's Gamma API for active markets

  2. Parses JSON response into structured objects

  3. Filters by minimum volume, probability, and other criteria

  4. Returns clean list of opportunities

Why It Matters

Raw API data is messy. Prices come as strings, some fields are JSON-encoded within JSON, and many markets have zero liquidity. The Scanner normalizes everything.

Code Example

Key detail: Polymarket returns outcomePrices as a JSON string inside JSON, so we need json.loads() to parse it:


Component 2: AI Orchestrator

The Orchestrator sends market data to multiple AI models in parallel and collects their responses.

What It Does

  1. Builds a standardized prompt from market data

  2. Sends prompt to all configured AI providers simultaneously

  3. Waits for all responses (with timeout handling)

  4. Parses each response into structured format

Why Parallel Matters

Sequential calls to 6 models would take 30+ seconds. Parallel calls take only as long as the slowest model (~5-8 seconds).

Code Example

The prompt is structured to get consistent output from all models:


Component 3: Consensus Engine

The Consensus Engine aggregates multiple AI responses into a single recommendation.

What It Does

  1. Collects all AI responses

  2. Applies weights to each model's vote

  3. Calculates agreement ratio

  4. Adjusts confidence based on consensus level

  5. Identifies and reports dissenting opinions

Why Weights Matter

Not all models are equal. Claude excels at reasoning, GPT-4 at general knowledge, DeepSeek at math. Weights reflect this:

Model
Weight
Why

Claude 3.5 Sonnet

1.5x

Best reasoning

GPT-4o

1.2x

Broad knowledge

DeepSeek

1.1x

Strong at math/logic

Others

1.0x

Baseline

Code Example

Confidence calibration is key — high agreement boosts confidence, low agreement reduces it:


Component 4: Payment Gateway

The Payment Gateway handles 402 micropayments.

What It Does

  1. Checks user's prepaid balance before processing

  2. If sufficient, deducts and processes request

  3. If insufficient, returns 402 with payment options

  4. Verifies payments and credits balances

Code Example


Data Flow Summary

Here's how a request flows through the system:

Total latency: 5-10 seconds (mostly waiting for AI models)

Last updated