Skip to content
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

Alw joe v2 data #529

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Alw joe v2 data #529

wants to merge 6 commits into from

Conversation

alexwes
Copy link
Contributor

@alexwes alexwes commented Oct 6, 2024

PR Objectives:

  • Create an ez_metrics table that can be used in the outerlands index so as to not require additional logic to handle ez_metrics_by_chain
  • Add all of the Trader Joe v2.0, 2.1, 2.2 metrics to the pipeline

Outcome:

  • ez_metrics table is created, and works with the outerlands index logic, and has all versions data
  • 'ez_metrics_by_chain' largely unchanged (added some coalesce)
  • ez_metrics_by_chain does not include v2.0, 2.1, 2.2 data as we were missing v2.0, 2.1, 2.2 TVL by chain. Adding the rest of the v2+ metrics (dau, txns, fees) but not TVL would have resulted in a more confusing experience for the end user, especially Snowflake Share users and users of the sectors dashboard. Defillama does support TVL data for these protocol versions, but does not offer a 'by chain' breakdown, making it impossible to add to the ez_metrics_by_chain.

Next steps would be to get Trader Joe TVL for v2+.

daily_trader_joe_job runs successfully, materializing ez_metrics + by_chain tables.
Screenshot 2024-10-05 at 9 24 00 PM

@alexwes alexwes requested a review from a team as a code owner October 6, 2024 01:24
Copy link
Contributor

@SebMelendez01 SebMelendez01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change

Comment on lines +1 to +12
{{
config(
materialized="table",
snowflake_warehouse="TRADER_JOE",
database="trader_joe",
schema="core",
alias="ez_metrics",
)
}}

with
v2_tvl as (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add a comment in the ez_metrics... about the differences in the ez_metrics_by_chain and the ez_metrics model. If I remember from our convo ez_metrics_by_chain does not include the v2 or greater data?

can you also add a note in ez_dex_swaps?

@alexwes alexwes marked this pull request as draft October 24, 2024 22:03
@alexwes
Copy link
Contributor Author

alexwes commented Oct 24, 2024

Converting this PR to draft.

Reasoning goes as follows:

  1. Realized the barn.traderjoexyz.com API was returning an error
  2. Turns out you can only pull data in 180 intervals
  3. This led me to rewrite the API extraction logic
  4. We were pulling data from the API for what we believed to be v2.0 of the protocol.
  5. On validating the data I realized that the API data looked very similar to the onchain data we had pulled for v2.1 and v2.2
  6. After playing around with the data with Kyle for a bit we realized it was the exact same!
  7. Learning: The API rolls up v2.1 + v2.2 into one endpoint.
  8. Defillama also leverages TheGraph to pull v2.0 data it seems (Github)
Screenshot 2024-10-24 at 6 06 32 PM

We also learned that v2.0 Factory contract address has been made publicly available in the docs. This was new.

Next steps are to remove the API extract logic and pull the data for v2.0 from the chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants