tdex-network / tdex-analytics

Analytics and Historical data feed about TDEX Network
MIT License
0 stars 6 forks source link

5 minutes Custom Period #49

Closed andreazllin closed 1 year ago

andreazllin commented 1 year ago

I am encountering this error when calling tdex-analytics /marketsPrices INTERNAL: timeFrame must be smaller than timePeriod

This is the request that fails:

{
  "time_range": {
    "custom_period": {
      "end_date": "2022-11-08T09:16:35.600Z",
      "start_date": "2022-11-08T09:11:35.600Z"
    }
  },
  "market_ids": [
    "1", 
    "2",
    "3", 
    "4",
    "5",
    "6"
  ],
  "reference_currency": "usd",
  "page": {
    "page_number": 0,
    "page_size": 20
  },
  "time_frame": 0
}

timeFrame is 0 so it should be TF_NULL

From what I've been told tdex-analytics uses internally uses nil = 5 minutes, so the error is thrown when timeFrame is grater than or equal to timePeriod, in this case customPeriod, 5 minutes

altafan commented 1 year ago

cc @sekulicd