Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

{% set models = [
ref('ekubo_ethereum_base_liquidity_events'),
ref('ekubo_v3_ethereum_base_liquidity_events')
ref('ekubo_v3_ethereum_base_liquidity_events'),
ref('ekubo_v3_robinhood_base_liquidity_events')
] %}

with base_union as (
Expand Down
3 changes: 2 additions & 1 deletion dbt_subprojects/dex/models/_projects/ekubo/ekubo_pools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

{% set ekubo_models = [
ref('ekubo_ethereum_pools'),
ref('ekubo_v3_ethereum_pools')
ref('ekubo_v3_ethereum_pools'),
ref('ekubo_v3_robinhood_pools')
] %}


Expand Down
109 changes: 109 additions & 0 deletions dbt_subprojects/dex/models/_projects/ekubo/robinhood/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
version: 2

models:

- name: ekubo_v3_robinhood_pools
meta:
blockchain: robinhood
sector: dex
project: ekubo
contributors: moodysalem
config:
tags: ['robinhood', 'pools', 'liquidity', 'ekubo']
description: >
ekubo V3 robinhood DEX pools
data_tests:
- dbt_utils.unique_combination_of_columns:
arguments:
combination_of_columns:
- id
columns:
- &blockchain
name: blockchain
description: "Blockchain which the DEX is deployed"
- &project
name: project
description: "Project name of the DEX"
- &version
name: version
description: "Version of the contract built and deployed by the DEX project"
- &id
name: id
description: "DEX pool id, keccak256 hash of the abi encoded pool key"
data_tests:
- not_null
- &token0
name: token0
description: "First token in pool"
- &token1
name: token1
description: "Second token in pool"
- &creation_block_time
name: creation_block_time
description: "Block time of pool creation"
- &creation_block_number
name: creation_block_number
description: "Block number of pool creation"
- name: contract_address
description: "Contract address used to create the pool"

- name: ekubo_v3_robinhood_base_liquidity_events
meta:
blockchain: robinhood
sector: dex
project: ekubo
contributors: moodysalem
config:
tags: ['robinhood', 'pools', 'liquidity', 'ekubo']
description: >
"ekubo v3 robinhood base liquidity events"
data_tests:
- dbt_utils.unique_combination_of_columns:
arguments:
combination_of_columns:
- tx_hash
- evt_index
- event_type
Comment thread
moodysalem marked this conversation as resolved.
columns:
- *blockchain
- *project
- *version
- *id
- &block_month
name: block_month
description: "UTC event block month"
- &block_date
name: block_date
description: "UTC event block date"
- &block_time
name: block_time
description: "UTC event block time"
- &block_number
name: block_number
description: "Block number of the block in which the trade occurred"
- &tx_hash
name: tx_hash
description: "The hash of the transaction"
data_tests:
- not_null
- &tx_from
name: tx_from
description: "Address that initiated the txn"
- &evt_index
name: evt_index
description: "Index of the event in the transaction. Can be used to uniquely identify the order of events within a transaction"
data_tests:
- not_null
- &event_type
name: event_type
description: "Transaction event type"
data_tests:
- not_null
- *token0
- *token1
- &amount0_raw
name: amount0_raw
description: "Liquidity amount of token0 in units"
- &amount1_raw
name: amount1_raw
description: "Liquidity amount of token1 in units"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ config(
schema = 'ekubo_v3_robinhood'
, alias = 'base_liquidity_events'
, materialized = 'incremental'
, file_format = 'delta'
, incremental_strategy = 'merge'
, unique_key = ['tx_hash', 'evt_index', 'event_type']
, incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
ekubo_compatible_liquidity_events(
blockchain = 'robinhood'
, project = 'ekubo'
, version = '3'
, start_block_number = '33534'
, ekubo_core_contract = '0x00000000000014aA86C5d3c41765bb24e11bd701'
, position_updated = source ('ekubo_v3_robinhood', 'core_evt_positionupdated')
, position_fees_collected = source ('ekubo_v3_robinhood', 'core_evt_positionfeescollected')
, position_fees_accumulated = source ('ekubo_v3_robinhood', 'core_evt_feesaccumulated')
, liquidity_pools = ref('ekubo_v3_robinhood_pools')
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ config(
schema = 'ekubo_v3_robinhood'
, alias = 'pools'
, materialized = 'incremental'
, file_format = 'delta'
, incremental_strategy = 'merge'
, unique_key = ['id']
, incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.creation_block_time')]
)
}}

{{
ekubo_compatible_pools(
blockchain = 'robinhood'
, project = 'ekubo'
, version = '3'
, pool_init = source('ekubo_v3_robinhood', 'core_evt_poolinitialized')
, weth_address = '0x0bd7d308f8e1639fab988df18a8011f41eacad73'
)
}}
28 changes: 28 additions & 0 deletions dbt_subprojects/dex/models/trades/robinhood/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,34 @@ models:
data_tests:
- not_null

- name: ekubo_v3_robinhood_base_trades
meta:
blockchain: robinhood
sector: dex
project: ekubo
contributors: moodysalem
config:
tags: [ 'robinhood', 'dex', 'trades', 'ekubo', 'v3' ]
description: "ekubo robinhood v3 base trades"
data_tests:
- dbt_utils.unique_combination_of_columns:
arguments:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
arguments:
seed_file: ref('ekubo_v3_robinhood_base_trades_seed')
filter:
version: 3
columns:
- name: tx_hash
data_tests:
- not_null
- name: evt_index
data_tests:
- not_null

- name: swaphood_v2_robinhood_base_trades
meta:
blockchain: robinhood
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
ref('uniswap_v2_robinhood_base_trades')
, ref('uniswap_v3_robinhood_base_trades')
, ref('uniswap_v4_robinhood_base_trades')
, ref('ekubo_v3_robinhood_base_trades')
, ref('ramsesxyz_legacy_robinhood_base_trades')
, ref('ramsesxyz_cl_robinhood_base_trades')
, ref('ramsesxyz_dlmm_robinhood_base_trades')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{
config(
schema = 'ekubo_v3_robinhood',
alias = 'base_trades',
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['tx_hash', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

SELECT
'robinhood' AS blockchain
, 'ekubo' AS project
, '3' AS version
, cast(date_trunc( 'month', t.block_time) as date) AS block_month
, cast(date_trunc( 'day', t.block_time) as date) AS block_date
, t.block_time AS block_time
, t.block_number AS block_number
, abs(case when t.amount0_raw <= 0 then t.amount0_raw else t.amount1_raw end) as token_bought_amount_raw
, abs(case when t.amount0_raw >= 0 then t.amount0_raw else t.amount1_raw end) as token_sold_amount_raw
, case when t.amount0_raw <= 0 then token0 else token1 END as token_bought_address
, case when t.amount0_raw >= 0 then token0 else token1 END as token_sold_address
, t.tx_from AS taker
, t.id AS maker
, 0x00000000000014aA86C5d3c41765bb24e11bd701 as project_contract_address
, t.tx_hash
, t.evt_index AS evt_index
FROM {{ ref('ekubo_v3_robinhood_base_liquidity_events') }} t
WHERE event_type = 'swap'
{% if is_incremental() %}
AND {{ incremental_predicate('block_time') }}
{% endif %}
15 changes: 15 additions & 0 deletions dbt_subprojects/dex/seeds/trades/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5598,6 +5598,21 @@ seeds:
token_sold_amount_raw: uint256
block_date: timestamp

- name: ekubo_v3_robinhood_base_trades_seed
config:
column_types:
blockchain: varchar
project: varchar
version: varchar
tx_hash: varbinary
evt_index: uint256
block_number: uint256
token_bought_address: varbinary
token_sold_address: varbinary
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: oku_hemi_base_trades_seed
config:
column_types:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
blockchain,project,version,tx_hash,evt_index,block_number,token_bought_address,token_sold_address,token_bought_amount_raw,token_sold_amount_raw,block_date
robinhood,ekubo,3,0x4de9a2ae4878c85fb202705d85872d9782a195410f5c80aa6fab532ce471d8df,13,24592701,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,32008849559403426,59592418,2026-08-01
robinhood,ekubo,3,0x20404f843b943825e625767a637763b27433d15b44dd0fcdfbfce0e6964a1bbc,25,24595708,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,10939348,5877679453387062,2026-08-01
robinhood,ekubo,3,0xd00604f3191ccd9c48dc97ee6e5526b149013039636a9480695ad1a4cb60dddb,41,24610452,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,3957267,2124167633612117,2026-08-01
robinhood,ekubo,3,0x1eebdaadfeb6437a9b31ca397fb86449e1bbe391d5226c23abb7ccb1bd5c086f,31,24611325,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec,147920365,742481876604654107,2026-08-01
robinhood,ekubo,3,0x5613bf787e3d22cf4d3b80436b879cf302325b3431671616b41fc57836b30d46,8,24612392,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,5795052189499972,10799985,2026-08-01
robinhood,ekubo,3,0xc4ac5b4de9188bb496b701fcf57142537980a7854ad05340ec93c8f0e8c1ad12,15,24612683,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,5007323964859869,9328493,2026-08-01
robinhood,ekubo,3,0x5c45f4c48715e62e4dad4a6b45ccb44203e9475a6b32dc4d08fab2388971fc0f,61,24612780,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0xaf3d76f1834a1d425780943c99ea8a608f8a93f9,11359533,37008161019974491,2026-08-01
robinhood,ekubo,3,0xde04d349acf87a74ac9f5803094b8fb6a45cd077fc59c56fcd311f319bd09562,31,24617048,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,6553639118397600,12216791,2026-08-01
robinhood,ekubo,3,0xe04455b7ae744f651f4b1cdb323122157164fde9787b58897f4283564ecd802c,22,24622286,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec,55372,277849070815652,2026-08-01
robinhood,ekubo,3,0x21fcb858285bbef614e0f2a8ae1ca8261f159604135d83e9583baea4d8512d5c,10,24628785,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,15981679357428185,29767333,2026-08-01
robinhood,ekubo,3,0x05dc1cf55fabf90fd5ce2e6d14e886a749bc9de5d55738ae5eeec4f98a97b3fe,9,24629173,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,62384360008967287,116217292,2026-08-01
robinhood,ekubo,3,0xc2efef48e6bd3c438634f593d0359d5d9e875a04c644955e84396556984fd570,14,24629270,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,124585606,66861012414603144,2026-08-01
robinhood,ekubo,3,0x3490d34ba5a55082a9e7b42dced9eccc24afe0233cdcfb4857982d02a32fe8ec,7,24629464,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,26301161758551251,48998664,2026-08-01
robinhood,ekubo,3,0x862af224364e9f2aa5954d0e1ad2d8c5f479a416fbf03eac7136e28d40f032e5,43,24629561,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,21809542,11701824963406113,2026-08-01
robinhood,ekubo,3,0xe1d57c3bcf4cd2f596f8c9543b90ff713b20102c5848e4d18c09ff8617826483,10,24632083,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,76573416,41092482530664372,2026-08-01
robinhood,ekubo,3,0xfaa8b9070dbc01a7ab2b332ddc44f647674917dc50cb6823e448a5e6b31923b4,18,24633053,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,26743844777176194,49824883,2026-08-01
robinhood,ekubo,3,0x2664d9373dd5df20020d19d970fc41f50adaa11ef3a847a07fc5dca9ecc8af5e,9,24635769,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,3640935476551654,6782744,2026-08-01
robinhood,ekubo,3,0x6bb98caa46ae88a46f17ff77882c638f48f9c67307a942b237340e28ed6a318b,9,24636836,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,78904790961134076,147006944,2026-08-01
robinhood,ekubo,3,0x6398fc36557026a81a33ef0b9e4ff4d8f1172d69d8db75d2d35ae3340c84f068,6,24637515,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,26496968551516996,49363358,2026-08-01
robinhood,ekubo,3,0x265a11d37824c65aac2402ac39b3bac78d164058f47231cced395ccbb9a6bfd1,46,24644984,0x39dbed3a2bd333467115de45665cc57f813c4571,0x5fc5360d0400a0fd4f2af552add042d716f1d168,51835554182906417041,1767632,2026-08-01
robinhood,ekubo,3,0x5d6eb4d08f5adc1428885a158c34672c9ac18fbbca0b514fc6f00f56c35717e6,37,24645566,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,10636709921750107,19819074,2026-08-01
robinhood,ekubo,3,0x971cf08257713636bd82391a0e20edbe1375977de5d3f971f6fabaf34f853e0e,103,24645566,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,19548103,10491279986541915,2026-08-01
robinhood,ekubo,3,0xa435b1aba6d515bf6dda2fac0e438f65548cbcfac743cc8bdb0a8290e75a955c,22,24648185,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,76599500114586323,142716756,2026-08-01
robinhood,ekubo,3,0x59165aaa156d4b633fa9fd97f28fe2603b2731b102406fa55b39496e102eb9c9,39,24648670,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,15975445711479998,29759091,2026-08-01
robinhood,ekubo,3,0x670adaaee183a0daebbfc4604d0f32318b6a0731c018c81e98b912b0f2789549,31,24651289,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,19748565490875099,36778874,2026-08-01
robinhood,ekubo,3,0xa8391935696bceaffe789ffe353506d13c4f6a1dd13735f5e231962886339138,27,24652065,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,10622354139831416,19795050,2026-08-01
robinhood,ekubo,3,0x2eca15e6c0d0af0bc9bc3f9e4a9cb7f7a099f58fd006289562f2918b799e69bb,73,24652356,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,1037548069855367,1933277,2026-08-01
robinhood,ekubo,3,0xcf6d9fda6122aa8aaebce438d7189d1d612b2b667d85c24d1dab3a77809d6aea,17,24656042,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,230608385576813,429704,2026-08-01
robinhood,ekubo,3,0xd8421faf75a66aabbd5be84e996ba4aebd048ca5d3eb50aa8131236b93fb6b81,6,24656430,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,31523185815191907,58743567,2026-08-01
robinhood,ekubo,3,0xd6af5a2346ecdf593869857f288defc0dd822d7f0eea965b95c49b479249e333,5,24657982,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,24860924937929607,46305006,2026-08-01
robinhood,ekubo,3,0xd47bc8b7b477e68a82f7fa2114ed9c26aba63cb28352af1d6b833ad768895b6d,18,24666615,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,13300484335424098,24801570,2026-08-01
robinhood,ekubo,3,0x91e49e03d1e1e2f46325cbf537f02bd5b032278eee0411372bad48a84fb7da06,31,24667876,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,23721166603316503,44215542,2026-08-01
robinhood,ekubo,3,0x6a5f668027bf109a9bdee3eb9d5f3f789572e7a2d28e5b48af1661af44d61a54,36,24667973,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,26518712042482722,49431478,2026-08-01
robinhood,ekubo,3,0xceca5da4d3db117b097cd78c78e7635d468e765f112385d04f21638474875062,37,24668555,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,720287866,386532713335862947,2026-08-01
robinhood,ekubo,3,0x300c1abbc7af894f6d2954f2a9fb2f751fb4f449697f9d1d97717d969660bdb8,15,24675442,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,29818479455379429,55629427,2026-08-01
robinhood,ekubo,3,0x31242017b1dff1955c517bc6a00084bf9284fa8b81646a7445e4da73f81caa88,35,24677382,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,64255165776445847,119985000,2026-08-01
robinhood,ekubo,3,0xf8cd0c119f2ec380f5f195d247aa246378ebfdf6d75b475021522f2e8ba8c7cd,16,24678740,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x117cc2133c37b721f49de2a7a74833232b3b4c0c,279933939,375504120154938338,2026-08-01
robinhood,ekubo,3,0x652101fac6950fbcfe5e72dfbccf86a83b885b7af3e14825e59969585754c0e6,11,24679031,0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x0bd7d308f8e1639fab988df18a8011f41eacad73,15130899,8110250195834460,2026-08-01
robinhood,ekubo,3,0xa58515419447aa304600adaec2839c1e01939a1bafb97aab8f2afaece057dd49,14,24679128,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,6590218257381585,12295218,2026-08-01
robinhood,ekubo,3,0xe552f328e8754d25cc5391828c19ed564a0f761be485b18383e4ae92c37dca49,14,24680777,0x0bd7d308f8e1639fab988df18a8011f41eacad73,0x5fc5360d0400a0fd4f2af552add042d716f1d168,9088529796321506,16953973,2026-08-01
9 changes: 9 additions & 0 deletions sources/_sector/dex/liquidity/robinhood/_sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

sources:
- name: ekubo_v3_robinhood
tables:
- name: core_evt_poolinitialized
- name: core_evt_positionupdated
- name: core_evt_positionfeescollected
- name: core_evt_feesaccumulated
Loading