Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SERVICES-2541] Timescaledb query for token mini price charts #1441

Open
wants to merge 15 commits into
base: feat/xexchange-v3
Choose a base branch
from

Conversation

mad2sm0key
Copy link
Contributor

@mad2sm0key mad2sm0key commented Aug 14, 2024

Reasoning

  • the priceCandles query and the underlying timescaleDB aggregate are set for deprecation

Proposed Changes

  • add specialized tokensLast7dPrice query that can return price candles (with a 4 hours resolution) for multiple tokens in a single request
  • add timescaleDB query for fetching token prices from the token_candles_hourly aggregate
  • add manual gapfilling logic
  • add cache warmer + resolve query from cached values

How to test

query {
  tokensLast7dPrice(
    identifiers: ["WEGLD-bd4d79", "HTM-f51d55", "MEX-455c57", "BOBER-9eb764"]
  ) {
    identifier
    candles {
      time
      ohlcv
    }
  }
}

@mad2sm0key mad2sm0key marked this pull request as ready for review September 6, 2024 07:33
@bogdan-rosianu bogdan-rosianu self-requested a review September 6, 2024 07:34
gabrielmatei
gabrielmatei previously approved these changes Sep 6, 2024
src/helpers/helpers.ts Outdated Show resolved Hide resolved
- use regex for numeric string validation
- replace magic numbers with constants
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.

5 participants