Skip to content

Add a view for Proxy TON addresses #8522

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

Merged
merged 2 commits into from
Jul 23, 2025

Conversation

shuva10v
Copy link
Contributor

Thank you for contributing to Spellbook 🪄

Please open the PR in draft and mark as ready when you want to request a review.

Description:

[...]


quick links for more information:

@github-actions github-actions bot marked this pull request as draft July 23, 2025 08:20
@github-actions github-actions bot added WIP work in progress dbt: daily covers the Daily dbt subproject labels Jul 23, 2025
@dune-eng
Copy link

Workflow run id 16465389274 approved.

@dune-eng
Copy link

Workflow run id 16465388904 approved.

@dune-eng
Copy link

Workflow run id 16465388895 approved.

@shuva10v shuva10v force-pushed the feature/ton_proxy branch from c9deb04 to 027641a Compare July 23, 2025 09:14
@dune-eng
Copy link

Workflow run id 16466556063 approved.

@dune-eng
Copy link

Workflow run id 16466556030 approved.

@dune-eng
Copy link

Workflow run id 16466556333 approved.

@shuva10v
Copy link
Contributor Author

Data quality checks:

No new entries in ton.prices_daily

select count(1) from (
select token_address, timestamp, asset_type, substring(cast(price_ton as varchar), 1, 10) from   test_schema.git_dunesql_f37042e_ton_jetton_price_daily 
except
select token_address, timestamp, asset_type, substring(cast(price_ton as varchar), 1, 10) from ton.prices_daily 

) t

Missing from old ton.prices_daily

select token_address, count(1) from (
select token_address, timestamp, asset_type, substring(cast(price_ton as varchar), 1, 10) from ton.prices_daily 
except
select token_address, timestamp, asset_type, substring(cast(price_ton as varchar), 1, 10) from   test_schema.git_dunesql_f37042e_ton_jetton_price_daily 

) t
group by 1

only two proxy ton addresses:

token_address _col1
0:671963027F7F85659AB55B821671688601CDCF1EE674FC7FBBB1A776A18D34A3 301
0:8CDC1D7640AD5EE326527FC1AD0514F468B30DC84B0173F0E155F451B4E11F7C 901

tokens_ton.net_transfers_daily check:

select blockchain, block_date,
td_orig.net_transfer_amount_usd as amount_orig, 
td_fix.net_transfer_amount_usd as amount_fix
from tokens_ton.net_transfers_daily td_orig
full outer join 
test_schema.git_dunesql_f37042e_tokens_ton_net_transfers_daily td_fix using(blockchain, block_date)
where td_orig.net_transfer_amount_usd is null or td_fix.net_transfer_amount_usd is null
or abs(td_orig.net_transfer_amount_usd - td_fix.net_transfer_amount_usd) / (td_orig.net_transfer_amount_usd + td_fix.net_transfer_amount_usd) > 0.01

tokens_ton.net_transfers_daily_asset check:

select blockchain, block_date,contract_address,
td_orig.net_transfer_amount_usd as amount_orig, 
td_fix.net_transfer_amount_usd as amount_fix
from tokens_ton.net_transfers_daily_asset td_orig
full outer join 
test_schema.git_dunesql_f37042e_tokens_ton_net_transfers_daily_asset  td_fix using(blockchain, block_date, contract_address)
where td_orig.net_transfer_amount_usd is null or td_fix.net_transfer_amount_usd is null
or abs(td_orig.net_transfer_amount_usd - td_fix.net_transfer_amount_usd) / (td_orig.net_transfer_amount_usd + td_fix.net_transfer_amount_usd) > 0.01

there are some discrepancies but after manual check it is legit:

blockchain block_date contract_address amount_orig amount_fix
ton 2025-06-17 00:00 0:752EEC0DD88647BE9BC03E76309ED8F4406B9BA164A864EFADEE45F506BA64BF 388267.93567976425 115460.70069908381
ton 2025-06-05 00:00 0:7CCEEE8A4565B64C6E809A3C5177992041764BEDB8BBF89CC10484A9C76A7147 52540.30085276632 41426.00153370014
ton 2025-05-29 00:00 0:EF14B0C7D4C76CAF7D2812A0FADB29E74845ED179C6EDBE2D0E7FF1E368DCF31 23594.548657916526 21435.146336596477
ton 2025-06-23 00:00 0:0CA5C66ACC16032F8ABFB96980E334B8D93681BB58A9E1B8C053B791616DFAA9 15714.756198335113 9675.57416814063
ton 2025-06-25 00:00 0:90781A60AF4A74B97B2630B2E4BD5F4301738B004F6EE772D12790C581ED884A 15039.719092134723 13711.802903866284
ton 2025-07-05 00:00 0:249C256E6339FCDE425316D81F5AD5E71BAF44CA133A8A3C2968304D612A54CB 12218.52626354939 7477.494008253444
ton 2025-06-12 00:00 0:D9550482453F1247EDB4140ECD223196E599E5BBEC7A5054B77847C6D05947E3 12064.733770450799 8269.822343637295
ton 2025-06-04 00:00 0:97B87054139C7D67EED9A6D905847F2E8630707216D9DA8EF1585057DC79AD84 11780.577700126947 7181.666573550432
ton 2025-06-27 00:00 0:723268F6C4F12E278FEC918F0FD87AD30D195FB8BBEEF358C8DC8319037ED852 11632.36257238616 8906.27926220472
ton 2025-06-10 00:00 0:6F7E96AC7FCD9A010524746641B80C65714477025EEF6354FB89F0BA5170279E 10466.082511185896 9144.747211552462
ton 2025-05-27 00:00 0:615741C0380F1B09D009E0F45A49E82E736FED600677AAA464AD880FC29F6501 9906.744675808466 9356.82207800698
ton 2025-06-17 00:00 0:73AC32B2095BAFDF3F9892C0C832EC9B975353CDFD89789E23B246808E2EA647 9628.983169000016 9108.679788955715
ton 2025-05-24 00:00 0:2E561BB0566A8DEDC8ECC8AC018576B266BD6F23C1011B53B2C87D5C7A23D2D4 7799.601897835409 3501.7981749283313
ton 2025-05-26 00:00 0:D9019E4FC23181E41E95AD7B50EE8D3533B054B5288A97AABDF466FAA9F3F199 7732.870047282664 7266.94848398919
ton 2025-07-05 00:00 0:5A03C168CD73DD1FBE87686EC332B62B28946D841AE2A4E8B787CEA356D84C75 6740.446405119195 2188.077446960133
ton 2025-06-30 00:00 0:BBB622A64BE03BADA8829C560683289163B5FE4CD2E271C2A849B95AD695AF85 5390.137732566595 5097.898498854276
ton 2025-06-27 00:00 0:3277A4376B19F09D523AB445F6FCC6F8D9C34C2FBB95594B59155FEB786E4C03 4632.505809145706 4298.244707954958
ton 2025-06-25 00:00 0:C8273DCB6A8996D86446B22F92D948AF98F0359EE8BBDDCD69BE2ECA00D63614 4529.513848435088 6063.583391221192
ton 2025-06-08 00:00 0:7292213E3EE2EB66C88EBDFF5F8226E3D33E7A1C01CC7DE06EBB0FA9B64478D3 4499.705478256233 4100.660501039493
ton 2025-06-11 00:00 0:723B04BE588F357F1AC49A36038ADFD4A2EDCCDDF692454203CA1EDC31A2D5BD 4477.548939605037 1725.2408127482176
ton 2025-06-08 00:00 0:16F3EF9E2138BA4A1D72094489434386880912065CB5CEDC28BD243CBCA56F0A 4425.24199662662 3845.3934559401937
ton 2025-06-06 00:00 0:2D79227F2F0CCAD2E30C80D92A4459C6C707ED9BEB41E4E5A47C942260DE7121 2594.559456465277 1385.7940296246584
ton 2025-04-23 00:00 0:7D6308610D058406CB304D97B03FB5068F51FDF117EF4EAC710000FE94516319 2469.0118306693453 2633.1252689892963

I assume the reason of the difference is that the corresponding partitions of ton.dex_pools haven't been synced at the moment of the increment build of tokens_ton.net_transfers_daily

@shuva10v shuva10v changed the title [Draft] Add a view for Proxy TON addresses Add a view for Proxy TON addresses Jul 23, 2025
@shuva10v shuva10v marked this pull request as ready for review July 23, 2025 12:16
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Jul 23, 2025
@dune-eng
Copy link

Workflow run id 16470372909 approved.

@jeff-dude jeff-dude self-assigned this Jul 23, 2025
@jeff-dude jeff-dude added ready-for-merging and removed ready-for-review this PR development is complete, please review labels Jul 23, 2025
@jeff-dude jeff-dude merged commit c140614 into duneanalytics:main Jul 23, 2025
5 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dbt: daily covers the Daily dbt subproject ready-for-merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants