Implement seed_market — initial AMM liquidity seeding#302
Merged
GoSTEAN merged 4 commits intoNetwalls:mainfrom Mar 26, 2026
Merged
Implement seed_market — initial AMM liquidity seeding#302GoSTEAN merged 4 commits intoNetwalls:mainfrom
GoSTEAN merged 4 commits intoNetwalls:mainfrom
Conversation
- Add BlockchainIndexerService for monitoring smart contract events - Implement event polling and processing from Stellar RPC - Add state management with database checkpoints - Create admin API endpoints for indexer control - Add comprehensive error handling with DLQ - Implement 7 event type handlers (market_created, pool_created, shares_bought, etc.) - Add automatic startup and graceful shutdown - Create comprehensive unit and integration tests Features: - Real-time event monitoring from blockchain - Batch processing (10 ledgers per cycle) - Checkpoint system for resume capability - Dead Letter Queue for failed events - Admin-only control endpoints - Statistics and monitoring - Manual reprocessing support API Endpoints: - GET /api/indexer/status - Get indexer statistics - POST /api/indexer/start - Start indexer - POST /api/indexer/stop - Stop indexer - POST /api/indexer/reprocess - Reprocess from ledger Event Types: - market_created - Market creation confirmation - pool_created - AMM pool initialization - shares_bought - Share purchase confirmation - shares_sold - Share sale confirmation - market_resolved - Market resolution - attestation_submitted - Oracle attestation - distribution_executed - Treasury distribution Tests: - 8+ unit tests with comprehensive coverage - 10+ integration tests for all endpoints - Authentication and authorization tests - Error handling and validation tests Documentation: - Complete architecture documentation - API specifications - Configuration guide - Troubleshooting guide - Implementation summary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #257
Implements operator role management in the MarketFactory Soroban contract, allowing delegated market creation without exposing superadmin access.
Changes
factory.rs
DataKey::IsOperator(Address) — typed storage key for role membership
grant_operator(admin, operator) — admin-only, sets key to true, emits OperatorGrantedEvent
revoke_operator(admin, operator) — admin-only, sets key to false, emits OperatorRevokedEvent
is_operator(address) — pure read, returns bool
assert_admin_or_operator(env, caller) — shared internal helper used by create_market
factory_test.rs
Rewrote test file with shared setup_factory / future_times helpers
Added 9 operator-specific tests covering all acceptance criteria
Fixed unused import warnings in oracle_test.rs and market_test.rs to pass cargo clippy --all-targets -D warnings
Fixed unused inner variable binding in amm.rs buy_shares that would fail clippy