Skip to content

zereox - add monad#9136

Merged
alicecha merged 6 commits intoduneanalytics:mainfrom
RantumBits:monad
Mar 6, 2026
Merged

zereox - add monad#9136
alicecha merged 6 commits intoduneanalytics:mainfrom
RantumBits:monad

Conversation

@RantumBits
Copy link
Copy Markdown
Contributor

Description:

  • add 0x trades on Monad

@github-actions github-actions Bot added WIP work in progress dbt: dex covers the DEX dbt subproject labels Dec 16, 2025
@RantumBits RantumBits marked this pull request as ready for review December 16, 2025 20:18
@cursor
Copy link
Copy Markdown

cursor Bot commented Dec 16, 2025

PR Summary

Introduce Monad support for 0x by adding v2 trades and settler addresses, wiring them into aggregated fills/trades, and updating schemas/exposures.

  • Monad support for 0x:
    • Add zeroex_v2_monad_trades (incremental, partitioned by block_month, start_date 2024-07-15) and zeroex_monad_settler_addresses (incremental) models.
    • Define schemas/tests in monad/zeroex_monad_schema.yml (unique combos; detailed column docs).
  • Aggregate wiring & exposure:
    • Include ref('zeroex_v2_monad_trades') in zeroex_api_fills_deduped settler models.
    • Add monad to exposure lists in zeroex_api_fills_deduped and zeroex_trades; list monad in zeroex_schema.yml for zeroex_api_fills_deduped.
  • Seeds:
    • Update sample CSV to use WPOL (Polygon) symbol in place of WMATIC and adjust token pairs accordingly.

Written by Cursor Bugbot for commit 6c17ccb. Configure here.

@github-actions github-actions Bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Dec 16, 2025
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

Comment thread dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_monad_schema.yml Outdated
@RantumBits
Copy link
Copy Markdown
Contributor Author

@jeff-dude could you help get this added when you have a chance?

@jeff-dude
Copy link
Copy Markdown
Member

@jeff-dude could you help get this added when you have a chance?

thanks for heads up. i have notified our customer support team, they should be reaching out (maybe via TG?), we have a new process to go through dune channels and they will help us prioritize this for you 🙏

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

Introduces new dbt models for 0x protocol on Monad blockchain, adding zeroex_v2_monad_trades (ERC20 trades through Settler contracts) and zeroex_monad_settler_addresses (authorized settler addresses). Integrates the new trades model into the existing zeroex_api_fills_deduped model and updates associated metadata.

Changes

Cohort / File(s) Summary
Schema Definitions
dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_monad_schema.yml
New schema YAML defining two models with comprehensive metadata, data tests (unique key constraints), and detailed column documentation for both zeroex_v2_monad_trades and zeroex_monad_settler_addresses.
Monad SQL Models
dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_v2_monad_trades.sql, dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_monad_settler_addresses.sql
Two new incremental dbt models for Monad blockchain; v2_monad_trades partitioned by block_month with macro-based CTEs; settler_addresses configured with settler_address unique key using zeroex_settler_addresses macro.
Integration Updates
dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql, dbt_subprojects/dex/models/_projects/zeroex/zeroex_schema.yml
Added reference to zeroex_v2_monad_trades in settler_models list and updated zeroex_api_fills_deduped metadata to include monad blockchain.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • jeff-dude
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title contains a typo ('zereox' instead of 'zeroex') and is extremely vague and generic; it fails to convey meaningful information about the specific changes. Fix the typo and make the title more specific; consider something like 'Add 0x Monad trades models' to better describe the primary changes.
Description check ❓ Inconclusive The description is minimal and lacks detail; it only states 'add 0x trades on Monad' without explaining the scope, implementation, testing, or motivation. Expand the description with details on what was added (new models, schema definitions, etc.), any testing performed, and why these changes are necessary.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@alicecha alicecha self-requested a review March 6, 2026 15:40
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_monad_settler_addresses.sql`:
- Line 6: unique_key currently lists only 'settler_address' which can cause rows
for different token_id values to be clobbered; update the model's merge key to
be a composite key including both 'settler_address' and 'token_id' (i.e., change
unique_key to include 'token_id' alongside 'settler_address') so incremental
merges preserve separate token rows.

In
`@dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_v2_monad_trades.sql`:
- Around line 44-46: The query currently uses a wildcard projection ("select *
from trade_details"); replace it by explicitly listing every column from the
trade_details table and prefix each with a table alias (e.g., t.column_name) to
make the output schema explicit and stable for downstream unions; update the
SELECT in zeroex_v2_monad_trades.sql to use a table alias for trade_details
(e.g., FROM trade_details AS t) and enumerate all columns in the desired order
with that alias.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52e252f1-e4d9-4b57-8bae-03160d412005

📥 Commits

Reviewing files that changed from the base of the PR and between ad0dcf2 and a38368b.

⛔ Files ignored due to path filters (1)
  • dbt_subprojects/dex/seeds/_project/zeroex/zeroex_api_fills_deduped_sample.csv is excluded by !**/*.csv
📒 Files selected for processing (5)
  • dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_monad_schema.yml
  • dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_monad_settler_addresses.sql
  • dbt_subprojects/dex/models/_projects/zeroex/monad/zeroex_v2_monad_trades.sql
  • dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql
  • dbt_subprojects/dex/models/_projects/zeroex/zeroex_schema.yml

@jeff-dude jeff-dude added ready-for-merging and removed ready-for-review this PR development is complete, please review labels Mar 6, 2026
@alicecha alicecha merged commit 5a27bde into duneanalytics:main Mar 6, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dbt: dex covers the DEX dbt subproject ready-for-merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants