Skip to content

Conversation

krishgka
Copy link
Contributor

@krishgka krishgka commented Oct 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:

[...]


quick links for more information:


Note

Introduces a Thorchain gold layer: a new thorchain_core_dim_block plus extensive core/defi/gov fact tables wired to it, all incremental with deduplication and documented in schema.yml.

  • Gold Layer Bootstrapping
    • Add thorchain_core_dim_block (time dims, partitioning, incremental merge) from thorchain.block_log.
  • Core Facts (join to dim_block)
    • thorchain_core_fact_{transfer,set_mimir,network_version,instantiate,thorname_change,tss_keygen_success,tss_keygen_failure,wasm_contracts}_events.
  • DeFi Facts (join to dim_block or direct)
    • Events: fact_{active_vault,inactive_vault,affiliate_fee,asgard_fund_yggdrasil,gas,loan_open,loan_repayment,mint_burn,errata,failed_deposit,send,switch,reserve,pending_liquidity,pool,ref​und,outbound}_events.
    • Liquidity/Swaps: fact_{add,withdraw,liquidity_actions,swap_events,swaps,streaming_swap_details}_events.
    • Pool Metrics: fact_{pool_block_balances,block_pool_depths,pool_block_statistics,pool_block_fees}.
    • Rewards/TVL: fact_{rewards_events,rewards_event_entries,total_block_rewards,total_value_locked,daily_tvl,daily_earnings}.
    • Transfers/Upgrades: fact_{transfers,upgrades,bond_events,bond_actions}.
    • Scheduled: fact_scheduled_outbound_events.
  • Governance Facts (join to dim_block)
    • thorchain_gov_fact_{new_node,set_version,set_node_mimir,set_node_keys,set_ip_address,validator_request_leave,slash,slash_points}_events.
  • Processing Patterns
    • Consistent incremental configs (partition by block_month, incremental_predicate), windowed deduplication, surrogate keys, audit fields; several models use Trino-compatible hashing.
  • Documentation
    • Massive schema.yml expansion documenting all new models, columns, and tests (uniqueness/not-null).

Written by Cursor Bugbot for commit 3deed56. Configure here.

@github-actions github-actions bot added the dbt: daily covers the Daily dbt subproject label Oct 17, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment @cursor review or bugbot run to trigger another review on this PR


-- Audit fields (Trino conversions)
a._inserted_timestamp,
cast(from_hex(replace(cast(uuid() as varchar), '-', '')) as varchar) AS _audit_run_id, -- Trino equivalent of invocation_id
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,51 @@
{{ config(
schema = 'thorchain_core',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Schema Misalignment for Thorchain Defi Fact Models

The thorchain_defi_fact_transfers.sql model is configured with schema = 'thorchain_core', conflicting with its thorchain_defi_fact_ naming pattern. This places the model in the wrong schema, deviating from established conventions for thorchain_defi_fact_* models.

Fix in Cursor Fix in Web

@github-actions github-actions bot added the dbt: dex covers the DEX dbt subproject label Oct 19, 2025
@github-actions github-actions bot removed the dbt: dex covers the DEX dbt subproject label Oct 19, 2025
@krishgka krishgka marked this pull request as ready for review October 20, 2025 19:58
@krishgka krishgka requested a review from jeff-dude October 20, 2025 19:59
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Oct 20, 2025
@krishgka krishgka merged commit ae89362 into main Oct 21, 2025
3 checks passed
@krishgka krishgka deleted the thorchain_gold branch October 21, 2025 21:28
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 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 ready-for-review this PR development is complete, please review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant