Skip to content

Fix: typos #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contribute/contribute-to-flipside-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ See [How to Add Tags](../our-data/featured-tags-and-sql-examples/how-to-add-your

### SQL Models

The Flipside community uses [dbt](https://www.getdbt.com/) to model data in a [Snowflake](https://www.snowflake.com/) database. The following page on our [Analytics Stack for Community Curation](broken-reference) will go into further depth about the tech stack. If you are familiar with these tool, skip to [Getting Started](getting-started/) for instructions on access and setting up your dev environment.
The Flipside community uses [dbt](https://www.getdbt.com/) to model data in a [Snowflake](https://www.snowflake.com/) database. The following page on our [Analytics Stack for Community Curation](broken-reference) will go into further depth about the tech stack. If you are familiar with these tools, skip to [Getting Started](getting-started/) for instructions on access and setting up your dev environment.

#### What and why?

Expand Down
4 changes: 2 additions & 2 deletions contribute/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

Community curators are granted access to a dev environment for testing and development of a data model. A member of Flipside's analytics team will need to grant you access, so please ask in the [# 🌲 | community-curation](https://discord.com/channels/784442203187314689/1053086214615466095) channel on Discord something along the lines of:

> Hi , I’m interested in doing data curation for Flipside, could you give me snowflake access please? I’d like my username to be: `community_<insert_username>`
> Hi, I’m interested in doing data curation for Flipside, could you give me snowflake access please? I’d like my username to be: `community_<insert_username>`

{% hint style="warning" %}
Access to Snowflake is granted for the sole purpose of community curation and testing your models. This password is not to be shared with anyone. If you know someone who would like to contribute as well, we will credential them separately. If you would like to work with Flipside data in a Snowflake environment, please see the section on [Data Shares](broken-reference) and reach out separately.
{% endhint %}

### **dbt cloud \[Optional]**

If you are unfamiliar with dbt, we suggest creating a free account to [dbt Cloud](https://cloud.getdbt.com/). dbt Labs has built an IDE for developing dbt models. Once the environment is set up with the proper credentials, connect to a fork of the [model repository](https://github.com/orgs/FlipsideCrypto/repositories) to begin editing or building you own. The cloud environment includes the option to preview the compiled SQL models so you can see output as you work. Additionally, the command line for running dbt includes built-in autocomplete for common dbt commands.
If you are unfamiliar with dbt, we suggest creating a free account to [dbt Cloud](https://cloud.getdbt.com/). dbt Labs has built an IDE for developing dbt models. Once the environment is set up with the proper credentials, connect to a fork of the [model repository](https://github.com/orgs/FlipsideCrypto/repositories) to begin editing or building your own. The cloud environment includes the option to preview the compiled SQL models so you can see output as you work. Additionally, the command line for running dbt includes built-in autocomplete for common dbt commands.

{% hint style="info" %}
Note: if you are using dbt Cloud, you will need to fork the main repository and link your dbt Cloud environment to the fork.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Whenever you try to answer a complicated question like this, you're going to hav
If you haven't gone through the [Getting Started with Ethereum Events](https://app.gitbook.com/getting-started-with-ethereum-events) guide or worked with labels in the [Using Labels to Break Down Token Supply](using-labels-to-break-down-token-supply.md) guide, yet, we recommend you do that first.
{% endhint %}

Let's start by look at ETH movement into exchanges for a week in October 2020.
Let's start by looking at ETH movement into exchanges for a week in October 2020.

```sql
SELECT
Expand All @@ -40,7 +40,7 @@ In this query, we:
* select label type and subtype because we don't always know which level we need at first
* filter `native_eth` transfers only

Each day give us results that look like this:
Each day gives us results that look like this:

| Date | To Label Type | To Label Subtype | Total Inflow |
| ------------------- | ------------- | --------------------------- | ------------ |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SELECT
amount_usd
FROM ethereum.erc20_balances
WHERE
-- the user address is the Curve Liquidty Pool
-- the user address is the Curve Liquidity Pool
user_address = '0xa5407eae9ba41422680e2e00537571bcc53efbfd' AND
-- the contract address is the USDC proxy contract
contract_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' AND
Expand Down Expand Up @@ -61,6 +61,6 @@ WHERE
Two things to note from this query:

1. Instead of entering the `user_address` directly, we leveraged Flipside's label to get at the Maker Gem Join contract.
2. Similar to the first point, instead of using the USDC contract address we use the`symbol` here. This symbol has been whitelisted to avoid collision.&#x20;
2. Similar to the first point, instead of using the USDC contract address we use the `symbol` here. This symbol has been whitelisted to avoid collision.&#x20;

From here, I encourage you to explore TVL on other platforms such as Balancer, UniSwap, or Aave.&#x20;
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ We accessed the SOURCE value by using colons _and brackets_:
```sql
inner_instruction:instructions[0]:parsed:info:source
--use colons ':' to select nested fields in JSON structure
--the 'instructions' field contains an array enclosed in brakets [...]
--the 'instructions' field contains an array enclosed in brackets [...]
--so we use [0] to access the 1st element in that array
```

Expand Down Expand Up @@ -312,7 +312,7 @@ Is this a staking deposit transaction? Our query would have missed it because we
```sql
inner_instruction:instructions**[0]**:parsed:info:source
--use colons ':' to select nested fields in JSON structure
--the 'instructions' field contains an array enclosed in brakets [...]
--the 'instructions' field contains an array enclosed in brackets [...]
--so we use [0] to access the 1st element in that array
```

Expand All @@ -336,7 +336,7 @@ This time we get 88 rows and we check a few more transactions on Solscan like [t

This transaction had a token transfer coming from ‘7GpPYj...’ but we don’t see Marinade Finance listed anywhere in the programs... ! What are these other programs? Are they also creating staking transactions?

After more digging and thinking we decided see the first program above doesn’t transfer any mSOL, so it can’t be a deposit, but the second program ‘mRefx8...’ _does_ contain a deposit. It turns out that if we [search Github for that program](https://github.com/search?q=mRefx8ypXNxE59NhoBqwqb3vTvjgf8MYECp4kgJWiDY\&type=code) we find evidence it’s connected to [Marinade’s Referral Program](https://docs.marinade.finance/partnerships/referral-program) — aha! We conclude users are in fact making staking deposits into Marinade here, but through the referral program, and we probably should include these in a thorough analysis of Marinade staking deposits.
After more digging and thinking we decided to see the first program above doesn’t transfer any mSOL, so it can’t be a deposit, but the second program ‘mRefx8...’ _does_ contain a deposit. It turns out that if we [search Github for that program](https://github.com/search?q=mRefx8ypXNxE59NhoBqwqb3vTvjgf8MYECp4kgJWiDY\&type=code) we find evidence it’s connected to [Marinade’s Referral Program](https://docs.marinade.finance/partnerships/referral-program) — aha! We conclude users are in fact making staking deposits into Marinade here, but through the referral program, and we probably should include these in a thorough analysis of Marinade staking deposits.

## Conclusion & Takeaways

Expand Down