Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Add the /v1/history/stats endpoint to the API, use it to display the area chart of liquidity-depth-over-time #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

npny
Copy link

@npny npny commented Dec 17, 2020

Liquidity Depth Over Time

Things of note:

  • totalRuneDepth is the data field being plotted, hope that's the relevant one
  • This is usually a huge number (e.g. 1230166579915691) and the tooltips look wonky. Highchart has options to help with that (unit suffix / thousands separator), but they're global and would interfere with other charts. We can probably work something out manually in the formatLabel helper though.
  • Hitting /v1/history/stats on 138.201.80.182 (testnet IP) we get a Not found response ; this new endpoint is only implemented on the chaosnet IP, it would seem. I've added an extra branch to handle it.
  • The duration of the time range we choose to render pretty much has to be set in stone, as we need to retrieve it successfully from the cache later. Not fixing the range would mean handling arbitrary retrieval from the cache which probably means something like storing every possible start/end combination. Not a good idea. I've fixed it to 12 days for now but this can be tweaked.

@npny npny requested a review from lukesaunders December 17, 2020 14:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant