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

MarketsPrices broken? #53

Open
altafan opened this issue Jan 18, 2023 · 0 comments
Open

MarketsPrices broken? #53

altafan opened this issue Jan 18, 2023 · 0 comments
Assignees

Comments

@altafan
Copy link
Contributor

altafan commented Jan 18, 2023

I'm calling the MarketsPrices API for a lbtc/vusd market on testnet at stage-tdex-analytics.xdex.ch:443 with different time ranges and I get some weird responses:

  • if I get the prices for the last hour, the response seems to be correct, ie. the market price every 5 mins which is the default time frame, i suppose:
    • request
      {
          "time_range": {
              "predefined_period": 1
          },
          "market_ids": [
              "6607"
          ],
          "reference_currency": "USD",
          "page": {
              "page_size": 290
          },
          "time_frame": 0
      }
    • response
      {
          "markets_prices": {
          "6607": {
            "market_price": [
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:00:21.41352031 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:05:21.472499328 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:10:21.445790611 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:15:21.450190086 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:20:21.404057357 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:25:21.457433661 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:30:21.431591077 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:35:21.432678658 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:40:21.423510002 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:45:21.438101531 +0000 UTC"
              },
              {
                "base_price": 0.0000264,
                "quote_price": 37876.81377257,
                "base_reference_price": 1,
                "quote_reference_price": 37876.81,
                "time": "2023-01-18 10:50:21.40380974 +0000 UTC"
              }
            ]
          }
        }
      }
  • if, instead, I get the prices for the last day with a time frame of 1 hour, the response looks strange, because i have all frames with 0 prices but the very last one (the one for the last hour):
    • request
      {
          "time_range": {
              "predefined_period": 2
          },
          "market_ids": [
              "6607"
          ],
          "reference_currency": "USD",
          "page": {
              "page_size": 290
          },
          "time_frame": 1
      }
    • response
      {
        "markets_prices": {
          "6607": {
            "market_price": [
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 12:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 13:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 14:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 15:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 16:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 17:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 18:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 19:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 20:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 21:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 22:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-17 23:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 00:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 01:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 02:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 03:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 04:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 05:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 06:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 07:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 08:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 09:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 10:00:00 +0000 UTC"
              },
              {
                "base_price": 0.000026399999999999995,
                "quote_price": 37876.81377257,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 11:00:00 +0000 UTC"
              },
              {
                "base_price": 0,
                "quote_price": 0,
                "base_reference_price": 0,
                "quote_reference_price": 0,
                "time": "2023-01-18 11:21:46 +0000 UTC"
              }
            ]
          }
        }
      }

We should investigate if this is a bug of the analytics service or it's just due somehow to the market conditions in the past.

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

No branches or pull requests

2 participants