Skip to content

[Backend] — Entry fee: grow prize_pool on UserJoinedEvent #959

@Olowodarey

Description

@Olowodarey

Background

The contract's join_event (contract Issue 7) charges event.entry_fee
(if non-zero) from the joining user and adds it to event.prize_pool. The
indexer's current UserJoinedEvent handling only tracks
participant_count:

If entry_fee > 0, the cached `creator_events.

Goal

Capture the entry fee paid (if any) in the UserJoinedEvent event and add
it to the cached prize_pool, and add a running total of fees collected for
transparency.

Tasks

  1. extractEventData() 'UserJoinedEvent' case: add
  2. CreatorEvent entity (Issue 1): add
  3. handleUserJoinedEvent(): after incrementing
    • event.prize_pool = (BigInt(event.prize_pool) + BigInt(data.entry_fee_paid)).toString()
    • event.total_entry_fees_collected = (BigInt(event.total_entry_fees_collected) + BigInt(data.entry_fee_paid)).toString()
  4. EventStatsResponseDto (Issue 5): add

Acceptance Criteria

  • A UserJoinedEvent with entry_fee_paid: "10000000" (1 XLM in
  • A UserJoinedEvent with no entry_fee_paid (free event) leaves
  • prize_pool arithmetic uses BigInt and is correct for values

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions