fixed

Dex TWAP/VWAP Asset Endpoints

2024-04-30

Our team identified an issue with

where the value of the vwap and twap property in the response was not idempotent across different startDate and endDate ranges specified by the user. This was due to the query parameter lookbackPeriod not being correctly processed as part of the API request

  {
    "timestamp": "2024-04-29 18:28:00 000",
    "asset": "0x6b175474e89094c44da98b954eedeac495271d0f",
    "price": "0.000315066012223303",
    "volume": "7167.165322",
    "twap": "0.000315527384310591" <<<< was not idempotent because the lookbackPeriod was not respected
  }
{
  "timestamp": "2024-04-29 18:31:00 000",
  "asset": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "price": "0.000315244320114407",
  "volume": "2884.77138678206330624",
  "vwap": "0.000315438203696871" <<<< was not idempotent because the lookbackPeriod was not respected
}

This issue has now been resolved. For a given lookbackPeriod, default or user-specified, the values of vwap or twap will be the same regardless of the startDate and endDate range. The value of vwap or twap is ONLY affected if the value of lookbackPeriod is changed by the user.