Market Data

Aurum binds a venue data source and publishes typed values on canonical topic keys. Strategy handlers subscribe to the exact key declared at compile time.

Bind a feed

#include <aurum/venue/okx.hpp>

bind<Datafeed>(venue::okx::Bar("BTCUSDT", "1m"));
bind<Datafeed>(venue::okx::Orderbook("BTCUSDT"));

Subscribe to its topics

on(TOPIC<"bar://okx/BTCUSDT@1m">,
   [](const Tick<schema::BarRow>& tick) {
  if (tick.payload.close_timestamp == 0) return;
  log::info("close={}", tick.payload.close.to_string());
});

on(TOPIC<"book://okx/BTCUSDT@full">,
   [](const Tick<schema::BookRow>&) {
  // Read the current projected book through the runtime view.
});

The topic literal and payload type form one contract. A mismatched schema is a compile-time error where the SDK has a canonical binding.

Canonical topic families

Family

Example

Payload

Bars

bar://okx/BTCUSDT@1m

schema::BarRow

Books

book://okx/BTCUSDT@full

schema::BookRow

Factors

factor://spread/btcusdt.okx@bar:1m

Scalar factor value

Order events

order://paper/filled

Order event envelope

Resource discovery

A running application publishes a resource catalog. Forge and Terminal use that catalog to discover exact topic keys, schemas, delivery models, and history availability. Clients must not guess a topic from its display label.

Use Resource Contracts for the resource contract and Runtime WebSocket for remote subscriptions.