Skip to content

event emission on all pool swap state changes for indexers #458

Description

@mikewheeleer

Summary

Some pool swap state changes emit no event, so indexers and off-chain systems can't observe them. Emit a documented event on every state change, with tests.

Why this matters

Silent state changes are invisible to indexers and break downstream systems. Complete, tested events make the contract observable.

Requirements

  • Emit a documented event on every pool swap state change, with the relevant fields.
  • No duplicate or missing emissions.
  • Assert topics and payload fields in tests.
  • Keep topic symbols within Soroban limits.

Technical guidance

  • Capture events immediately after the emitting call in tests.
  • Avoid topic collisions across event types.

Edge cases — each must have a test

  • each state change -> exactly one event
  • payload fields correct
  • topic symbols valid and unique
  • no duplicate emissions
  • read-only calls emit nothing

Acceptance criteria

  • All requirements and every edge case above implemented and covered by tests
  • New unit and integration tests; existing tests still pass and no regressions
  • Structured, typed errors (no leaked internals; stable codes)
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test all pass locally
  • Code follows the repo's existing conventions; no duplication or dead code
  • Short docs/comments explaining the design and any non-obvious decisions
  • PR description explains the approach and includes Closes #<issue>

Out of scope

  • Event schema versioning
  • Indexer implementation

Rewards

Part of the GrantFox OSS / Official Campaign (FWC26) — this task may be rewarded. PR quality is assessed by AI: depth, correctness under edge cases, meaningful tests, and clean design are what earn the reward. Shallow changes (typos, formatting, trivial docs) do not qualify.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions