feat(dex): add Tessera-V (TesseraSwap) PropAMM trades on Base + BNB#9612
feat(dex): add Tessera-V (TesseraSwap) PropAMM trades on Base + BNB#9612alicecha merged 8 commits intoduneanalytics:mainfrom
Conversation
Adds the EVM Tessera-V PropAMM as a new platform feeding dex.trades on both Base and BNB Chain. Mirrors the Solana TesseraV spell architecture (TessVdML9pBGgG9yGks7o4HewRaXVAMuoVj4x83GLQH). Both chains share the same vanity-deployed TesseraSwap router (0x55555522005bcae1c2424d474bfd5ed477749e3e) emitting one Tesseratrade event per fill, ABI-decoded by Dune as tesseraswap_<chain>.tesseraswap_evt_tesseratrade. Changes - new platform models tessera_v_base_base_trades and tessera_v_bnb_base_trades sourced from the decoded Tesseratrade event - wired into dex_base_base_trades and dex_bnb_base_trades - registered tesseraswap_base and tesseraswap_bnb in sector sources - added unique-combo + seed tests for both models with one representative seed row per chain - registered project in dex.dex_info Validation - decoded source row counts healthy (Base 16k+ trades/day, BNB 1.4k+ during initial backfill window), zero null addresses, zero zero-amount rows - compiled dex_base_base_trades and dex_bnb_base_trades successfully Made-with: Cursor
PR SummaryMedium Risk Overview Wires these models into the chain-level Reviewed by Cursor Bugbot for commit 3accccf. Configure here. |
- Extract `tessera_v_compatible_trades` macro mirroring native_compatible_trades / clipper_compatible_trades pattern; reduces both per-chain models to thin macro wrappers - Drop non-standard 'propamm'/'pmm' tags; use canonical [chain, dex, trades, project] tag set - Set contributors to actual PR author - Match short-form description style used by other dex.trades models Made-with: Cursor
Made-with: Cursor
…des OOM Temporarily set dev_dates=true so the chain-level dex_<chain>_base_trades UNIONs scan only the last 3 days during CI, sidestepping the transient EXCEEDED_LOCAL_MEMORY_LIMIT (348GB) caused by the macro's ROW_NUMBER() dedup over BNB's full historical UNION. Platform models (tessera_v_base/bnb_base_trades) still build fully, so their seed tests retain real signal. Maintainer to run `--full-refresh` post-merge to backfill chain-level base_trades, or revert this flag before merging. Made-with: Cursor
Note for reviewer — temporary CI workaround appliedThe previous CI run failed not because of the new Tessera-V models (both built fine: Base 4.76M rows / 8.7s, BNB 1.4K rows / 12.7s) but because the downstream chain-level model To unblock CI, I've flipped
Happy to revert in a final commit before merge — just let me know which path you prefer. |
Maintainer to run --full-refresh on dex_<chain>_base_trades models post-merge to backfill BNB chain history (skipped during dev_dates CI run). Made-with: Cursor
|
Reverted The validating CI signal is the prior green run on commit 8b3ffae: both new models built and passed all tests (Base 4.76M rows, BNB 1.4K rows, all seed + uniqueness tests green). The chain-level If a green check is required for merge, happy to re-flip |
BNB backfill update — decoded source is now full-historyThe Tessera-V backfill on BNB is essentially complete. Compared to the snapshot at PR open (1,401 rows, single day):
Per-day breakdown for BNB shows steady activity (~5K–28K trades/day) with zero null fields and zero zero-amount rows across all 168 backfilled days — confirming the decoded Once merged + |
alicecha
left a comment
There was a problem hiding this comment.
Verified against decoded sources — seed rows reconcile 1:1 on both chains, no nulls/zeros, no (tx_hash, evt_index) duplicates, single shared router 0x55555522…749e3e on both chains. The BNB backfill caveat in the description is now stale: tesseraswap_bnb.tesseraswap_evt_tesseratrade is fully caught up (last event ~minutes ago), so the seed-row block is safely covered and CI should pass without a re-run.
…solve # Conflicts: # dbt_subprojects/dex/models/dex_info.sql # dbt_subprojects/dex/models/trades/base/_schema.yml # dbt_subprojects/dex/models/trades/bnb/_schema.yml
Summary
Adds the EVM Tessera-V (TesseraSwap) proprietary AMM as a new platform in
dex.tradesfor both Base and BNB Chain, mirroring the existing Solana TesseraV spell (tessera_solana_trades).Both chains share the same vanity-deployed router
0x55555522005bcae1c2424d474bfd5ed477749e3eemitting oneTesseratrade(address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOut, address recipient)event per fill, ABI-decoded by Dune astesseraswap_<chain>.tesseraswap_evt_tesseratrade.The protocol architecture:
A separate keeper-driven inventory contract (
0x3dBE077e7986657E95e1CC50089f17a5a4AF0AaE) handles off-chain rebalancing between operator and vault and is intentionally not included as a trades source — it would double-count aggregator volume already captured via other PMM/aggregator decoded events.Changes
tessera_v_base_base_trades— sourcestesseraswap_base.tesseraswap_evt_tesseratradetessera_v_bnb_base_trades— sourcestesseraswap_bnb.tesseraswap_evt_tesseratradedex_base_base_tradesdex_bnb_base_tradessources/_sector/dex/trades/base/_sources.yml→tesseraswap_basesources/_sector/dex/trades/bnb/_sources.yml→tesseraswap_bnb_schema.ymlentries withdbt_utils.unique_combination_of_columns+check_dex_base_trades_seedteststessera_v_base_base_trades_seed.csv,tessera_v_bnb_base_trades_seed.csv) and registered them indbt_subprojects/dex/seeds/trades/_schema.yml('tessera_v', 'Tessera-V', 'Direct', 'tessera_v')todex_infoValidation
tesseraswap_base.tesseraswap_evt_tesseratradetesseraswap_bnb.tesseraswap_evt_tesseratrade(currently backfilling)Test plan
dbt compile -s tessera_v_base_base_trades tessera_v_bnb_base_trades dex_base_base_trades dex_bnb_base_trades dex_info— passes locallydex.tradesrow counts after merge once production tables buildNotes for reviewers
block_date = 2026-04-28). If the backfill has not progressed past the seed-row block by the time CI runs the seed test, please re-run CI once Dune confirms the BNB table is fully populated.tessera_v(matching the user request and distinct from the Solana spell'stessera); marketplace_type isDirect.Made with Cursor