Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aave v3 to lending sector for zkSync #7366

Merged
merged 4 commits into from
Dec 30, 2024
Merged
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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

{%
set models = [
ref('zerolend_zksync_base_borrow')
ref('zerolend_zksync_base_borrow'),
ref('aave_v3_zksync_base_borrow')
]
%}

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

{%
set models = [
ref('zerolend_zksync_base_flashloans')
ref('zerolend_zksync_base_flashloans'),
ref('aave_v3_zksync_base_flashloans')
]
%}

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

{%
set models = [
ref('zerolend_zksync_base_supply')
ref('zerolend_zksync_base_supply'),
ref('aave_v3_zksync_base_supply')
]
%}

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
)
}}
41 changes: 41 additions & 0 deletions dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,borrower,amount
zksync,aave,3,51909048,2024-12-22 12:56:09.000 UTC,0x087a9163c4b4c34a26adb3155ad62de8883d413fdfeb1236f84b6260bec9da48,7,borrow,0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4,0x72fe12b5127162f8f3d1eec3f9d232c98a032f23,110000000
zksync,aave,3,51750031,2024-12-20 11:29:08.000 UTC,0x3a7548fe223e51d74cd4cd2bedcf9122e4853f4209cac2c49e7e9b068c90ebf2,18,borrow_liquidation,0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4,0xd3b2a586180c9e306b38848d31e82f9e17d76f0c,-2770807444
zksync,aave,3,51907646,2024-12-22 12:30:24.000 UTC,0xac913e1cb652b2aaf1aab9e886803c2d27a45f2ebd2b564548b8c5c2012d5021,14,repay,0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4,0x5ba9811dff37ca8639272d509dcadfe5bec4bff7,-4100000
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
blockchain,project,version,block_number,block_time,tx_hash,evt_index,token_address,recipient,amount
zksync,aave,3,51741885,2024-12-20 09:08:30.000 UTC,0x37aa4e84eb810f3cce179819b68a37acdd53104d799e60a851e75f5775faab24,28,0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4,0x41c914a4a619b7969137551904a537db16905d1f,2504231355
zksync,aave,3,51741825,2024-12-20 09:07:29.000 UTC,0x0fa867dd6cccb34159b8bfee8a1757a1af6a3e37f7f2af2f58caab044e684826,28,0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4,0x41c914a4a619b7969137551904a537db16905d1f,210563615
zksync,aave,3,51692496,2024-12-19 18:24:06.000 UTC,0x433e9869c81ae380c4ab360ad6a14a1d56e22a1adf7734b5415bb31485aac494,32,0x493257fd37edb34451f62edf8d2a0c418852ba4c,0x41c914a4a619b7969137551904a537db16905d1f,15509265
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount
zksync,aave,3,51910059,2024-12-22 13:14:37.000 UTC,0xf9fd60b0434f3b32e6f71bffa3d931f570f67fb79e9d5a3856e864c3d413d729,8,deposit,0x5a7d6b2f92c77fad6ccabd7ee0624e64907eaf3e,0xb34247a2ff891caec36375d0e58f95f8d9bf38d6,100000000000000000000
zksync,aave,3,51750031,2024-12-20 11:29:08.000 UTC,0x3a7548fe223e51d74cd4cd2bedcf9122e4853f4209cac2c49e7e9b068c90ebf2,18,deposit_liquidation,0x5a7d6b2f92c77fad6ccabd7ee0624e64907eaf3e,0xd3b2a586180c9e306b38848d31e82f9e17d76f0c,-1.9198338954322615e+22
zksync,aave,3,51215930,2024-12-13 18:06:30.000 UTC,0x8f3e895a74a183300d417869bcaac0edf03a65a9d737af686d222a63967e76f6,8,repay_with_atokens,0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4,0x8a8a757c4c3cbb85450dfb70e61fbcbae3994054,-491998467
zksync,aave,3,51908987,2024-12-22 12:55:05.000 UTC,0x1bf91b597c04a36bcb2d9e7c7e7c3260eb79ebe62f47a6746f5c615511e075dc,26,withdraw,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,0xd5f6c8d402e0a0222f7fa132f9e80fdcc074df5c,-20000005150310010
6 changes: 6 additions & 0 deletions sources/_sector/lending/borrow/zksync/_sources.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions sources/_sector/lending/flashloans/zksync/_sources.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
version: 2

sources:
- name: aave_v3_zksync
tables:
- name: Pool_evt_FlashLoan

- name: zerolend_zksync
tables:
- name: Pool_evt_FlashLoan
6 changes: 6 additions & 0 deletions sources/_sector/lending/supply/zksync/_sources.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading