Skip to content

[api] Sync indexer event tables into Pool, Swap, and Position models #306

Description

@Mimah97

Problem

IndexerWorker writes only to event tables (pool_created, swap_processed, etc.). Relational pool, swap, and position tables stay empty, breaking /pools, /swaps, portfolio views, and StatsWorker.

Acceptance criteria

  • On PoolCreated → upsert Pool + Token records
  • On SwapProcessed → insert Swap, update pool state
  • On PositionMinted / PositionBurned → upsert or close Position
  • Idempotent on eventId
  • Integration test with test DB

Files

  • apps/api/src/indexer/indexer.worker.ts

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