Table of Contents

Class Topics

Namespace
Virtufin.Base.Messaging
Assembly
Virtufin.Base.dll

Static factory methods for Dapr-compatible topic strings following the domain spec's naming scheme.

public static class Topics
Inheritance
Topics
Inherited Members

Methods

ActMarket(string, string)

Market topic for live data: act.market.{entity}.{event}.

public static Topic ActMarket(string entity, string eventName)

Parameters

entity string

Entity segment (e.g. tick, orderbook).

eventName string

Event segment (e.g. received).

Returns

Topic

Build(string, string, string)

Build a topic from a generic shape: {domain}.{entity}.{event}. Used internally for tests and dynamic topic construction.

public static Topic Build(string domain, string entity, string eventName)

Parameters

domain string

Domain prefix (e.g. sc.S7F3A9B.trade, act.market).

entity string

Entity segment.

eventName string

Event segment.

Returns

Topic

HypMarket(string, string, string)

Market topic for hypothetical data: hyp.{selector}.market.{entity}.{event}.

public static Topic HypMarket(string selector, string entity, string eventName)

Parameters

selector string

Market selector (e.g. BTC_202101_202206).

entity string

Entity segment.

eventName string

Event segment.

Returns

Topic

Position(ScenarioId, string, string)

Position topic: sc.{scenarioId}.position.{entity}.{event}.

public static Topic Position(ScenarioId scenarioId, string entity, string eventName)

Parameters

scenarioId ScenarioId

Scenario id.

entity string

Entity (always position per the domain spec).

eventName string

Event (e.g. opened, updated, closed, flipped).

Returns

Topic

PublishAsync(IEventPublisher, Topic, IEventEnvelope, object)

Convenience: emit an envelope-payload pair to a topic. Wraps the payload in a CloudEvent using ToCloudEvent(IEventEnvelope, object?, string).

public static Task PublishAsync(this IEventPublisher publisher, Topic topic, IEventEnvelope envelope, object payload)

Parameters

publisher IEventPublisher

Publisher to use.

topic Topic

Destination topic.

envelope IEventEnvelope

Envelope carrying routing metadata.

payload object

Event payload.

Returns

Task

Risk(ScenarioId, string, string)

Risk topic: sc.{scenarioId}.risk.{entity}.{event}.

public static Topic Risk(ScenarioId scenarioId, string entity, string eventName)

Parameters

scenarioId ScenarioId

Scenario id.

entity string

Entity (e.g. pnl, drawdown, limit, margin, exposure).

eventName string

Event (e.g. updated, realized, breached, called).

Returns

Topic

Trade(ScenarioId, string, string)

Trade topic: sc.{scenarioId}.trade.{entity}.{event}.

public static Topic Trade(ScenarioId scenarioId, string entity, string eventName)

Parameters

scenarioId ScenarioId

Scenario id.

entity string

Entity (e.g. order, fill, execution, transfer, interest).

eventName string

Event (e.g. placed, cancelled, received).

Returns

Topic