Skip to main content

Two Data Protocols

In ClyptQ’s Von Neumann-inspired architecture, FIELD and STATE are the two address spaces — separate memory namespaces that keep market data and portfolio state cleanly isolated. Every strategy has these two types of data flowing through it: Both protocols use the same infrastructure — consumer maps, RollingBuffers, TaggedArrays, and topological execution. The only difference is where the data originates.

FIELD Protocol

Format

Bybit uses linear (not futures) as its market type for USDT-margined perpetual contracts. If you specify "futures" for Bybit, the system auto-normalizes it to "linear", but using "linear" explicitly is recommended.

Using FIELD in a Graph

The Input declaration tells the graph:
  • What dataFIELD:binance:futures:ohlcv:close
  • At what resolution"1m" (1-minute candles)
  • How much historylookback=20 (20 ticks of rolling history)

FIELD Distribution

When new market data arrives (a tick), the graph distributes it to all consuming operators via pre-computed consumer maps:

Multi-Venue Routing

FIELD prefixes prevent data collision across exchanges:

SymbolSourceMap

The FIELD protocol connects to the data layer through SymbolSourceMap:
When FIELD:binance:futures:ohlcv:close arrives, it contains data for BTC/USDT and ETH/USDT — the symbols mapped to that source.

Forward-Fill

If a FIELD source has no new data at a given tick, the graph forward-fills by reusing the last known value:
The value is preserved, but updated=False signals staleness. Operators can check updated to decide whether to recompute.
FIELD is the only way operators receive market data. There is no get_price() function, no global dataframe, no implicit context. This is by design — it prevents lookahead bias and makes all data dependencies explicit.

STATE Protocol

Format

Available STATE Keys

STATE data is updated by the execution engine after every fill. You don’t update STATE manually — it reflects the real (or simulated) portfolio state.

Using STATE in a Graph

Operators declare STATE inputs the same way as FIELD inputs:
FIELD and STATE inputs mix in the same operator. The graph treats both identically for routing.

Balance Operators

Pre-built operators for common STATE queries:

Feedback Loops

Because STATE flows back into the graph, strategies create closed-loop feedback:
Feedback enables: drawdown-based de-leveraging, equity curve trading, adaptive position sizing, Kelly criterion, regime switching.

Memoryless Execution

The executor has no memory of past orders. Every tick:
  1. Receives TradingIntention from intention nodes
  2. Computes delta against current STATE
  3. Executes order (simulated or real)
  4. Updates STATE
  5. Forgets everything — next tick starts fresh
This means all metrics and tracking are operators in the graph, not embedded in the execution layer. Want custom Sharpe? Write a metric operator. Want drawdown tracking? Write a metric operator.

Future Data Types (Planned)

Additional FIELD domains are planned:
Global data (macro indicators) will be broadcast across the symbol dimension. Domain-specific data (on-chain) will use the TaggedArray exists mask to indicate which symbols it applies to.

TaggedArray

The 4-field data structure used by both FIELD and STATE

Lookback Buffers

How RollingBuffers store FIELD and STATE data

Execution Pipeline

Intention → Delta → Order → Fill → STATE update

TradingSpec

How DataSpec and AccountSpec define FIELD and STATE namespaces