一键导入
catalyst-dex-integration
// Add a DEX project to dex.trades for a chain (sources, base trades, chain unions, seed, dex_info)
// Add a DEX project to dex.trades for a chain (sources, base trades, chain unions, seed, dex_info)
Set up new chain foundational metadata (evms_info, prices, base sources, evms_blockchains_list)
Add gas fees and token transfer models for a new chain (hourly_spellbook + tokens)
Run dbt CLI commands (compile, ls, test, run, etc.) in the spellbook repo. Use when the user asks to compile, list, test, or run dbt models, or when you need to validate SQL by compiling a model.
| name | catalyst-dex-integration |
| description | Add a DEX project to dex.trades for a chain (sources, base trades, chain unions, seed, dex_info) |
| disable-model-invocation | true |
adds dex abstractions for requested decentralized exchanges to dex.trades.
when to use: use when the user wants to add one or more dexs (by project/namespace) to dex.trades for a given chain.
<issue_id>: linear issue id (e.g., CUR2-548)<chain>: chain name (e.g., monad, sonic)<project>: DEX project name (e.g., kuru, uniswap)<namespace>: contract namespace for source lookup (partial string ok, e.g., "kuru", "uni")from the invocation or user message: 1st = issue_id, 2nd = chain, 3rd = project, 4th = namespace. use these for every <placeholder> below. if given in free form, infer or ask once for missing values.
/catalyst-dex-integration CUR2-548 monad kuru kuru
dune mcp server: user-dune-mcp.
for ad-hoc sql, prefer temporary execution if the dune mcp supports it in-session. only create saved/throwaway queries with createDuneQuery when temporary execution is not available or when a later step explicitly needs a query_id.
fallback sequence when query_id is required: create query with createDuneQuery (pass sql in query) -> run with executeQueryById (using returned query_id) -> fetch rows with getExecutionResults (using returned execution_id).
dbt_subprojects/dex/models/trades/kaia/, .../mezo/). ordering: mimic existing; if unclear, append. swap chain name in: file paths, model names, schema entries, blockchain values.select * from dune.blockchains where name = '<chain>' (substitute <chain> with the chain name). extract: chain_id, name (display name), token_address (native token).select min(time) from <chain>.blocks where number <> 0 (substitute <chain>).main is up to date: fetch latest, pull if behind, exit if diverged.<issue_id>-<chain>-dex-integration, create off main, checkout, warn if exists. don't commit/push anything.query_id: 6318398, query_parameters: [{"key":"chain","value":"<chain>","type":"text"},{"key":"namespace","value":"<namespace>","type":"text"}] (substitute <chain> and <namespace>). retrieve from query results: namespace, name, and abi.abi following patterns like: Swap, PairCreated, and PoolCreated. if not found, query <chain>.logs_decoded.define DEX sources
sources/_sector/dex/trades/<chain>/_sources.ymlcreate platform base trades model
dbt_subprojects/dex/models/trades/<chain>/platforms/<project>_<chain>_base_trades.sqluniswap_compatible_v2_trades macrouniswap_compatible_v3_trades macrodbt_subprojects/dex/models/trades/<chain>/platforms/kuru_monad_base_trades.sql or existing macroschain-level setup (new chain only)
dbt_subprojects/dex/models/trades/<chain>/dex_<chain>_base_trades.sqldbt_subprojects/dex/models/trades/<chain>/dex_<chain>_trades.sqldbt_subprojects/dex/models/trades/<chain>/dex_<chain>_token_volumes_daily.sql<chain> to chains list in dbt_subprojects/dex/models/trades/dex_trades.sql<chain> to chains list in dbt_subprojects/dex/models/trades/dex_token_volumes_daily.sqlcreate/update schema file
dbt_subprojects/dex/models/trades/<chain>/_schema.yml (new chain) with dex_<chain>_trades, dex_<chain>_base_trades, dex_<chain>_token_volumes_dailycreate seed file
<project>_<chain>_base_trades_seed to dbt_subprojects/dex/seeds/trades/_schema.ymldbt_subprojects/dex/seeds/trades/<project>_<chain>_base_trades_seed.csvupdate dex_info.sql
<project> to dbt_subprojects/dex/models/dex_info.sqlfinal checks
uv sync --locked, then cd dbt_subprojects/dex and uv run dbt compile (or uv run dbt compile --select <project>_<chain>_base_trades). Fix any errors.<COMPILED_BASE_TRADES_SQL> in the query below with the exact compiled sql for the model <project>_<chain>_base_trades (from dbt compile output). use it as a subquery, not a table name. run the full query via the ad-hoc sql sequence above and paste the 2-3 rows into the seed csv.with base_trades as (
select
blockchain, project, version, block_date, tx_hash, evt_index,
token_bought_address, token_sold_address, block_number,
token_bought_amount_raw, token_sold_amount_raw,
row_number() over (partition by blockchain, project, version order by block_number desc) as rn
from ( <COMPILED_BASE_TRADES_SQL> )
)
select
blockchain, project, version, block_date, tx_hash, evt_index,
token_bought_address, token_sold_address, block_number,
token_bought_amount_raw, token_sold_amount_raw
from base_trades where rn <= 3
dbt_subprojects/dex/models/trades/<chain>/platforms/kuru_monad_base_trades.sqldbt_subprojects/dex/models/trades/<chain>/platforms/uniswap_v2_monad_base_trades.sqldbt_subprojects/dex/models/trades/<chain>/platforms/uniswap_v3_monad_base_trades.sql