econia-labs / econia

Hyper-parallelized on-chain order book for the Aptos blockchain
https://econia.dev
Other
134 stars 47 forks source link

[ECO-1684] fix 24h price when missing #772

Closed CRBl69 closed 3 months ago

CRBl69 commented 3 months ago

Description

This PR fixes the 24h price and everything related to this field in the /markets endpoint.

Currently, when there has been no price in the last 24 hours, the last price will be used, no matter when it happened.

This is not expected behaviour.

If there was no activity in the last 24 hours, last_fill_price_24hr, price_change_as_percent_24hr, price_change_24hr should be null. This PR fixes that.

Checklist