Market Registry

How a transaction’s market is derived from the executing MarketContext and canonicalized against the protocol MarketRegistry.

Markets are defined as execution contexts. A transaction’s market is derived from the MarketContext contract/router that emitted an InteractionRecord, not from user-provided metadata.

Markets are derived from execution

  • MarketContext: an on-chain contract (or router) that emits canonical InteractionRecords for a commercial context.
  • Market (m): a policy + accounting container bound to one MarketContext.
  • marketId: a registry-assigned identifier derived from the executed MarketContext.

MarketRegistry (canonicalization)

The protocol maintains a canonical MarketRegistry:

marketContext → (marketId, vault, feeRouter, flags)

where:

  • marketId: uint32: registry-assigned market identifier (unique; not user-chosen)
  • vault: Address: MarketVault for this market (MAY be 0x0 if unused)
  • feeRouter: Address: where protocol fees for this market are routed
  • flags: uint32: e.g. ACTIVE / DEPRECATED

InteractionRecords

An InteractionRecord is emitted by a registered MarketContext during execution and is included in an SDL. Minimal sketch:

  • marketId: uint32
  • marketContext: Address
  • buyer: Address
  • provider: Address
  • amount: uint128
  • fee: uint128
  • edgeDelta and/or other protocol-defined graph/attribute deltas
  • proofRefs: bytes32[]
  • disputeRefs: bytes32[] (if applicable)

Validity rule (critical)

An interaction record (and any resulting commerce edges) is valid only if:

  • MarketRegistry[marketContext].marketId == marketId at that block height
  • the market is ACTIVE