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
@@ -0,0 +1,126 @@
version: 2

models:
- name: lending_plasma_base_borrow
meta:
blockchain: plasma
sector: lending
project: aave, compound
contributors: 0xsandeshk
config:
tags: ['lending', 'borrow', 'aave', 'compound', 'plasma']
description: "Aave v1 borrow transactions on Plasma"
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- transaction_type
- token_address
- tx_hash
- evt_index
columns:
- &blockchain
name: blockchain
description: "Blockchain name"
data_tests:
- not_null
- &project
name: project
description: "Project name"
data_tests:
- not_null
- &version
name: version
description: "Version of the contract built and deployed by the lending project"
data_tests:
- not_null
- &transaction_type
name: transaction_type
description: "Transaction type"
data_tests:
- not_null
- &token_address
name: token_address
description: "Token contract address"
data_tests:
- not_null
- &borrower
name: borrower
description: "Borrower wallet address"
- &on_behalf_of
name: on_behalf_of
description: "Wallet address tx was executed on behalf of"
- &repayer
name: repayer
description: "Repayer wallet address"
- &liquidator
name: liquidator
description: "Liquidator wallet address"
- &amount
name: amount
description: "Token amount present in the transaction"
- &block_month
name: block_month
description: "Block month column used to partition data in this table"
- &block_time
name: block_time
description: "Timestamp for block event time in UTC"
data_tests:
- not_null
- &block_number
name: block_number
description: "Event block number"
data_tests:
- not_null
- &project_contract_address
name: project_contract_address
description: "Project contract address"
data_tests:
- not_null
- &tx_hash
name: tx_hash
description: "Transaction hash of the event"
data_tests:
- not_null
- &evt_index
name: evt_index
description: "Event index"
data_tests:
- not_null

- name: aave_v3_plasma_base_borrow
meta:
blockchain: plasma
sector: lending
project: aave
contributors: 0xsandeshk
config:
tags: ['lending', 'borrow', 'aave', 'v3', 'plasma']
description: "Aave v3 borrow transactions on Plasma"
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_plasma_base_borrow_seed')
filter:
version: 3
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
@@ -0,0 +1,39 @@
{{
config(
schema = 'lending_plasma',
alias = 'base_borrow',
materialized = 'view'
)
}}

{%
set models = [

ref('aave_v3_plasma_base_borrow')
]
%}

{% for model in models %}
select
blockchain,
project,
version,
transaction_type,
loan_type,
token_address,
borrower,
on_behalf_of,
repayer,
liquidator,
amount,
block_month,
block_time,
block_number,
project_contract_address,
tx_hash,
evt_index
from {{ model }}
{% if not loop.last %}
union all
{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{
config(
schema = 'aave_v3_plasma',
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 = 'plasma',
project = 'aave',
version = '3',
decoded_contract_name='poolinstance'
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
version: 2

models:
- name: lending_plasma_base_flashloans
meta:
blockchain: plasma
sector: lending
project: aave
contributors: 0xsandeshk
config:
tags: ['lending', 'flashloans', 'aave', 'plasma']
description: "All lending flashloans transactions on Plasma"
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
columns:
- &blockchain
name: blockchain
description: "Blockchain name"
data_tests:
- not_null
- &project
name: project
description: "Project name"
data_tests:
- not_null
- &version
name: version
description: "Version of the contract built and deployed by the lending project"
data_tests:
- not_null
- &recipient
name: recipient
description: "recipient wallet address"
data_tests:
- not_null
- &amount
name: amount
description: "Token amount present in the transaction"
data_tests:
- not_null
- &fee
name: fee
- &block_month
name: block_month
description: "Block month column used to partition data in this table"
- &token_address
name: token_address
- &project_contract_address
name: project_contract_address
data_tests:
- not_null
- &block_time
name: block_time
description: "Timestamp for block event time in UTC"
data_tests:
- not_null
- &block_number
name: block_number
description: "Event block number"
data_tests:
- not_null
- &tx_hash
name: tx_hash
description: "Transaction hash of the event"
data_tests:
- not_null
- &evt_index
name: evt_index
description: "Event index"
data_tests:
- not_null

- name: aave_v3_plasma_base_flashloans
meta:
blockchain: plasma
sector: lending
project: aave
contributors: 0xsandeshk
config:
tags: ['lending', 'flashloans', 'aave', 'plasma']
description: "Aave v3 flashloans transactions on Plasma"
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_lending_base_flashloans_seed:
seed_file: ref('aave_plasma_base_flashloans_seed')
filter:
version: 3
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
@@ -0,0 +1,35 @@
{{
config(
schema = 'lending_plasma',
alias = 'base_flashloans',
materialized = 'view'
)
}}

{%
set models = [

ref('aave_v3_plasma_base_flashloans')
]
%}

{% for model in models %}
select
blockchain,
project,
version,
recipient,
amount,
fee,
token_address,
project_contract_address,
block_month,
block_time,
block_number,
tx_hash,
evt_index
from {{ model }}
{% if not loop.last %}
union all
{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{
config(
schema = 'aave_v3_plasma',
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 = 'plasma',
project = 'aave',
version = '3',
decoded_contract_name = 'poolinstance'
)
}}
Loading