Try   HackMD

Required Queries for the Anti Sybil Workstream

tags: gitcoin Notes

Updated by August 2021

Authors: Danilo Lessa Bernardineli

Input / Output

Input

  • A table where each row represents independent and valid contributions. Required fields:

    • contrib_id (PK)
    • created_on (timestamp)
    • match (bool)
    • user_handle (FK, string)
    • amount_in_usdt (float)
    • token_unit (string)
  • A table where each row represents Gitcoin user handles. Required fields:

    • user_handle (PK, string)
    • github_created_at (timestamp)
    • github_updated_at (timestamp)
    • github_public_repos_count (int)
    • github_followers_count (int)
    • github_following_count (int)
    • github_bio_length (int)

Queries


/*
Obs: normalized_data must contains the following fields:
- grant_id, user_handle, created_on, token_symbol, last_known_ip, amount_per_period, amount_per_period_usdt,
  amount_per_period_minus_gas_price
*/

select
    grants_contribution.created_on, 
    grants_contribution.profile_for_clr_id AS user_id, /* user id */
    grants_contribution.match, /* CLR match is on or off */
    grants_contribution.normalized_data /* JSON string */
from grants_contribution
/*
Collect any user stat, like Github profile info
*/
/* Retrieve */