diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/_schema.yml index bc19690a235..02e1156a4f7 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/_schema.yml @@ -122,3 +122,39 @@ models: - *project_contract_address - *tx_hash - *evt_index + + - name: aave_v3_zksync_base_borrow + meta: + blockchain: zksync + sector: lending + project: aave + contributors: tomfutago + config: + tags: ['lending', 'borrow', 'aave', 'aave', 'zksync'] + description: "Aave v3 borrow transactions on zkSync" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - transaction_type + - token_address + - tx_hash + - evt_index + - check_lending_base_borrow_seed: + seed_file: ref('aave_zksync_base_borrow_seed') + columns: + - *blockchain + - *project + - *version + - *transaction_type + - *token_address + - *borrower + - *on_behalf_of + - *repayer + - *liquidator + - *amount + - *block_month + - *block_time + - *block_number + - *project_contract_address + - *tx_hash + - *evt_index diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql index dbf3b1513d0..319851e2ca1 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql @@ -8,7 +8,8 @@ {% set models = [ - ref('zerolend_zksync_base_borrow') + ref('zerolend_zksync_base_borrow'), + ref('aave_v3_zksync_base_borrow') ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/platforms/aave_v3_zksync_base_borrow.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/platforms/aave_v3_zksync_base_borrow.sql new file mode 100644 index 00000000000..3005353d5c0 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/zksync/platforms/aave_v3_zksync_base_borrow.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'aave_v3_zksync', + alias = 'base_borrow', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['transaction_type', 'token_address', 'tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_borrow( + blockchain = 'zksync', + project = 'aave', + version = '3' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/_schema.yml index 66d8e027203..894c67705cc 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/_schema.yml @@ -3,12 +3,12 @@ version: 2 models: - name: lending_flashloans meta: - blockchain: ethereum, celo, polygon, optimism, base, arbitrum, avalanche_c, fantom, gnosis, scroll, zksync + blockchain: ethereum, celo, polygon, optimism, base, arbitrum, avalanche_c, fantom, gnosis, zksync, zksync sector: lending project: aave contributors: tomfutago, hildobby config: - tags: ['lending', 'flashloans', 'aave', 'ethereum', 'celo', 'polygon', 'optimism', 'base', 'arbitrum', 'avalanche_c', 'fantom', 'gnosis', 'scroll', 'zksync'] + tags: ['lending', 'flashloans', 'aave', 'ethereum', 'celo', 'polygon', 'optimism', 'base', 'arbitrum', 'avalanche_c', 'fantom', 'gnosis', 'zksync', 'zksync'] description: "All lending transactions involving flashloans transactions" data_tests: - dbt_utils.unique_combination_of_columns: @@ -86,3 +86,34 @@ models: description: "Event index" data_tests: - not_null + + - name: aave_v3_zksync_base_flashloans + meta: + blockchain: zksync + sector: lending + project: aave + contributors: tomfutago + config: + tags: ['lending', 'flashloans', 'aave', 'zksync'] + description: "Aave v3 flashloans transactions on zkSync" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_lending_base_flashloans_seed: + seed_file: ref('aave_zksync_base_flashloans_seed') + columns: + - *blockchain + - *project + - *version + - *recipient + - *amount + - *fee + - *token_address + - *project_contract_address + - *block_month + - *block_time + - *block_number + - *tx_hash + - *evt_index diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql index ad81e72af5a..943eeea517b 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql @@ -8,7 +8,8 @@ {% set models = [ - ref('zerolend_zksync_base_flashloans') + ref('zerolend_zksync_base_flashloans'), + ref('aave_v3_zksync_base_flashloans') ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/zksync/platforms/aave_v3_zksync_base_flashloans.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/zksync/platforms/aave_v3_zksync_base_flashloans.sql new file mode 100644 index 00000000000..821ae724b6c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/zksync/platforms/aave_v3_zksync_base_flashloans.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'aave_v3_zksync', + alias = 'base_flashloans', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_flashloans( + blockchain = 'zksync', + project = 'aave', + version = '3' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/_schema.yml index e5b4b2c38a4..ec65df69324 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/_schema.yml @@ -122,3 +122,39 @@ models: - *project_contract_address - *tx_hash - *evt_index + + - name: aave_v3_zksync_base_supply + meta: + blockchain: zksync + sector: lending + project: aave + contributors: tomfutago + config: + tags: ['lending', 'supply', 'aave', 'zksync'] + description: "Aave v3 supply transactions on zkSync" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - transaction_type + - token_address + - tx_hash + - evt_index + - check_lending_base_supply_seed: + seed_file: ref('aave_zksync_base_supply_seed') + columns: + - *blockchain + - *project + - *version + - *transaction_type + - *token_address + - *depositor + - *on_behalf_of + - *withdrawn_to + - *liquidator + - *amount + - *block_month + - *block_time + - *block_number + - *project_contract_address + - *tx_hash + - *evt_index diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql index 4cbc152960f..831f1cc0f72 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql @@ -8,7 +8,8 @@ {% set models = [ - ref('zerolend_zksync_base_supply') + ref('zerolend_zksync_base_supply'), + ref('aave_v3_zksync_base_supply') ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/platforms/aave_v3_zksync_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/platforms/aave_v3_zksync_base_supply.sql new file mode 100644 index 00000000000..9b51483bad5 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/zksync/platforms/aave_v3_zksync_base_supply.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'aave_v3_zksync', + alias = 'base_supply', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['transaction_type', 'token_address', 'tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_supply( + blockchain = 'zksync', + project = 'aave', + version = '3' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml index f434216529b..e767291113e 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml @@ -168,6 +168,20 @@ seeds: token_address: varbinary borrower: varbinary amount: double +- name: aave_zksync_base_borrow_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + transaction_type: varchar + token_address: varbinary + borrower: varbinary + amount: double - name: aave_arbitrum_base_supply_seed config: @@ -337,6 +351,20 @@ seeds: token_address: varbinary depositor: varbinary amount: double + - name: aave_zksync_base_supply_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + transaction_type: varchar + token_address: varbinary + depositor: varbinary + amount: double - name: aave_arbitrum_base_flashloans_seed config: @@ -494,6 +522,19 @@ seeds: token_address: varbinary recipient: varbinary amount: double + - name: aave_zksync_base_flashloans_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + token_address: varbinary + recipient: varbinary + amount: double - name: moola_celo_base_borrow_seed config: diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_borrow_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_borrow_seed.csv new file mode 100644 index 00000000000..f40ede6c41e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_borrow_seed.csv @@ -0,0 +1 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,borrower,amount diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_flashloans_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_flashloans_seed.csv new file mode 100644 index 00000000000..7a805e33930 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_flashloans_seed.csv @@ -0,0 +1 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,token_address,recipient,amount diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_supply_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_supply_seed.csv new file mode 100644 index 00000000000..cbbc8fa554b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_zksync_base_supply_seed.csv @@ -0,0 +1 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount diff --git a/sources/_sector/lending/borrow/zksync/_sources.yml b/sources/_sector/lending/borrow/zksync/_sources.yml index eba64c2b327..a05983f222e 100644 --- a/sources/_sector/lending/borrow/zksync/_sources.yml +++ b/sources/_sector/lending/borrow/zksync/_sources.yml @@ -1,6 +1,12 @@ version: 2 sources: + - name: aave_v3_zksync + tables: + - name: Pool_evt_Borrow + - name: Pool_evt_Repay + - name: Pool_evt_LiquidationCall + - name: zerolend_zksync tables: - name: Pool_evt_Borrow diff --git a/sources/_sector/lending/flashloans/zksync/_sources.yml b/sources/_sector/lending/flashloans/zksync/_sources.yml index 4d3acf5e19e..33180194b58 100644 --- a/sources/_sector/lending/flashloans/zksync/_sources.yml +++ b/sources/_sector/lending/flashloans/zksync/_sources.yml @@ -1,6 +1,10 @@ version: 2 sources: + - name: aave_v3_zksync + tables: + - name: Pool_evt_FlashLoan + - name: zerolend_zksync tables: - name: Pool_evt_FlashLoan diff --git a/sources/_sector/lending/supply/zksync/_sources.yml b/sources/_sector/lending/supply/zksync/_sources.yml index 40e2f2be49f..18e8fe9ac4b 100644 --- a/sources/_sector/lending/supply/zksync/_sources.yml +++ b/sources/_sector/lending/supply/zksync/_sources.yml @@ -1,6 +1,12 @@ version: 2 sources: + - name: aave_v3_zksync + tables: + - name: Pool_evt_Supply + - name: Pool_evt_Withdraw + - name: WrappedTokenGatewayV3_call_withdrawETH + - name: zerolend_zksync tables: - name: Pool_evt_Supply