Fix ton.prices_daily: remove launchpads from calculations#9289
Fix ton.prices_daily: remove launchpads from calculations#92890xRobin merged 2 commits intoduneanalytics:mainfrom
Conversation
PR SummaryLow Risk Overview Written by Cursor Bugbot for commit 3dd56a6. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
| ROW(token_sold_address, amount_sold_raw) | ||
| ]) AS T(token_address, amount_raw) | ||
| WHERE token_address NOT IN (SELECT * FROM {{ ref('ton_proxy_ton_addresses') }}) | ||
| AND project_type != 'launchpad' |
There was a problem hiding this comment.
NULL project_type rows unintentionally excluded by filter
Medium Severity
The condition project_type != 'launchpad' will also filter out rows where project_type is NULL due to SQL's three-valued logic. When comparing NULL with any value using !=, the result is NULL (unknown), causing the row to be excluded from results. If the ton.dex_trades source contains trades with NULL project_type values, those legitimate trades would be unintentionally excluded from price calculations. Using project_type IS DISTINCT FROM 'launchpad' or (project_type IS NULL OR project_type != 'launchpad') would preserve NULL rows.
There was a problem hiding this comment.
project_type can't be null in our case -- it is controlled by our datalake which uploads ton.dex_trades data to Dune
|
Any updates? This is very urgent @tomfutago |


Thank you for contributing to Spellbook 🪄
Please open the PR in draft and mark as ready when you want to request a review.
Description:
We found a bug in our jetton price calculations. Shipping hotfix
quick links for more information: