Skip to content

Commit

Permalink
docs/gitcoin-social-graph
Browse files Browse the repository at this point in the history
  • Loading branch information
ccerv1 committed Dec 18, 2024
1 parent 32b0720 commit a5d16c6
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions apps/docs/docs/tutorials/gitcoin-social-networks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Funding in a Social Network
sidebar_position: 5
---

Analyze Gitcoin grants funding in a social network. New to OSO? Check out our [Getting Started guide](../get-started/index.md) to set up your BigQuery or API access.

This tutorial combines Farcaster and Gitcoin data to to identify popular projects within a social network.

## BigQuery

If you haven't already, then the first step is to subscribe to OSO public datasets in BigQuery. You can do this by clicking the "Subscribe" button on our [Datasets page](../integrate/datasets/#oso-production-data-pipeline). For this tutorial, you'll need to subscribe to the Gitcoin and Karma3/OpenRank datasets. (You can also use the Farcaster dataset in place of OpenRank.)

The following queries should work if you copy-paste them into your [BigQuery console](https://console.cloud.google.com/bigquery).

### Identify popular projects within your social network

```sql
select distinct
donations.donor_address,
users.user_source_id as fid,
users.user_name as username,
donations.project_name,
amount_in_usd,
timestamp
from `gitcoin.all_donations` as donations
join `oso_production.artifacts_by_user_v1` as users
on lower(donations.donor_address) = users.artifact_name
where
user_source = 'FARCASTER'
and users.user_source_id in (
with max_date as (
select max(date) as last_date
from `karma3.localtrust`
)
select cast(j as string) as fid
from `karma3.localtrust`
where i = 5650
order by v desc
limit 150
)
```

0 comments on commit a5d16c6

Please sign in to comment.