Git Product home page Git Product logo

data-feeds-explorer's People

Contributors

aesedepece avatar aeweda avatar gabaldon avatar guidiaz avatar mariocao avatar tmpolaczyk avatar tommytrg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

data-feeds-explorer's Issues

Leverage MongoDB indexes for speeding up the app

MongoDB really shows a huge boost in performance when indexes are properly defined over collections.

Take this query as an example:
https://github.com/witnet/data-feed-app/blob/a9d6058994f3036ef064b18d0a902ca826f77a77/packages/api/src/repository/Feed.ts#L21-L27

Unless address is defined as an index, every time this query is executed, it needs to crawl the entire feed collection, and execute the filter on every each of the entries it finds there.

Ok that's not big of a concern, because we won't have a thousand feeds anyway. But look at this other example:

https://github.com/witnet/data-feed-app/blob/a9d6058994f3036ef064b18d0a902ca826f77a77/packages/api/src/repository/ResultRequest.ts#L21-L32

Unless feedId is defined as an index, this really needs to iterate over the entire result_request collection, which even this early, probably contains hundreds if not thousands of entries already.

So, as a rule of thumb, we should make sure that we create indexes for every field in a collection that can be subject of being used for filtering in a query.

Indexes are often created using the MongoDB console. Indexes for these examples can be easily created like this:

db.feed.createIndex( { address: 1 } )
db.result_request.createIndex( { feedId: 1, timestamp: -1 } )

(Note that the result_request index not only covers the feedId attribute that will be used for filtering, but also the timestamp field that will be used for sorting. This is specially convenient and efficient, as it leverages the fact that indexed collections are stored by WiredTiger in a sorted order, so no in-memory sorting is needed that way.)

Check all feeds upon starting

Every time the app restarts, feeds are scheduled to be checked for updates after their configured period.

This makes it quite difficult to check whether a specific price feed is being correctly read from,

It would be really nice to immediately check for updates upon starting the service. That is, adding a setTimeout in addition to the setInterval.

To avoid overload, a small random delay can be added to each of the different feeds.

Read configuration from github file

To avoid update the configuration every time a change is made in the feeds configuration, we can read the configuration file directly instead of update by hand

Add new feeds

  • Update contract methods to get the timestamp and the transactionHash

  • Add new deployed feeds in the config file

  • Add new feeds SVG if necessary

Chart assumes that all data points are equidistant

The current implementation of the data feed charts uses the data point index instead of the date. This results in an incorrect time scale, because some days are missing and some days are duplicated. For example, in this screenshot you can see that it goes 22, 23, 25, 25, 26:

Captura de pantalla de 2021-07-27 12-11-17

There are two data points in day 25, and their dates are:

1 day 22 hrs ago link
2 days 8 hrs ago link

They differ by 10 hours, but in the chart the points are drawn the same distance apart, as if they were 24 hours apart. The same happens in days 17 and 19.

The expected behavior would be to draw the points using the full date, so that any gaps can be clearly seen in the chart.

Remove XAU feeds

We won't be polling XAU feeds anymore. Please remove from default feeds config file.

Use config file for defining data feeds

It would be nice to have a config file (e.g. json) with all data required for defining data feeds (instead of the dataFeeds.ts).
The main goal is to avoid having to re-build the docker images for adding new data feeds.

Additionally, and most probably it should be another issue, it would be nice to show only those price feeds that are included in that json file. For example, to remove some old data feed that was stored into the database but that is not working anymore.

Rename repo and product as witnet data feed explorer

Discussed in #7

Originally posted by aesedepece June 7, 2021
We may need to get on the same page on the naming of this product and repo, before it's too late and we get used to something not so catchy.

For those who don't know, this repo contains the source code for the front end and back end of a little website that will allow smart contract developers to discover different publicly available data feeds on multiple chains. Initially, these feeds may be operated by Witnet Foundation, but there's no reason for listing feeds created by others.

Data Feeds Explorer redesign

Redesign website to have a better UX.

  • Create Witnet Data Feeds Explorer logo
  • Implement design for filtering feeds
  • Implement design for the main view

Add Conflux feeds

Update conflux addresses and add them to the config json file. It is also needed to find a way to make it work without running locally the gateway.

Add Etherscan link to price feed data

It would be nice to have the etherscan link of the data feed price data, so that the user could check the Ethereum transaction in which the data point was reported.

Fix price feeds decimals

Depending on the price feed itself, data request might be designed to use integers with a factor (to provide precision). Then, data feed explorer should show that information accordingly with decimals.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.