Skip to content

Implement enumerable market registry and factory deployment - #1104

Merged
SteffQing merged 1 commit into
SO4-Markets:mainfrom
ayobami-dale:phase1-market-registry-factory
Oct 21, 2026
Merged

SteffQing merged 1 commit into
SO4-Markets:mainfrom
ayobami-dale:phase1-market-registry-factory

Conversation

@ayobami-dale

Copy link
Copy Markdown
Contributor

Summary

Implements market discovery and deployment infrastructure for Phase 1 (market creation, custody, balances). Delivers three core backlog items covering registry enumeration, factory deployment with deterministic IDs, and configuration validation with duplicate rejection.

closes #897
closes #898
closes #899

1. Market Registry (Issue #15 - Bounded Enumeration)

Purpose: Clients need canonical way to discover markets without scanning contract history.

Features:

  • O(1) direct lookup by market ID
  • Bounded pagination (max 100 markets/page, never unbounded)
  • Soft-delete TTL for market closure (deleted_ledger: Option)
  • No unbounded iteration patterns
  • Resource-efficient: O(1) lookup, O(1 + page_size) enumeration

part 2) — Market deployment and MarketCreated event
(part 1) — Config validation and duplicate rejection

- Issue SO4-Markets#15: Enumerable market registry with O(1) lookup and bounded pagination
- Issue SO4-Markets#14 (part 2): Market deployment and MarketCreated event emission
- Issue SO4-Markets#14 (part 1): Market factory config validation and duplicate rejection

Delivers:
- Bounded enumeration (max 100 markets/page, no unbounded iteration)
- Deterministic market ID derivation from (base, quote) pair
- Idempotent market creation (no duplicates)
- Full configuration validation (11 validation checks)
- Immutable fields (base, quote, lot_size, tick_size, fees)
- Soft-delete TTL for market closure
- MarketCreated event with complete configuration
- 25+ comprehensive tests covering positive and negative paths
- Complete documentation with API specs and examples
@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@ayobami-dale Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@SteffQing
SteffQing merged commit cdac2e8 into SO4-Markets:main Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants