Development resources at your finger tips
Build with the coolest Web3 projects
Recurring funding for Open Source
Learn about Web3 & earn rewards
Show appreciation for each other
Meet fellow developers, designers, futurists and more. Collaborate and BUIDL awesome projects together.
Discover great web3 organizations, work on meaningful projects and build relationships with like minded people. Browse Tribes
Meet the top hunters and contributors from our community.
Hello, Gitcoiners & Gitcoinerettes! It’s happening again – happy blockchain times are coming to San Francisco 🎉, as the San Francisco…
Heya Gitcoiners & Gitcoinerettes! They say that July is the warmest month of the year (location depending), and we’re definitely getting ready fo…
Gitcoin is GDPR complaint. Learn more in
Gitcoin's Terms & Conditions.
Check out the Issue Explorer
Looking to fund some work? You can submit a new Funded Issue here.
This is the first bounty in an upcoming set of bounties focused around building an analytics dashboard for projects that utilize the [standard bounties contract](https://github.com/Bounties-Network/StandardBounties) such as gitcoin, and other upcoming open source sites.
This first task begins the work of exposing endpoints around daily stats for a range of time. Ultimately, these will be used to build a react frontend connected to highcharts or other charting libraries. The data is already stored in PSQL, it just needs to be served up via the format requested below. This task ultimately requires just one endpoint to be built for now.
- endpoint should accept a start and end-date filter - `?publish_date__range=2016-01-01,2016-02-01` format
- Results need to be returned as **daily**. Daily represents 00:00 - 23:59 UTC time. The current day will of course be a partial day.
- endpoint should live in the newly added analytics directory/application - https://github.com/Bounties-Network/BountiesAPI/tree/master/bounties_api/analytics
- Url should be prefaced with /analytics route
- A new model should be introduced. This model should include a date field, along with the names of the requested stats. For now, I only foresee one model being created.
- A management job should be created. This job should be intended to run daily. Don't worry about setting up the scheduling - I'll put that work in after the PR. To see an example job/management command: https://github.com/Bounties-Network/BountiesAPI/blob/master/bounties_api/std_bounties/management/commands/get_token_values.py
- The job should fill in empty dates. For example, if the model and table is newly created and empty, the job should insert records for every day. Basically, the job should do calculations from the latest insertion date, but should not repeat work if the date has already been included.
- The endpoint should be an APIView - similar to these - https://github.com/Bounties-Network/BountiesAPI/blob/master/bounties_api/std_bounties/views.py#L83
- The job should already have the previous days pre-calculated. IT will be expected to run every 5 minutes, and therefore should update the current day's stats.
- This is time-series data! This means, the endpoint should return the values on each stat for each day in-between the range. **IN addition** to the timeseries data - it should also return the aggregates.
- Pep8 compliance required
- The BountyState table in models.py is essential to get the bounty stage data.
- Additionally should be able to filter by the Schema field on the Bounty model
- Total number of bounties issued
- Total number of fulfillments submitted
- Total number of fulfillments accepted
- Total number of fulfillments without acceptance
- Total fulfiller acceptance rate
- Total bounty fulfilled rate
- Average fulfiller acceptance rate
- Average bounty fulfilled rate
- Average fulfillment amount (usd_price)
- Total fulfillment amount
- Number of bounties in each bountyStage (each stage count would be a separate field on the model)
All of the above should be a separate field on one model that the job writes to. These should all be exposed on one api endpoint.
Example Response to `https://api.bounties.network/analytics/stats?publish_date__range=2016-01-01,2016-01-04`
The example response is missing the aggregate response. The aggregate response should include the values over the entire timerange.
## Definition of Done
- All requirements are completed above with the endpoint functional.
Myself and @mbeylin
## Review Requirements
- A WIP pull request along the way with initial progress
- Key questions posted here
- Conversational and longer discussions should be directed to the bounties network slack in this channel: https://bountiesnetwork.slack.com/messages/community-dev