Skip to content

fix: tag AMM snapshots with ingester network - #202

Merged
Miracle656 merged 1 commit into
Miracle656:mainfrom
tobiadewola41-eng:fix/amm-snapshot-network
Sep 30, 2026
Merged

Miracle656 merged 1 commit into
Miracle656:mainfrom
tobiadewola41-eng:fix/amm-snapshot-network

Conversation

@tobiadewola41-eng

@tobiadewola41-eng tobiadewola41-eng commented Sep 30, 2026 •

Copy link
Copy Markdown

closes #163

Summary

  • Tag pool_snapshots rows with the network passed to snapshotPool.
  • Add a regression test for an explicit mainnet snapshot when STELLAR_NETWORK is unset.

Verification

  • npx vitest run src/__tests__/ammIngester.test.ts
  • npx tsc --noEmit
  • Confirmed the regression test fails with the previous activeNetwork behavior.

Existing data

Previously mis-tagged mainnet snapshots may need backfilling or purge and re-ingestion. This change affects future writes only; existing rows cannot reliably reveal their originating network without external pool/network history.

@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@tobiadewola41-eng 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

@Miracle656
Miracle656 merged commit 2d12976 into Miracle656:main Sep 30, 2026
1 check passed
Miracle656 added a commit that referenced this pull request Sep 30, 2026
Every function in src/aggregator/vwap.ts now takes a required network and
filters price_points and pool_snapshots on it, getAMMPrice filters both
legs of its pool lookup, /price/:assetA/:assetB passes req.network through
to the aggregator, and the aggregate refresh worker runs once per enabled
network instead of pinning itself to whichever network the instance
happens to be indexing.

Merged locally: src/__tests__/price.test.ts conflicted only because #184
and 1c7e200 appended test blocks to the same tail; resolved as a union.
The README paragraph was corrected on merge — #195, #202 and #205 landed
network scoping for /screener, /pools, /depth and /prices/history after
this branch was written, so the list of still-unscoped endpoints was
stale.

Claude-Session: https://claude.ai/code/session_01USgemLt4Rnz4SGB1Srf3GB
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.

AMM snapshots are tagged with the process's network, not the ingester's

2 participants