-
Notifications
You must be signed in to change notification settings - Fork 1.3k
adapt beets.trades to balancer.trades #8286
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
base: main
Are you sure you want to change the base?
Conversation
Workflow run id 15344960155 approved. |
Workflow run id 15344960167 approved. |
Workflow run id 15344960238 approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adapts the existing beets.trades
models to the Balancer schema by:
- Introducing separate base trade models for Beets V2 and V3 using the
balancer_compatible
macros - Removing the old combined Sonic base trades and root
beets_trades
view - Adding new project-level views (
beets_v2_sonic_trades
,beets_v3_sonic_trades
) and updating the schema YAML
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
dbt_subprojects/dex/models/trades/sonic/platforms/beets_v3_sonic_base_trades.sql | New V3 base trades model invoking balancer_compatible_v3_trades |
dbt_subprojects/dex/models/trades/sonic/platforms/beets_v2_sonic_base_trades.sql | New V2 base trades model invoking balancer_compatible_v2_trades |
dbt_subprojects/dex/models/trades/sonic/platforms/beets_sonic_base_trades.sql | Removed old combined Sonic base trades |
dbt_subprojects/dex/models/_projects/beets/beets_v3_sonic_trades.sql | Added project-level V3 trades view |
dbt_subprojects/dex/models/_projects/beets/beets_v2_sonic_trades.sql | Added project-level V2 trades view |
dbt_subprojects/dex/models/_projects/beets/beets_trades.sql | Removed old unified beets_trades view |
dbt_subprojects/dex/models/_projects/beets/_schema.yml | Updated model entries and anchors for V2/V3 Sonic trades |
Comments suppressed due to low confidence (1)
dbt_subprojects/dex/models/_projects/beets/_schema.yml:209
- No
data_tests
are defined for the newbeets_v2_sonic_trades
andbeets_v3_sonic_trades
models. Consider adding adbt_utils.unique_combination_of_columns
test on the primary key columns (block_date
,blockchain
,project
,version
,tx_hash
,evt_index
).
- name: beets_v3_sonic_trades
dbt_subprojects/dex/models/_projects/beets/beets_v3_sonic_trades.sql
Outdated
Show resolved
Hide resolved
swap_fee, | ||
pool_symbol, | ||
pool_type | ||
FROM {{ ref('balancer_v2_ethereum_base_trades') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ref
call should point to the new V2 base model (beets_v2_sonic_base_trades.sql
, alias base_trades
) instead of balancer_v2_ethereum_base_trades
. Change to ref('beets_v2_sonic_base_trades')
or ref('base_trades')
.
FROM {{ ref('balancer_v2_ethereum_base_trades') }} | |
FROM {{ ref('beets_v2_sonic_base_trades') }} |
Copilot uses AI. Check for mistakes.
FROM dexs | ||
LEFT JOIN {{ source('balancer_v2_ethereum', 'bpt_prices') }} bpt_prices | ||
ON bpt_prices.contract_address = dexs.token_bought_address | ||
AND bpt_prices.day <= DATE_TRUNC('day', dexs.block_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The join on bpt_prices
lacks a filter on the blockchain
column, which may pull in records from other chains. Add AND bpt_prices.blockchain = 'ethereum'
to the join condition.
AND bpt_prices.day <= DATE_TRUNC('day', dexs.block_time) | |
AND bpt_prices.day <= DATE_TRUNC('day', dexs.block_time) | |
AND bpt_prices.blockchain = 'ethereum' |
Copilot uses AI. Check for mistakes.
Workflow run id 15345169652 approved. |
Workflow run id 15345169824 approved. |
Workflow run id 15345169722 approved. |
Workflow run id 15345263958 approved. |
Workflow run id 15345263963 approved. |
Workflow run id 15345264167 approved. |
Workflow run id 15345342772 approved. |
Workflow run id 15345342762 approved. |
Workflow run id 15345343062 approved. |
Workflow run id 15345667079 approved. |
Workflow run id 15345667090 approved. |
Workflow run id 15345667411 approved. |
This reverts commit 01b41b1.
Workflow run id 15345790458 approved. |
Workflow run id 15345790421 approved. |
Workflow run id 15345790428 approved. |
Workflow run id 15346021311 approved. |
Workflow run id 15346021300 approved. |
Workflow run id 15346021478 approved. |
Workflow run id 15346066034 approved. |
Workflow run id 15346066037 approved. |
Workflow run id 15346066345 approved. |
Workflow run id 15346696830 approved. |
Workflow run id 15346696844 approved. |
Workflow run id 15346697110 approved. |
Workflow run id 15347205520 approved. |
adapting beets.trades to balancer.trades to use the same schema