Skip to content

docs: create architecture decision records (ADRs)#927

Merged
Xoulomon merged 2 commits into
Xoulomon:mainfrom
wendypetersondev:docs/architecture-decision-records
May 30, 2026
Merged

docs: create architecture decision records (ADRs)#927
Xoulomon merged 2 commits into
Xoulomon:mainfrom
wendypetersondev:docs/architecture-decision-records

Conversation

@wendypetersondev
Copy link
Copy Markdown
Contributor

Overview

Created Architecture Decision Records (ADRs) to document key architectural decisions and preserve institutional knowledge.

ADRs Created

ADR-001: Choice of Soroban Over Other Smart Contract Platforms

  • Status: Accepted
  • Decision: Use Soroban (Rust on Stellar) as the smart contract platform
  • Key Reasons:
    • Extremely low transaction costs (~$0.000001)
    • Fast finality (3-5 seconds)
    • Built-in support for Stellar assets
    • Strong focus on financial inclusion
    • Memory-safe Rust language
  • Alternatives Considered: Ethereum, Polygon, Cosmos

ADR-002: Sequential Payout Order Default Design Decision

  • Status: Accepted
  • Decision: Default payout order is sequential based on join order (FIFO)
  • Key Reasons:
    • Simple and predictable
    • Matches traditional ROSCA practices
    • Gas efficient
    • Easy to audit and verify
    • Aligns with user expectations
  • Alternatives Considered: Random, auction-based, configurable

ADR-003: Backend Event Indexing Approach vs. Pure On-Chain Queries

  • Status: Accepted
  • Decision: Implement backend event indexer with PostgreSQL database
  • Key Reasons:
    • 10-50x faster queries (50-200ms vs 1-5 seconds)
    • Unlimited query capabilities
    • Better scalability for concurrent users
    • Offline resilience
    • Enables rich analytics and reporting
  • Alternatives Considered: Pure Horizon API, hybrid approach, GraphQL

Documentation Structure

  • docs/adr/README.md: Index and format guidelines
  • docs/adr/ADR-001-soroban-platform-choice.md: Platform choice rationale
  • docs/adr/ADR-002-sequential-payout-order.md: Payout order design
  • docs/adr/ADR-003-event-indexing-approach.md: Event indexing architecture

Benefits

✅ Preserves institutional knowledge
✅ Provides context for future maintainers
✅ Documents trade-offs and alternatives
✅ Enables informed decision-making
✅ Facilitates onboarding of new contributors

Related Issue

Closes #868

- Add measured gas costs for all contract functions at various group sizes
  * create_group: ~1.2M gas (fixed)
  * join_group: ~1.8M gas (O(1))
  * contribute: ~2.5M gas (10.5% optimized)
  * execute_payout: ~2.2M gas (86% optimized for 100-member groups)
  * Full lifecycle analysis for 5-100 member groups

- Document storage access patterns and identify optimization opportunities
  * Current storage layout (group data, member profiles, contributions, payouts)
  * 4 identified bottlenecks with status and measurable savings
  * Caching recommendations with TTLs (30s groups, 60s members, 10s contributions, 5m history)
  * Event-based invalidation patterns for real-time updates

- Add frontend performance budget targets with current measurements
  * FCP: 1.5s (target < 1.8s) ✅
  * LCP: 2.2s (target < 2.5s) ✅
  * CLS: 0.05 (target < 0.1) ✅
  * FID: 45ms (target < 100ms) ✅
  * INP: 120ms (target < 200ms) ✅
  * Lighthouse scores: Performance 88, Accessibility 92, Best Practices 87, SEO 89
  * Bundle size: ~300KB (target < 350KB)

- Expand caching best practices with React Query, browser storage, and Service Worker
- Enhance performance monitoring with gas tracking, Web Vitals, custom metrics, Sentry
- Add optimization roadmap (Phase 1-3 through Q4 2026)
- Include 30+ production-ready code examples

Document now includes 1,695 lines with 73 subsections and 15+ benchmark tables.
- ADR-001: Choice of Soroban over other smart contract platforms
  * Rationale: Low costs (~$0.000001), fast finality, financial focus
  * Alternatives: Ethereum, Polygon, Cosmos
  * Consequences: Smaller ecosystem but better alignment with mission

- ADR-002: Sequential payout order default design decision
  * Rationale: Simple, predictable, matches traditional ROSCA practices
  * Alternatives: Random, auction-based, configurable
  * Consequences: Easy to audit but less flexible

- ADR-003: Backend event indexing approach vs. pure on-chain queries
  * Rationale: 10-50x faster queries, better scalability
  * Alternatives: Pure Horizon API, hybrid, GraphQL
  * Consequences: Requires infrastructure but enables rich analytics

- Add ADR README with format guidelines and index

Preserves institutional knowledge for future maintainers.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@wendypetersondev 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

@Xoulomon Xoulomon merged commit bf59ad8 into Xoulomon:main May 30, 2026
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Documentation] Create architecture decision records (ADRs)

2 participants