Skip to content

/price/:assetA/:assetB/history pools testnet and mainnet rows into one OHLCV series #208

Closed

Description

@Miracle656

src/api/rest.ts:160-170 queries price_aggregates on pair_key alone:

SELECT bucket, window, vwap, sdex_vwap, amm_vwap, volume, trade_count,
       open_price, close_price, high_price, low_price
  FROM price_aggregates
 WHERE pair_key = $1 AND window = $2
 ORDER BY bucket DESC
 LIMIT $3

price_aggregates is written per network, so on an instance where ENABLED_NETWORKS covers both chains the returned buckets interleave testnet and mainnet rows for the same pair_key. A caller gets one OHLCV series that is not a series of anything — and because the route takes no network parameter, there is no way to ask for the one they meant.

Same class as the /basket problem #181 is addressing on that route. A price with the wrong network is worse than no price.

Fix: filter on network, read it from req.network ?? activeNetwork the way /price/:assetA/:assetB and /prices/history already do, echo the answered network back in the response, and add NetworkQuery to the route's openapi.yaml entry plus the network field to its response schema. A test with rows for both networks at the same pair_key and bucket, asserting only one network's rows come back, is what proves it.

The README already describes this under "Still reading across both networks"; this issue is to close it rather than document it.

Found while reviewing #179, which correctly left network off this route's spec entry because the route genuinely ignores it today.


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. Jonathan-ai9 commented on Oct 15, 2026

    @Jonathan-ai9
    Contributor

    @Jonathan-ai9 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hello,I’d like to work on this issue by making "/price/:assetA/:assetB/history" network-aware, filtering queries by "req.network ?? activeNetwork" and returning the answered network in the response. I’ll update the OpenAPI schema and add regression coverage with both testnet and mainnet rows to ensure only the requested network’s OHLCV data is returned.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Jonathan-ai9 to this issue.

  2. Noobb-byte commented on Oct 15, 2026

    @Noobb-byte

    @Noobb-byte has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi maintainer, i'd love to work on this please assign me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Noobb-byte to this issue.

  3. solaawojobi00-bit commented on Oct 15, 2026

    @solaawojobi00-bit
    Contributor

    @solaawojobi00-bit has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I’ll jump on this — src/api/rest.ts queries price_aggregates using only pair_key without filtering by network, which causes testnet and mainnet rows to interleave into a corrupted OHLCV series.
    Kindly assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @solaawojobi00-bit to this issue.

  4. mansur-codes commented on Oct 15, 2026

    @mansur-codes

    @mansur-codes has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I’ve read the description and I can deliver a fix to this please assign .

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @mansur-codes to this issue.

  5. deslawson commented on Oct 15, 2026

    @deslawson
    Contributor

    @deslawson has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Maintainer please kindly assign, I will go through the project context folder and resolve this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @deslawson to this issue.

  6. ObedChibunna commented on Oct 15, 2026

    @ObedChibunna

    @ObedChibunna has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I would love to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @ObedChibunna to this issue.

  7. drips-wave commented on Oct 15, 2026

    @drips-wave

    Congratulations, @mansur-codes! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @mansur-codes: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  8. Miracle656 commented on Oct 16, 2026

    @Miracle656
    CollaboratorAuthor

    Unassigning so this can be added to the Stellar Wave — a Wave issue can't carry an assignee from outside the programme.

    @mansur-codes this isn't a reassignment away from you: nothing has been submitted against it and it stays open. If you're still working on it, claim it through the Wave and it counts toward your points there. Apologies for the shuffle.

  9. Ahmad12developer commented on Oct 16, 2026

    @Ahmad12developer
    Contributor

    @Ahmad12developer has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi maintainer
    I like to work on this issue with basic understanding am having for the project

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ahmad12developer to this issue.

  10. drips-wave commented on Oct 16, 2026

    @drips-wave

    Congratulations, @solaawojobi00-bit! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @solaawojobi00-bit: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  11. drips-wave commented on Oct 16, 2026

    @drips-wave

    This issue has been completed by @solaawojobi00-bit as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @solaawojobi00-bit: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions