Skip to content

Meteora Dynamic bonding curve#8496

Closed
sandeshsk12 wants to merge 60 commits intoduneanalytics:mainfrom
sandeshsk12:meteora_dbc_trades_v4
Closed

Meteora Dynamic bonding curve#8496
sandeshsk12 wants to merge 60 commits intoduneanalytics:mainfrom
sandeshsk12:meteora_dbc_trades_v4

Conversation

@sandeshsk12
Copy link
Contributor

@sandeshsk12 sandeshsk12 commented Jul 17, 2025

Thank you for contributing to Spellbook 🪄

Please open the PR in draft and mark as ready when you want to request a review.

Description:

Meteora is a decentralized exchange (DEX) and DeFi infrastructure built on the Solana blockchain, optimized for liquidity and yield enhancement for liquidity providers (LPs).

This PR enhances the dex_solana.trades table by adding trades related to thier new contract dynamic bonding curves. Contract address : dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN. The update utilizes function data joined with event data to accurately determine the swap amount.


quick links for more information:

@github-actions github-actions bot added WIP work in progress dbt: solana covers the Solana dbt subproject labels Jul 17, 2025
@dune-eng
Copy link

Workflow run id 16348341327 approved.

@dune-eng
Copy link

Workflow run id 16348341330 approved.

@dune-eng
Copy link

Workflow run id 16348341388 approved.

@dune-eng
Copy link

Workflow run id 16348413694 approved.

@dune-eng
Copy link

Workflow run id 16348413594 approved.

@dune-eng
Copy link

Workflow run id 16348413590 approved.

@dune-eng
Copy link

Workflow run id 16348725578 approved.

@dune-eng
Copy link

Workflow run id 16348725617 approved.

@dune-eng
Copy link

Workflow run id 16348725698 approved.

@dune-eng
Copy link

Workflow run id 16351765554 approved.

@dune-eng
Copy link

Workflow run id 16351765669 approved.

@dune-eng
Copy link

Workflow run id 16351765550 approved.

@dune-eng
Copy link

Workflow run id 16351849494 approved.

@dune-eng
Copy link

Workflow run id 16351849596 approved.

@dune-eng
Copy link

Workflow run id 16351849507 approved.

@dune-eng
Copy link

Workflow run id 16351947978 approved.

@dune-eng
Copy link

Workflow run id 16351948129 approved.

@dune-eng
Copy link

Workflow run id 16351947979 approved.

@dune-eng
Copy link

Workflow run id 16352187653 approved.

@dune-eng
Copy link

Workflow run id 16352187646 approved.

@dune-eng
Copy link

Workflow run id 16352188160 approved.

MSilb7 and others added 23 commits July 31, 2025 19:15
* Eigenlayer: add slashing withdrawal events support

- Add SlashingWithdrawalQueued and SlashingWithdrawalCompleted events to sources
- Create slashing_withdrawal_queued_flattened model for data processing
- Create slashing_withdrawal_completed_enriched model for enriched data
- Update strategy_shares_outflow_by_day to include slashing withdrawals
- Fix schema version to 2 for consistency with other projects

✅ Tested: Dune query validation + local dbt compilation
✅ Verified: All models compile successfully with correct SQL output

* adding trailer

---------

Co-authored-by: jeff-dude <[email protected]>
…lytics#8533)

* Polish solana

* token cnt fix

---------

Co-authored-by: jeff-dude <[email protected]>
* Added SQL

* fixed jinja

* Fixed meteora v2 swaps

* fixed data types

* Fixed data types of amount_raw

* Added swaps_v2

* Removed single transaction used for testing

* Fixed join conditions

* Fixed length of data

* fixed data conversion code

* fixed data conversions

* Uncommented tx_index

* Testing for meteora v2 in dbt

* Fixed comments

* Fixed the code which resulted in syntax error

* removed all comments

* fixed type casting issue

* Changed date to project start date

* Fixed missing conversion

* fixed swap number logic for edge cases

* Added name in contributors list

* Changed from hard decoding values to event table

* Using event_swaps table

* changed table name

* Added comment

* Fixed conflicts

* Fixed conflicts

* Fixed conflicts and compile errors

* Fixed blockTimestamp

* Fixed logic and removed other dexes

* Added all dexes after successful testing
* add celer bridge

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
* hemi gas fees and token transfers

* updating hemi trf start date
…8560)

* check mev by block_number instead of block_time

* fix
…ytics#8539)

* feat: Velora: add gnosis chain for Augstus 6.2

* test CI

* feat: velora: add gnosis chaain

* fix: found undefined alias

* fix: velora: exclude v5 from gnosis

* fix: velora: depends on a source named 'paraswap_gnosis.AugustusV6_1_call_

* fix: error: unexpected ','

* fix: source named 'paraswap_gnosis.AugustusV6_2_call_swapExactAmountIn' was not found

* cleanup

* fix: Schema 'paraswap_gnosis' does not exist

* fix: skip from unioning the nonexisting table

* fix: syntax

* fix: wrapped xDAI on gnosis chain

* fix: tags

* feat: velora: add unichain configs

* feat: velora: add unichain sources

* fix: source named 'paraswap_unichain.AugustusV6_1_call_swapExactAmountIn' which was not found

* fix: plug unichain velora trades

* chore: to_wrapped_native_token cleanup

* chore: use wrapped native macro in paraswap v6 sql for unichain

* chore: cleanup redundant elif

* fix: add unichain to macro to_wrapped_native_token

* fix template usage

* fix: add missing comma

* fix: cleanup redundant column

* chore: templatize gnosis trades
* Add blackhole avalanche_c base trades model

* Fix column name in blackhole avalanche_c base trades model

* Fix syntax error in blackhole avalanche_c base trades model by adding a missing comma

* Add blackhole_v2 and blackhole_v3 avalanche_c base trades models with incremental configurations and updated contributors in schema.yml

* Remove blackhole avalanche_c base trades model SQL file

* Update column name in blackhole avalanche_c base trades model from Factory_evt_PairCreated to Factory_evt_PoolCreated

* Add blackhole_avalanche_c_base_trades_seed.csv seed file with initial column structure

* Update blackhole avalanche_c base trades models to v2 and v3 with new configurations and contributors in schema.yml

* Update references in avalanche_c base trades model to include blackhole_v2 and blackhole_v3

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_custompool to algebrafactory_evt_pool

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_pool to algebrafactory_evt_custompool

* Add 'blackhole' project entry to dex_info.sql
…ain to chain-level (duneanalytics#8566)

* materialize each chain-level dex model

* make base_trades a view

* force short run time

* clean up column selection

* Revert "force short run time"

This reverts commit 16024d4.
* Add cursor-ai to CLA workflow allowlist

Co-authored-by: robin <[email protected]>

* Update CLA workflow allowlist to include cursoragent

Co-authored-by: robin <[email protected]>

* Update cla.yml

---------

Co-authored-by: Cursor Agent <[email protected]>
* hemi to dex trades

* fixed file name

* removed izumi multichain from sources - on taiko

* added sushiswap

* test for hemi only to update seeds

* syntax erorr fix

* updated seed files

* syntax issue fix

* isolated test

* reverted changes- ready for review

* update

* changed mat type
* Initial commit

* Fixed data type issue

* Fixed seed file

* Fixed seed file data type

* Fixed incremental logic

* Fixed typo

* fixed typo

* added swap_number as evt_index

* changed data type

* readded important files

* changed data types

* Changed seed config

* changed seed file

* changed seed file

* Changed event index logic

* Added comments and also filtered zero amount trades

* Added ekubo to eth models

* resolved conflicts

* CUR2-200 pr1 TAC blockchain (duneanalytics#8433)

* pr1 tac

* Update dbt_subprojects/daily_spellbook/macros/helpers/evms_blockchains_list.sql

Co-authored-by: Copilot <[email protected]>

* fixed syntax

* updated tac prices

* fixed syntax

* added correct api keys

* update

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: jeff-dude <[email protected]>

* add reclamm and quant (duneanalytics#8563)

* add reclamm and quant

* no weights for quant

* no symbol for quant pools

* correct quotes

* Fix Plume Chain ID (duneanalytics#8557)

* Added a couple of new strategies to our existing spellbook models (duneanalytics#8545)

Co-authored-by: jeff-dude <[email protected]>

* Eigenlayer: add slashing withdrawal events support (duneanalytics#8543)

* Eigenlayer: add slashing withdrawal events support

- Add SlashingWithdrawalQueued and SlashingWithdrawalCompleted events to sources
- Create slashing_withdrawal_queued_flattened model for data processing
- Create slashing_withdrawal_completed_enriched model for enriched data
- Update strategy_shares_outflow_by_day to include slashing withdrawals
- Fix schema version to 2 for consistency with other projects

✅ Tested: Dune query validation + local dbt compilation
✅ Verified: All models compile successfully with correct SQL output

* adding trailer

---------

Co-authored-by: jeff-dude <[email protected]>

* 1inch-U74: Solana polishing before inclusion to main lineage (duneanalytics#8533)

* Polish solana

* token cnt fix

---------

Co-authored-by: jeff-dude <[email protected]>

* Meteora swaps v2 fix (duneanalytics#8416)

* Added SQL

* fixed jinja

* Fixed meteora v2 swaps

* fixed data types

* Fixed data types of amount_raw

* Added swaps_v2

* Removed single transaction used for testing

* Fixed join conditions

* Fixed length of data

* fixed data conversion code

* fixed data conversions

* Uncommented tx_index

* Testing for meteora v2 in dbt

* Fixed comments

* Fixed the code which resulted in syntax error

* removed all comments

* fixed type casting issue

* Changed date to project start date

* Fixed missing conversion

* fixed swap number logic for edge cases

* Added name in contributors list

* Changed from hard decoding values to event table

* Using event_swaps table

* changed table name

* Added comment

* Fixed conflicts

* Fixed conflicts

* Fixed conflicts and compile errors

* Fixed blockTimestamp

* Fixed logic and removed other dexes

* Added all dexes after successful testing

* add ronin market (duneanalytics#8512)

* [CoW Protocol] Add Helixbox, MX Trading, and Trusted Volumes (duneanalytics#8554)

* add celer bridge (duneanalytics#8552)

* add celer bridge

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* cctp bridge on arbitrum, avalanche, optimism, polygon and unichain (duneanalytics#8550)

* hemi gas fees and token transfers (duneanalytics#8544)

* hemi gas fees and token transfers

* updating hemi trf start date

* mev atomic arbs by block_number instead of block_time (duneanalytics#8560)

* check mev by block_number instead of block_time

* fix

* feat: add hemi to sushi agg trades (duneanalytics#8546)

* feat: Velora: add Gnosis chain and Unichain for Augstus 6.2 (duneanalytics#8539)

* feat: Velora: add gnosis chain for Augstus 6.2

* test CI

* feat: velora: add gnosis chaain

* fix: found undefined alias

* fix: velora: exclude v5 from gnosis

* fix: velora: depends on a source named 'paraswap_gnosis.AugustusV6_1_call_

* fix: error: unexpected ','

* fix: source named 'paraswap_gnosis.AugustusV6_2_call_swapExactAmountIn' was not found

* cleanup

* fix: Schema 'paraswap_gnosis' does not exist

* fix: skip from unioning the nonexisting table

* fix: syntax

* fix: wrapped xDAI on gnosis chain

* fix: tags

* feat: velora: add unichain configs

* feat: velora: add unichain sources

* fix: source named 'paraswap_unichain.AugustusV6_1_call_swapExactAmountIn' which was not found

* fix: plug unichain velora trades

* chore: to_wrapped_native_token cleanup

* chore: use wrapped native macro in paraswap v6 sql for unichain

* chore: cleanup redundant elif

* fix: add unichain to macro to_wrapped_native_token

* fix template usage

* fix: add missing comma

* fix: cleanup redundant column

* chore: templatize gnosis trades

* added blackhole avalanche_c base trades model  (duneanalytics#8524)

* Add blackhole avalanche_c base trades model

* Fix column name in blackhole avalanche_c base trades model

* Fix syntax error in blackhole avalanche_c base trades model by adding a missing comma

* Add blackhole_v2 and blackhole_v3 avalanche_c base trades models with incremental configurations and updated contributors in schema.yml

* Remove blackhole avalanche_c base trades model SQL file

* Update column name in blackhole avalanche_c base trades model from Factory_evt_PairCreated to Factory_evt_PoolCreated

* Add blackhole_avalanche_c_base_trades_seed.csv seed file with initial column structure

* Update blackhole avalanche_c base trades models to v2 and v3 with new configurations and contributors in schema.yml

* Update references in avalanche_c base trades model to include blackhole_v2 and blackhole_v3

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_custompool to algebrafactory_evt_pool

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_pool to algebrafactory_evt_custompool

* Add 'blackhole' project entry to dex_info.sql

* added blackhole avalanche_c base trades model  (duneanalytics#8524)

* Add blackhole avalanche_c base trades model

* Fix column name in blackhole avalanche_c base trades model

* Fix syntax error in blackhole avalanche_c base trades model by adding a missing comma

* Add blackhole_v2 and blackhole_v3 avalanche_c base trades models with incremental configurations and updated contributors in schema.yml

* Remove blackhole avalanche_c base trades model SQL file

* Update column name in blackhole avalanche_c base trades model from Factory_evt_PairCreated to Factory_evt_PoolCreated

* Add blackhole_avalanche_c_base_trades_seed.csv seed file with initial column structure

* Update blackhole avalanche_c base trades models to v2 and v3 with new configurations and contributors in schema.yml

* Update references in avalanche_c base trades model to include blackhole_v2 and blackhole_v3

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_custompool to algebrafactory_evt_pool

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_pool to algebrafactory_evt_custompool

* Add 'blackhole' project entry to dex_info.sql

* refactor dex pipeline: move incremental materialization from cross-chain to chain-level (duneanalytics#8566)

* materialize each chain-level dex model

* make base_trades a view

* force short run time

* clean up column selection

* Revert "force short run time"

This reverts commit 16024d4.

* added blackhole avalanche_c base trades model  (duneanalytics#8524)

* Add blackhole avalanche_c base trades model

* Fix column name in blackhole avalanche_c base trades model

* Fix syntax error in blackhole avalanche_c base trades model by adding a missing comma

* Add blackhole_v2 and blackhole_v3 avalanche_c base trades models with incremental configurations and updated contributors in schema.yml

* Remove blackhole avalanche_c base trades model SQL file

* Update column name in blackhole avalanche_c base trades model from Factory_evt_PairCreated to Factory_evt_PoolCreated

* Add blackhole_avalanche_c_base_trades_seed.csv seed file with initial column structure

* Update blackhole avalanche_c base trades models to v2 and v3 with new configurations and contributors in schema.yml

* Update references in avalanche_c base trades model to include blackhole_v2 and blackhole_v3

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_custompool to algebrafactory_evt_pool

* Update source reference in blackhole_v3_avalanche_c_base_trades model from algebrafactory_evt_pool to algebrafactory_evt_custompool

* Add 'blackhole' project entry to dex_info.sql

* Revert "add celer bridge (duneanalytics#8552)" (duneanalytics#8567)

This reverts commit 264a313.

* simplify dex partititons (duneanalytics#8568)

* chore: resolve merge conflicts

---------

Co-authored-by: Krish <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: jeff-dude <[email protected]>
Co-authored-by: franzns <[email protected]>
Co-authored-by: Michael Silberling <[email protected]>
Co-authored-by: yy-analytics <[email protected]>
Co-authored-by: Hamin-eigen <[email protected]>
Co-authored-by: Eduard Horch <[email protected]>
Co-authored-by: hildobby <[email protected]>
Co-authored-by: Bram van den Berg <[email protected]>
Co-authored-by: OlaStenberg <[email protected]>
Co-authored-by: alexshchur <[email protected]>
Co-authored-by: abhijeetblitz <[email protected]>
* Revert "EKUBO Dex on Ethereum (duneanalytics#8556)"

This reverts commit 00e22b3.

* Revert "CUR2-278 hemi dex trades (duneanalytics#8562)"

This reverts commit 095e20f.
)

* add tests for column types in the dex lineage

* also allow for ineger on the evt_index column as that is not consistent across chains apparently

* add inline column types for dex.trades
@github-actions github-actions bot added dbt: dex covers the DEX dbt subproject dbt: nft covers the NFT dbt subproject dbt: hourly covers the hourly dbt subproject dbt: daily covers the Daily dbt subproject dbt: tokens covers the Tokens dbt subproject labels Jul 31, 2025
@dune-eng dune-eng closed this Jul 31, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dbt: daily covers the Daily dbt subproject dbt: dex covers the DEX dbt subproject dbt: hourly covers the hourly dbt subproject dbt: nft covers the NFT dbt subproject dbt: solana covers the Solana dbt subproject dbt: tokens covers the Tokens 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.