Table of Contents

Namespace Virtufin.Core.Contracts

Interfaces

IAsset

A tradeable asset. In the financial-model sense an asset has no counterparty risk (it is issued, not bilaterally agreed). Used as the underlying of Position and the building block of contracts.

IContract

A financial contract: an agreement that, given a sequence of messages arriving at particular time-points, produces a sequence of valid transactions. Implementations decide which messages they accept via VerifyMessages(IEnumerable<IMessage>, IScenarioHistory).

IContractBuilder

Builds a concrete IContract instance from IContractParameters. The builder is consumed once; use an IContractFactory for repeated construction.

IContractFactory

Builds a concrete IContract instance from IContractParameters. Distinct from IContractBuilder: factories are stateless and reusable, builders are single-shot.

IContractParameters

Marker for any opaque, equality-comparable bundle of inputs required to build a contract. The concrete payload is implementation-specific; in the canonical case it wraps a Virtufin.Data.Variant so the same data can be serialised through FlatBuffers or MessagePack.

IContractRegistry

Resolves IContract instances by IContractIdentifier. Distinct from IRegistry in Virtufin.Core, which is the EAV value/attribute registry and unrelated to the financial contract registry.

IMessage

A signed wrapper around a Transaction: a transaction plus the Sender that authorised it. Contracts use messages to filter the work they perform on a given time-point via IMessageSelectorPredicate.

IMessageGenerator

Generates the set of IMessages a contract would emit at a given timePoint given the prior scenarioHistory. Used to drive simulation forward.

IScenario

A snapshot of the system at a single time-point: the time itself plus the State of transactions observed.

IScenarioHistory

An append-only sequence of IScenario snapshots. Provides pull-based lookup (Scenario(ITimeStamp)) and a push-based observable (NewScenarios) for late subscribers — the latter is a hot Subject<IScenario> with no replay buffer.

IState

The set of transactions that have been observed at a single time-point. A scenario's State carries one of these.

ITransaction

A unit of business activity: a creation, cancellation, transfer, or any other operation that may be applied to a contract. Transactions carry an optional pointer to the contract they affect; for composite transactions (e.g. an atomic set of operations) the pointer is null.

ITransactionExecutor

Applies a Transaction to the system, returning a new IScenarioHistory reflecting the change.

IWithMaturity

A contract that has a definite maturity (the time-point at which it settles). Used by MaturitySelectorPredicate to filter messages.