duneanalytics / duneanalytics/spellbook
[CONTRIBUTION] Add BEX (Berachain native DEX) to dex.trades on berachain
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 1.4k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 22
Description
What I want to add BEX is Berachain's native DEX (a Balancer V2 fork) and is currently missing from dex.trades on berachain. The 3 protocols currently covered (kodiak, beraswap, burrbear) represent only ~$14M of weekly volume. BEX has significant additional volume that is completely invisible to the community.
Research I've done:
- The BEX mainnet Vault contract is 0x4Be03f781C497A489E3cB0287833452cA9B9E80B
- Dune has already decoded this contract as beraswap_berachain.vault_evt_swap, with live swap data confirmed today (May 2026)
- The decoded table has columns: poolId, tokenIn, tokenOut, amountIn, amountOut — identical to the standard Balancer V2 Swap event
- BEX uses the Balancer V2 Vault architecture, so balancer_compatible_v2_trades macro applies directly
Proposed implementation Create bex_berachain_base_trades.sql using balancer_compatible_v2_trades(blockchain='berachain', project='bex', version='2'), reading from beraswap_berachain.vault_evt_swap.
Question for the team:
Since the decoded source is named beraswap_berachain rather than bex_berachain, does the macro need a source alias, or should I reference beraswap_berachain directly as the source?
I'm ready to write the SQL as soon as this is confirmed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed bex_berachain_base_trades.sql file and inspect the balancer_compatible_v2_trades macro, using the existing beraswap_berachain.vault_evt_swap source and its decoded Swap columns as the reference. Resolve whether the macro can reference that source directly or needs an alias; done means BEX swap activity is included in dex.trades on Berachain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- blockchain, data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100