Skip to content

feat: add SwapWizard DEX aggregator trades#9690

Open
cmayorga wants to merge 2 commits into
duneanalytics:mainfrom
DeFiRe-business:feat/swapwizard-aggregator-trades
Open

feat: add SwapWizard DEX aggregator trades#9690
cmayorga wants to merge 2 commits into
duneanalytics:mainfrom
DeFiRe-business:feat/swapwizard-aggregator-trades

Conversation

@cmayorga
Copy link
Copy Markdown

Summary

  • Add SwapWizard DEX aggregator to dex_aggregator.trades table
  • Parse SwapExecuted events from raw logs across 5 chains: Ethereum, BNB, Polygon, Base, Arbitrum
  • Includes macro for reusable cross-chain logic, per-chain incremental models, and union view
  • Handles native token address wrapping, token symbol/decimal enrichment, and USD pricing via prices.usd

Contract Addresses

Chain Address
Ethereum 0x649A382ab2aecEc5c1B9ac956c4CdaCEDaC96c80
BNB 0x22E51c8090086502227a66D2A2E1335D7A5B1aEC
Polygon 0xc1409502815C4274e2e4F0c5EE3a32d0ce76f2c9
Base 0xA2ae391D0740Cb8C8aA40dB7c076591A8b5A2A4d
Arbitrum 0xA8E28f3c117B922867c78039adD25f07D23C5f6E

Event

event SwapExecuted(uint256 indexed dexIdx, address indexed impl, address indexed caller, address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOut)

Files

  • macros/models/_project/swapwizard_trades.sql — Core macro parsing raw logs
  • models/_projects/swapwizard/{chain}/ — Per-chain incremental models (5 chains)
  • models/_projects/swapwizard/swapwizard_trades.sql — Union view across all chains
  • models/aggregator_trades/dex_aggregator_trades.sql — Registered in master aggregator union

Test plan

  • CI dbt slim ci passes on all new models
  • Verify SwapExecuted topic0 matches 0xf37a3bd5c0f7f8527446af48a2a8fd5711deb58baa1a2747c3cb8dce6e9bb483
  • Validate trade data against on-chain events on block explorers

🤖 Generated with Claude Code

Add SwapWizard aggregator spell parsing SwapExecuted events from raw
logs across Ethereum, BNB, Polygon, Base, and Arbitrum.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@github-actions github-actions Bot marked this pull request as draft May 21, 2026 16:32
@github-actions github-actions Bot added WIP work in progress dbt: dex covers the DEX dbt subproject labels May 21, 2026
@cmayorga cmayorga marked this pull request as ready for review May 21, 2026 16:40
@github-actions github-actions Bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels May 21, 2026
@cmayorga
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@cmayorga
Copy link
Copy Markdown
Author

recheck

github-actions Bot added a commit that referenced this pull request May 21, 2026
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 ready-for-review this PR development is complete, please review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant