Pricing HQ: publish market-key changes and fan out only affected inventory #717

Open
opened 2026-09-17 16:03:08 +00:00 by gambit-admin · 0 comments
Owner

Goal

Replace full-inventory repricing scans with event-driven evaluation of only inventory affected by a changed market value.

Work

  • Define one canonical market key covering category, canonical variant, condition, grading company and grade where applicable.
  • Emit a durable market-price-changed event only after the canonical price transaction commits.
  • Include old/new value, source, evidence time, confidence and a stable dedupe key.
  • Build a shard-friendly lookup from market key to active on-hand inventory.
  • Fan out affected inventory IDs in bounded pages without loading a hot card into memory at once.
  • Coalesce repeated updates so workers calculate from the newest available market evidence.
  • Keep a rolling 24-hour reconciliation as a repair/backstop, not the normal primary path.
  • Ensure locked items update market/delta evidence but never receive automatic ASK writes.

Acceptance criteria

  • One card price change does not scan unrelated inventory.
  • Replaying the same event creates no duplicate evaluation or ASK change.
  • A hot market key with millions of holders can be paged and partitioned safely.
  • New raw, graded and sealed provider lanes can publish the same event contract.
  • Tenant boundaries remain enforced during fanout.

Dependencies: the canonical evidence lanes and #715. Program: #554.

## Goal Replace full-inventory repricing scans with event-driven evaluation of only inventory affected by a changed market value. ## Work - Define one canonical market key covering category, canonical variant, condition, grading company and grade where applicable. - Emit a durable market-price-changed event only after the canonical price transaction commits. - Include old/new value, source, evidence time, confidence and a stable dedupe key. - Build a shard-friendly lookup from market key to active on-hand inventory. - Fan out affected inventory IDs in bounded pages without loading a hot card into memory at once. - Coalesce repeated updates so workers calculate from the newest available market evidence. - Keep a rolling 24-hour reconciliation as a repair/backstop, not the normal primary path. - Ensure locked items update market/delta evidence but never receive automatic ASK writes. ## Acceptance criteria - One card price change does not scan unrelated inventory. - Replaying the same event creates no duplicate evaluation or ASK change. - A hot market key with millions of holders can be paged and partitioned safely. - New raw, graded and sealed provider lanes can publish the same event contract. - Tenant boundaries remain enforced during fanout. Dependencies: the canonical evidence lanes and #715. Program: #554.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gambit/gambit#717