Repository navigation
Conversation
top_exchanges_by_balance and the two ExchangeAddress address-listing queries each re-aggregated current_label_addresses live (twice per call) to intersect owner labels with the centralized_exchange/ decentralized_exchange marker label - the same expensive join duplicated in 3 places. Switches all 3 to read from labeled_entities_cex_or_dex / exchange_addresses_daily, two tables precomputed once a day by the labeled-entities-names Airflow DAG (santiment/clickhouse-tables#2465, santiment/db-schema#64). Data is now at most ~24h stale instead of live (bounded before only by the 10-minute GraphQL cache). Deploy only after the DAG has populated both tables at least once, or these resolvers will return empty. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
Sanbase.Clickhouse.Exchanges.top_exchanges_by_balanceandSanbase.Clickhouse.ExchangeAddress.exchange_addresses/.exchange_addresses_for_exchangeeach re-aggregatedcurrent_label_addresseslive (twice per call) to intersect owner labels with thecentralized_exchange/decentralized_exchangemarker label - same expensive join duplicated in 3 places.labeled-entities-namesAirflow DAG:labeled_entities_cex_or_dex(santiment/clickhouse-tables#2465, santiment/db-schema#64)exchange_addresses_dailyexchange_type_filter/1inexchange_address.ex, now dead code.Sanbase.ClickhouseRepo.query/3/ExchangeAddressat the function level (not SQL text), so no test changes needed.Behavior change
cache_resolveTTL) to at most ~24h stale (daily DAG run at 6AM).exchange_address.expasses blockchain"xrp"(lowercased) to these queries, but the actual ClickHouseblockchaincolumn value is"ripple"- so xrp-related calls return empty both before and after this change.Dependencies / deploy order
Test plan
topExchangesByBalance(slug: "bitcoin"),allExchanges(slug: "ethereum")return the same shape as beforeSummary by CodeRabbit