Roberto Henríquez Perozo
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Data Pipeline v2: Polywrap Success Metrics ## Overview From a [previous engagement](https://snapshot.org/#/polywrap.eth/proposal/0x0ca9f1afac429f81d8c77205d2c386231800313bff198cf3553e56200e22fafc) we have developed a polywrap data lake, which caches data from github, npm, twitter, discord, discourse and more. [(link to repo)](https://github.com/polywrap/data_pipeline) From this engagement it was planned: > In the future, we may wish to set up a data transformation pipeline that queries raw data from the data lake and transforms it into a state that facilitates analysis. I would like to propose using the data lake to create an SDK and a better dev environment, that can help us better answer the status of key metrics like Polywrap's user base, bugs reported, and more utilities like the user profiles of the willing members where we would be able to see a detail of their contributions to the ecosystem. ## How can this be created? Whithin the same data pipeline repo we can iterate on the prototype to create the SDK, this can pe published to `pip`, and we can use that locally. Additionally we can use this in a Google Colab environment. Further down the road, when we have the desired metrics accessible, we could create a new subdomain in the to display the data (i.e.: data.polywrap.io/profiles) # Roadmap ## 1. Set out data to collect: Begin with some preliminary internal research with interviews with Polywrap team members, and set some improvement areas we could potentially add to the data pipeline experience: Structure: - Storing the data as tables helps for easier maintenance and avoid duplications. S3 is an unstructured database and our data is natively structured. - Build an SDK for easier interaction Objectives: - Creating interfaces for what data we can track - Tracking two types of metrics: Development oriented and Community oriented. ### **Development Oriented** | Category | question | answer | | -------- | -------- | -------- | |Users| How many users does polywrap have? | `users.total` SDK endpoint | |Users| How many "internal contributors" does polywrap have? | `users.internal_total` SDK endpoint | |Users| How many "community contributors" does polywrap have? | `users.community_total` SDK endpoint | |Users| What are the contributor data structure?| `users.Contributors` data structure in the SDK returns a samble user table | |Users| What contributions are we measuring per user?|`users.Contributors.Contributions` data structure in the SDK | |Users| Who are the N top contributors, month over month?| `users.top_contributors(N)` SDK endpoint| |Users| Who are the N newest contributors?| `userst.newest(N)` SDK endpoint | |npm| How many npm downloads, month over month? |`npm.downloads` SDK endpoint| |npm| How many npm releases, month over month? |`npm.releases` SDK endpoint| |github| What is the speed of PRs getting closed from the repos we are tracking/whitelisting? |`github.PR_speed` SDK endpoint| |github| How many times have the whitelisted repos been cloned over time? |`github.clones` SDK endpoint| |github| How many bugs have been reported by external contributors? | `github.external_bugs` endpoint for bugs that have been reported and labeled in github | |github| How many interactions (clones, forks, stars, etc) have whitelisted repos over time? |`github.interactions` SDK endpoint| |github| How many times has the client.invoke() been called? |`github.invokes` SDK endpoint| |github| How many times has the client.subinvoke() been called? |`github.subinvokes` SDK endpoint| |github| Status of the WASM test harness over time? |`github.wasm_test_harness` SDK endpoint| |github| What is the status of the client test harness over time? |`github.clients_test_harness` SDK endpoint| |wrappers.io| how many wrappers are being publshed, month over month? |`wrappersio.published` SDK endpoint `published` wrappers published. Use [this endpoint](https://ipfs.wrappers.io/pins?json=true). | |wrappers.io| how many wrappers of each WASM language are being published, month over month? |`wrappersio.languages` SDK endpoint| |wrappers.io| how many wrappers of each version are being published, month over month? |`wrappersio.versions` SDK endpoint| |wrappers.io| What are the sizes of the wrappers we that are being published? |`wrappersio.wrapper_sizes` SDK endpoint| ### **Community Oriented** | Category | question | answer | | -------- | -------- | -------- | |Discord| How do the various languages channels activity compare over time?|`discord.languages`| |Discord| How do Dev channels activity compare over time? |`discord.development`| |Twitter| How was Followers growth over time? |`twitter.Followers`| |Twitter| How was Mentions growth over time? |`twitter.Mentions`| |Twitter| What does Aggregated interactions growth over time look like? |`twitter.interactions`| |Twitter|What does reach growth look like over time?|`twitter.reach` meassuring impressions | |Analytics| What is the number of landingpage views over time?|`analytics.pageviews`| |Analytics| What are the top N most viewed pages from polywrap.io?|`analytics.top_pages(N)` | |Analytics| Which are the most popular countries visiting polywrap.io?|`analytics.countries(N)`| ## 2. Develop the Python SDK Today, the process to access the data pipeline is cumbersome, involving Amazon IAM signups and a SageMaker service instead of a simple local Jupyter Notebook or Google Colab that is free, quicker to start up and to share among the team. The data initiative leader has to manually prepare these reports and share them with the audience. To reduce friction, it has been suggested to: - Create an SDK for more easily accessing the data pipeline that can: - [ ] Download data from S3 locally and experiment with it. - [ ] Querying data from polywrap ethereum wrappers and the python client. - [ ] Set up a google colab shared folder which uses the SDK and allows online analysis with less friction than Amazon Sagemaker. - Also we should be able to add a CI/CD implementation for workflows that are tedious and need automation if they havent been developed already: - [ ] Re-run the graph constantly and publish somewhere (Last Jupyters were updated on 9 months ago) [One alternative](https://cloud.google.com/scheduler) is scheduled google colab runs, 3 cronjobs per month costs 10 cents per month. # Working on Deliverables - [ ] **The SDK** could have multiple modules: - [ ] `Enricher Module`: for collecting the data and adding it to `S3`. To stop having the implementations live within the `AWS Lambda` service as much as possible - [ ] `Fetching Module`: for querying AWS Athena to retrieve the data from `S3` using `boto3` module - [ ] `Analytics Module`: for processing the data to prepare for analysis. This would be part of the developed SDK and later be leveraged by Jupyter notebooks functions. This would process the data and create new metrics from the tables mentioned at the beginning of this proposal. - [ ] `Colab`:we could also use it in notebooks, like in Google colab, and in either a front end dashboard written in python or in a python back end that supports a js front end ### Polywrap Data SDK | Milestone | Description | cost | | -------- | -------- | -------- | | Enrichment | Refactoring existing S3 data loading and add it to the SDK | | | Fetching | Using Athena service to query S3 buckets through the SDK | | | Fetching v2 | Using the polywrap python client to query Ethereum instead of the current 3rd party module | | | Analysis | Compiling the various analytics functions that exist today | | | Analysis v2| Adding the new functions to make more indepth metrics available | | | `pip` deployment | publish the package (similar to `npm`)| |*subtotal*||*$2750*| ### Google Colab Polywrap Setup | Milestone | Description | cost | | -------- | -------- | -------- | | Colabs setup | Set up a comfy Google Colab environment for data analytics that leverages the SDK | | |*subtotal*||*$350*| ### CI/CD & Tests | Milestone | Description | cost | | -------- | -------- | -------- | |Code styling| Set up CICD for the SDK | | |Code styling| Set up tests for the SDK | | |Code styling| Set up basic lint, styling scripts to verify code quality| | | Update Data | Auto-running the lambdas every X days to keep the data available updated ()| | |*subtotal*||*$1100*| ### Documentation | Milestone | Description | cost | | -------- | -------- | -------- | | Demo Video| Overview video tutorial covering all functionality of the SDK and how to make inferences and graphics. | | |*subtotal*||*$250*| ## TOTAL Funds Requested 4450 USDC and TBD WRAP ## Velocity & Estimated Timeline The numbers below are a rough estimates, and will change throughout the course of the project depending on the phase | Target Weekly Velocity | Estimated Start | Estimated Duration | | --- | --- | --- | | ~10-20 Hours/Week | 1-Jan-23 | ~3 Months | ## Sponsors - Kris - Kevin ## Terms By submitting this proposal, I understand that the DAO and my sponsors will be evaluating whether my work meets the acceptance criteria. If it does not, the DAO will determine what percentage of the proposal cost to pay, if any. I also understand that I may not begin work until it is confirmed that the Snapshot proposal has passed. [ X ] I agree --- # Appendix: ## Example Data structure for Committed Contributors To get to a similar data structure than this, some data wrangling is necessary, as user data is not linked like this yet anywhere, but having such arrangements can be leveraged very much in the immediate and long term: ```json id: 321, eth: { address: '0xasdb2138901238', WRAP: 23, PolywrapNFTs: 2, snapshot: { proposals_submitted: 3, proposals_voted : 20, } } github: { username:'rihp', commits:, pull_requests: { open: 1, closed: 2, merged: 10} issues: { assigned: { open: 0, closed:20, } } }, discord: { username:'Media#1337', }, discourse: { username: 'DaoAdvocate', comments: 230, threads: 2, }, twitter: { username: 'DaoAdvocate', verified: false, follows_polywrap: true, polywrap_mentions: 2, followers: 200, } ``` This could also help track users which have interest in polywrap but are not developers (for example, if they mention polywrap on twitter) This is a mocked dataframe of generated user data, which we can use to prepare the pipeline's next step. ![](https://i.imgur.com/gBAQ1ys.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully