Skip to content

feat(tokens): add Robinhood transfers and gas fees - #9832

Merged
jeff-dude merged 10 commits into
mainfrom
robin/cur2-2165-robinhood-core-models-on-sources
Jul 2, 2026
Merged

feat(tokens): add Robinhood transfers and gas fees#9832
jeff-dude merged 10 commits into
mainfrom
robin/cur2-2165-robinhood-core-models-on-sources

Conversation

@0xRobin

@0xRobin 0xRobin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Adds Robinhood gas fees and token transfer models on top of the Robinhood source definitions from CUR2-2166. This is data-incomplete until Robinhood lands in dune.blockchains/prices metadata: native token classification and gas USD fields depend on that registry row.\n\nValidation: dbt compile for targeted hourly gas and tokens selections.

@cursor

cursor Bot commented Jun 25, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Additive chain onboarding with established macros and tests; no changes to shared business logic beyond union lists.

Overview
Adds Robinhood to the hourly gas and tokens pipelines using the same EVM macros as other chains.

Gas: New gas_robinhood_fees via evm_l1_gas_fees, wired into the cross-chain gas_fees spell and expose list. Seed rows in evm_gas_fees back check_seed tests for multiple tx types.

Tokens: Robinhood-specific base, enriched, and daily net transfer models (transfers_base / transfers_enrich / evm_net_transfers_daily*), with robinhood added to tokens_transfers, tokens_net_transfers_daily, and tokens_net_transfers_daily_asset. Schema YAML documents columns and uniqueness tests.

Per the PR description, USD/native metadata may be incomplete until Robinhood is registered in dune.blockchains/prices.

Reviewed by Cursor Bugbot for commit e493e3e. Configure here.

@github-actions github-actions Bot added WIP work in progress dbt: hourly covers the hourly dbt subproject dbt: tokens covers the Tokens dbt subproject labels Jun 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: MERGE keys lack not_null tests
    • Added column-level not_null data_tests on every unique_key column across the five Robinhood MERGE models in gas_robinhood_schema.yml and tokens robinhood _schema.yml.

Create PR

Or push these changes by commenting:

@cursor push 7be913ddf8
Preview (7be913ddf8)
diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/robinhood/gas_robinhood_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/robinhood/gas_robinhood_schema.yml
--- a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/robinhood/gas_robinhood_schema.yml
+++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/robinhood/gas_robinhood_schema.yml
@@ -31,3 +31,12 @@
             expression: "tx_fee_raw = reduce(map_values(tx_fee_breakdown_raw),uint256 '0',(s, x) -> s + x,s -> s)"
           config:
             where: "block_time > now() - interval '7' day"
+    columns:
+      - name: block_month
+        description: "Month for block event time in UTC"
+        data_tests:
+          - not_null
+      - name: tx_hash
+        description: "Primary key of the transaction"
+        data_tests:
+          - not_null

diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/robinhood/_schema.yml b/dbt_subprojects/tokens/models/transfers_and_balances/robinhood/_schema.yml
--- a/dbt_subprojects/tokens/models/transfers_and_balances/robinhood/_schema.yml
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/robinhood/_schema.yml
@@ -19,10 +19,14 @@
     columns:
       - name: unique_key
         description: "Surrogate key to identify unique row"
+        data_tests:
+          - not_null
       - name: blockchain
         description: "The blockchain of the transfers"
       - name: block_date
         description: "The date of the block"
+        data_tests:
+          - not_null
       - name: block_time
         description: "The time of the block"
       - name: block_number
@@ -70,10 +74,14 @@
     columns:
       - name: unique_key
         description: "Surrogate key to identify unique row"
+        data_tests:
+          - not_null
       - name: blockchain
         description: "The blockchain of the transfers"
       - name: block_date
         description: "The date of the block"
+        data_tests:
+          - not_null
       - name: block_time
         description: "The time of the block"
       - name: block_number
@@ -125,6 +133,15 @@
             combination_of_columns:
               - blockchain
               - block_date
+    columns:
+      - name: blockchain
+        description: "The blockchain of the transfer volume"
+        data_tests:
+          - not_null
+      - name: block_date
+        description: "The date of the transfer volume bucket"
+        data_tests:
+          - not_null
 
   - name: tokens_robinhood_net_transfers_daily_asset
     meta:
@@ -141,3 +158,16 @@
               - blockchain
               - block_date
               - contract_address
+    columns:
+      - name: blockchain
+        description: "The blockchain of the transfer volume"
+        data_tests:
+          - not_null
+      - name: block_date
+        description: "The date of the transfer volume bucket"
+        data_tests:
+          - not_null
+      - name: contract_address
+        description: "The contract address of the asset"
+        data_tests:
+          - not_null

You can send follow-ups to the cloud agent here.

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

Reviewed by Cursor Bugbot for commit e493e3e. Configure here.

0xRobin and others added 3 commits June 25, 2026 15:39
…ting

Robinhood's transactions source exposes l1_fee, l1_gas_used, l1_gas_price,
and l1_fee_scalar columns (confirmed by docs.robinhood.com/chain/gas-and-fees
describing a two-part L2 execution + L1 data fee model), matching the
OP-stack column shape used by base/optimism/opbnb rather than Arbitrum's
gas_used_for_l1 pattern. The generic evm_l1_gas_fees macro ignores l1_fee
entirely, undercounting tx_fee_raw/tx_fee_breakdown for any L1 data cost.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jeff-dude

Copy link
Copy Markdown
Member

While reviewing this PR I checked whether gas_robinhood_fees.sql was handling L1 data-posting fees correctly.

Finding: the model used the generic evm_l1_gas_fees(blockchain) macro, which only computes base_fee/priority_fee and has no notion of an L1 fee. But robinhood_base_sources.yml declares l1_fee, l1_gas_used, l1_gas_price, and l1_fee_scalar on the transactions source — the same column set used by base, optimism, and opbnb. Robinhood's own docs (docs.robinhood.com/chain/gas-and-fees) confirm it charges a two-part fee: an L2 execution fee (like Ethereum gas) plus an L1 data fee for posting calldata to Ethereum — so this isn't optional, real transactions will have a non-zero l1_fee.

Fix: swapped to op_stack_gas_fees(blockchain), the shared macro already used by base/optimism/zora/opbnb for chains with this exact column shape. It folds l1_fee into tx_fee_raw and breaks it out in tx_fee_breakdown_raw, matching the pattern used everywhere else with these columns. Pushed as a follow-up commit on this branch — dbt parse passes.

(Arbitrum's model is not the right template here — it uses a different column, gas_used_for_l1, rather than a direct l1_fee field.)

Addresses bugbot review: block_month/tx_hash on gas_robinhood_fees and
block_date/unique_key on tokens_robinhood_base_transfers and
tokens_robinhood_transfers are MERGE unique_key columns with no not_null
coverage, so a null key could silently break incremental dedup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jeff-dude
jeff-dude marked this pull request as ready for review July 2, 2026 00:02
@github-actions github-actions Bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Jul 2, 2026
@jeff-dude
jeff-dude changed the base branch from robin/cur2-2166-robinhood-sources to main July 2, 2026 00:14
@jeff-dude

Copy link
Copy Markdown
Member

blocked by prices getting into prices.hour via restatement plan.
currently that is failing on dupes in the hybrid layer somehow, seemingly unrelated to robinhood additions.
i will try to get around that for now and ensure at least coinpaprika side is updated to unblock here.

@jeff-dude

Copy link
Copy Markdown
Member

blocked by prices getting into prices.hour via restatement plan. currently that is failing on dupes in the hybrid layer somehow, seemingly unrelated to robinhood additions. i will try to get around that for now and ensure at least coinpaprika side is updated to unblock here.

prices for two main assets in place, CI table writing as expected.

@jeff-dude

Copy link
Copy Markdown
Member

will run databricks script right after prod build.

@jeff-dude
jeff-dude merged commit 950a9cf into main Jul 2, 2026
11 checks passed
@jeff-dude
jeff-dude deleted the robin/cur2-2165-robinhood-core-models-on-sources branch July 2, 2026 18:48
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dbt: hourly covers the hourly 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.

2 participants