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

Adding shadow to dex.trades on sonic #7584

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

Conversation

discochuck
Copy link
Contributor

@discochuck discochuck commented Jan 28, 2025

Well, crap. Honestly, I accidentally pushed this PR to the spellbook when I meant to push it to my fork.

Sorry if it's a cluster f.

Description:

[...]


quick links for more information:

@github-actions github-actions bot marked this pull request as draft January 28, 2025 13:36
@github-actions github-actions bot added WIP work in progress dbt: dex covers the DEX dbt subproject labels Jan 28, 2025
@discochuck discochuck marked this pull request as ready for review January 28, 2025 13:36
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Jan 28, 2025
@Hosuke Hosuke self-assigned this Jan 28, 2025
@discochuck discochuck requested a review from Hosuke January 28, 2025 14:04
@discochuck
Copy link
Contributor Author

It's been so long since I've github'd. Bare with me. I think I accidentally just re-requested you to review something for now reason.

Comment on lines 13 to 31
{{
uniswap_compatible_v2_trades(
blockchain = 'sonic',
project = 'shadow',
version = '1',
Pair_evt_Swap = source('shadow_sonic', 'Pair_evt_Swap'),
Factory_evt_PairCreated = source('shadow_sonic', 'Core_PairFactory_evt_PairCreated')
)
}}

{{
uniswap_compatible_v3_trades(
blockchain = 'sonic',
project = 'shadow',
version = '3',
Pair_evt_Swap = source('shadow_sonic', 'RamsesV3Pool_evt_Swap'),
Factory_evt_PoolCreated = source('shadow_sonic', 'RamsesV3Factory_evt_PoolCreated')
)
}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may need to split this part into 2 spells.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so like shadow_sonic_base_trades_v1.sql and shadow_sonic_base_trades_v3.sql ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll take a look at snipping out the v2 bits since a majority of the volume goes through v3 pools.

and then double back and do another one of these for the v2.

@jeff-dude jeff-dude added in review Assignee is currently reviewing the PR and removed ready-for-review this PR development is complete, please review labels Jan 28, 2025
@jeff-dude jeff-dude marked this pull request as draft January 28, 2025 15:07
@github-actions github-actions bot added the WIP work in progress label Jan 28, 2025
Copy link
Contributor Author

@discochuck discochuck left a comment

Choose a reason for hiding this comment

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

I think that should have done it.

@Hosuke
Copy link
Collaborator

Hosuke commented Feb 1, 2025

If shadow is newly added into dex.trades, then we may need to add it into dex.info as well:
https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/dex/models/dex_info.sql

@@ -0,0 +1,2 @@
blockchain,project,version,block_month,block_date,block_time,block_number,token_sold_amount_raw,token_bought_amount_raw,token_sold_address,token_bought_address,tx_hash,evt_index
sonic,shadow,3,2025-01-01 00:00,2025-01-24 00:00,2025-01-24 14:34,5266265,151051097278346452,900000000000000000000,0x50c42dEAcD8Fc9773493ED674b675bE577f2634b,0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38,0x7b9c8c8eb8d384b892be64f8ce461b20575a327a15a3c64e8b010a3bd0f343a8,0
Copy link
Collaborator

@Hosuke Hosuke Feb 1, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will check it out on Monday!

thx @Hosuke

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like I managed to get the seed sorted, I think.
image

Now I'm stuck on: Failure in test check_dex_info_relationship_dex_sonic_base_trades_
which when I run the associated query: select * from hive.test_schema.git_dunesql_74bbc6d_check_dex_info_relationship_dex_sonic_base_trades_

it returns "shadow" as missing dex info.

Failure in test check_dex_info_relationship_dex_sonic_base_trades_ (models/trades/sonic/_schema.yml)

I thought there was an entry for shadow in the _schema.yml file, but really I'm just out of my depth here.

@discochuck
Copy link
Contributor Author

discochuck commented Feb 6, 2025

smh, whenever I would query the check dex test schema, it looked like I had the bought and sold addresses swapped, so I flipped them:
image

image

using the following as my seed:
--snip
blockchain, sonic
project, shadow
version, 3
block_date, 2025-02-06
tx_hash, 0x7d39202a1e950e05a9005648a3577b6306a1640b9a53ed3db8711bafaf02be03
evt_index, 4
token_bought_address, 0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38
token_sold_address, 0x29219dd400f2bf60e5a23d13be72b486d4038894
block_number, 6758314
token_bought_amount_raw, 250436493
token_sold_amount_raw 538400000000000000000

blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw

sonic,shadow,3,2025-02-06,0x7d39202a1e950e05a9005648a3577b6306a1640b9a53ed3db8711bafaf02be03,4,0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38,0x29219dd400f2bf60e5a23d13be72b486d4038894,6758314,250436493,538400000000000000000
--snip

I'm sure I'm missing something simple/obvious: Any chance @Hosuke could take a peek at it, and see if I'm making some obvious mistake?

@Hosuke
Copy link
Collaborator

Hosuke commented Feb 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbt: dex covers the DEX dbt subproject in review Assignee is currently reviewing the PR WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants