From ec39d9746936e920500840754934579a33436fa7 Mon Sep 17 00:00:00 2001 From: Austin <93135983+austinFlipside@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:03:14 -0400 Subject: [PATCH 1/3] docs (#365) --- .../defi/defi__dim_dex_liquidity_pools.yml | 32 --------- models/gold/defi/defi__ez_bridge_activity.yml | 56 --------------- models/gold/defi/defi__ez_dex_swaps.yml | 56 --------------- .../defi/lending/defi__ez_lending_borrows.sql | 49 ------------- .../defi/lending/defi__ez_lending_borrows.yml | 46 ------------ .../lending/defi__ez_lending_deposits.sql | 49 ------------- .../lending/defi__ez_lending_deposits.yml | 46 ------------ .../lending/defi__ez_lending_flashloans.sql | 53 -------------- .../lending/defi__ez_lending_flashloans.yml | 54 -------------- .../lending/defi__ez_lending_liquidations.sql | 52 -------------- .../lending/defi__ez_lending_liquidations.yml | 52 -------------- .../lending/defi__ez_lending_repayments.sql | 50 ------------- .../lending/defi__ez_lending_repayments.yml | 48 ------------- .../lending/defi__ez_lending_withdraws.sql | 49 ------------- .../lending/defi__ez_lending_withdraws.yml | 46 ------------ .../gold/governance/gov__fact_delegations.yml | 14 ++-- models/gold/nft/nft__ez_nft_sales.yml | 70 ------------------- .../synthetix/silver_dex__synthetix_swaps.yml | 4 -- packages.yml | 2 +- 19 files changed, 8 insertions(+), 820 deletions(-) delete mode 100644 models/gold/defi/defi__dim_dex_liquidity_pools.yml delete mode 100644 models/gold/defi/defi__ez_bridge_activity.yml delete mode 100644 models/gold/defi/defi__ez_dex_swaps.yml delete mode 100644 models/gold/defi/lending/defi__ez_lending_borrows.sql delete mode 100644 models/gold/defi/lending/defi__ez_lending_borrows.yml delete mode 100644 models/gold/defi/lending/defi__ez_lending_deposits.sql delete mode 100644 models/gold/defi/lending/defi__ez_lending_deposits.yml delete mode 100644 models/gold/defi/lending/defi__ez_lending_flashloans.sql delete mode 100644 models/gold/defi/lending/defi__ez_lending_flashloans.yml delete mode 100644 models/gold/defi/lending/defi__ez_lending_liquidations.sql delete mode 100644 models/gold/defi/lending/defi__ez_lending_liquidations.yml delete mode 100644 models/gold/defi/lending/defi__ez_lending_repayments.sql delete mode 100644 models/gold/defi/lending/defi__ez_lending_repayments.yml delete mode 100644 models/gold/defi/lending/defi__ez_lending_withdraws.sql delete mode 100644 models/gold/defi/lending/defi__ez_lending_withdraws.yml delete mode 100644 models/gold/nft/nft__ez_nft_sales.yml diff --git a/models/gold/defi/defi__dim_dex_liquidity_pools.yml b/models/gold/defi/defi__dim_dex_liquidity_pools.yml deleted file mode 100644 index 27531cbd..00000000 --- a/models/gold/defi/defi__dim_dex_liquidity_pools.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: 2 -models: - - name: defi__dim_dex_liquidity_pools - description: '{{ doc("evm_dim_dex_lp_table_doc") }}' - - columns: - - name: CREATION_BLOCK - description: '{{ doc("evm_dex_creation_block") }}' - - name: CREATION_TIME - description: '{{ doc("evm_dex_creation_time") }}' - - name: CREATION_TX - description: '{{ doc("evm_dex_creation_tx") }}' - - name: FACTORY_ADDRESS - description: '{{ doc("evm_dex_factory_address") }}' - - name: PLATFORM - description: '{{ doc("evm_dex_platform") }}' - - name: POOL_ADDRESS - description: '{{ doc("evm_dex_pool_address") }}' - - name: POOL_NAME - description: '{{ doc("evm_dex_pool_name") }}' - - name: TOKENS - description: '{{ doc("evm_dex_lp_tokens") }}' - - name: SYMBOLS - description: '{{ doc("evm_dex_lp_symbols") }}' - - name: DECIMALS - description: '{{ doc("evm_dex_lp_decimals") }}' - - name: DIM_DEX_LIQUIDITY_POOLS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/defi__ez_bridge_activity.yml b/models/gold/defi/defi__ez_bridge_activity.yml deleted file mode 100644 index e017b80e..00000000 --- a/models/gold/defi/defi__ez_bridge_activity.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: 2 -models: - - name: defi__ez_bridge_activity - description: '{{ doc("evm_ez_bridge_activity_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_bridge_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: PLATFORM - description: '{{ doc("evm_bridge_platform") }}' - - name: SENDER - description: '{{ doc("evm_bridge_sender") }}' - - name: RECEIVER - description: '{{ doc("evm_bridge_receiver") }}' - - name: DESTINATION_CHAIN_RECEIVER - description: '{{ doc("evm_bridge_destination_chain_receiver") }}' - - name: DESTINATION_CHAIN - description: '{{ doc("evm_bridge_destination_chain") }}' - - name: DESTINATION_CHAIN_ID - description: '{{ doc("evm_bridge_destination_chain_id") }}' - - name: BRIDGE_ADDRESS - description: '{{ doc("evm_bridge_address") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("evm_bridge_token_address") }}' - - name: TOKEN_SYMBOL - description: '{{ doc("evm_bridge_token_symbol") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("evm_bridge_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("evm_bridge_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("evm_bridge_amount_usd") }}' - - name: TOKEN_IS_VERIFIED - description: '{{ doc("evm_prices_is_verified") }}' - - name: EZ_BRIDGE_ACTIVITY_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/defi__ez_dex_swaps.yml b/models/gold/defi/defi__ez_dex_swaps.yml deleted file mode 100644 index dd031195..00000000 --- a/models/gold/defi/defi__ez_dex_swaps.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: 2 -models: - - name: defi__ez_dex_swaps - description: '{{ doc("evm_ez_dex_swaps_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: AMOUNT_IN - description: '{{ doc("evm_dex_swaps_amount_in") }}' - - name: AMOUNT_OUT - description: '{{ doc("evm_dex_swaps_amount_out") }}' - - name: AMOUNT_IN_USD - description: '{{ doc("evm_dex_swaps_amount_in_usd") }}' - - name: AMOUNT_OUT_USD - description: '{{ doc("evm_dex_swaps_amount_out_usd") }}' - - name: TOKEN_IN - description: '{{ doc("evm_dex_swaps_token_in") }}' - - name: TOKEN_OUT - description: '{{ doc("evm_dex_swaps_token_out") }}' - - name: SYMBOL_IN - description: '{{ doc("evm_dex_swaps_symbol_in") }}' - - name: SYMBOL_OUT - description: '{{ doc("evm_dex_swaps_symbol_out") }}' - - name: SENDER - description: '{{ doc("evm_dex_swaps_sender") }}' - - name: TX_TO - description: '{{ doc("evm_dex_swaps_tx_to") }}' - - name: PLATFORM - description: '{{ doc("evm_dex_platform") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_tx_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: AMOUNT_IN_UNADJ - description: '{{ doc("evm_dex_swaps_amount_in_unadj") }}' - - name: AMOUNT_OUT_UNADJ - description: '{{ doc("evm_dex_swaps_amount_out_unadj") }}' - - name: EZ_DEX_SWAPS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.sql b/models/gold/defi/lending/defi__ez_lending_borrows.sql deleted file mode 100644 index 282d8789..00000000 --- a/models/gold/defi/lending/defi__ez_lending_borrows.sql +++ /dev/null @@ -1,49 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'SONNE, AAVE, GRANARY, TAROT, EXACTLY', - 'PURPOSE': 'LENDING, BORROWS' - } - } - }, - tags = ['gold','defi','lending','curated','ez'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - platform, - protocol_market, - borrower, - token_address, - token_symbol, - amount_unadj, - amount, - amount_usd, - COALESCE ( - complete_lending_borrows_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_lending_borrows_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__complete_lending_borrows') }} \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.yml b/models/gold/defi/lending/defi__ez_lending_borrows.yml deleted file mode 100644 index dea40466..00000000 --- a/models/gold/defi/lending/defi__ez_lending_borrows.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2 -models: - - name: defi__ez_lending_borrows - description: '{{ doc("evm_complete_lending_borrows_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: PLATFORM - description: '{{ doc("evm_complete_lending_platform") }}' - - name: PROTOCOL_MARKET - description: '{{ doc("evm_complete_lending_protocol_token") }}' - - name: BORROWER - description: '{{ doc("evm_complete_lending_borrower") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("evm_complete_lending_token_address") }}' - - name: TOKEN_SYMBOL - description: '{{ doc("evm_complete_lending_token_symbol") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("evm_complete_lending_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("evm_complete_lending_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("evm_complete_lending_amount_usd") }}' - - name: EZ_LENDING_BORROWS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_deposits.sql b/models/gold/defi/lending/defi__ez_lending_deposits.sql deleted file mode 100644 index 21b3b466..00000000 --- a/models/gold/defi/lending/defi__ez_lending_deposits.sql +++ /dev/null @@ -1,49 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'SONNE, AAVE, GRANARY, TAROT, EXACTLY', - 'PURPOSE': 'LENDING, DEPOSITS' - } - } - }, - tags = ['gold','defi','lending','curated','ez'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - platform, - protocol_market, - depositor, - token_address, - token_symbol, - amount_unadj, - amount, - amount_usd, - COALESCE ( - complete_lending_deposits_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_lending_deposits_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__complete_lending_deposits') }} \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_deposits.yml b/models/gold/defi/lending/defi__ez_lending_deposits.yml deleted file mode 100644 index c0a10a43..00000000 --- a/models/gold/defi/lending/defi__ez_lending_deposits.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2 -models: - - name: defi__ez_lending_deposits - description: '{{ doc("evm_complete_lending_deposits_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: PLATFORM - description: '{{ doc("evm_complete_lending_platform") }}' - - name: PROTOCOL_MARKET - description: '{{ doc("evm_complete_lending_protocol_token") }}' - - name: DEPOSITOR - description: '{{ doc("evm_complete_lending_depositor") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("evm_complete_lending_token_address") }}' - - name: TOKEN_SYMBOL - description: '{{ doc("evm_complete_lending_token_symbol") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("evm_complete_lending_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("evm_complete_lending_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("evm_complete_lending_amount_usd") }}' - - name: EZ_LENDING_DEPOSITS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_flashloans.sql b/models/gold/defi/lending/defi__ez_lending_flashloans.sql deleted file mode 100644 index ffb156a0..00000000 --- a/models/gold/defi/lending/defi__ez_lending_flashloans.sql +++ /dev/null @@ -1,53 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'AAVE, GRANARY', - 'PURPOSE': 'LENDING, FLASHLOANS' - } - } - }, - tags = ['gold','defi','lending','curated','ez'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - platform, - initiator, - target, - protocol_market, - flashloan_token, - flashloan_token_symbol, - flashloan_amount_unadj, - flashloan_amount, - flashloan_amount_usd, - premium_amount_unadj, - premium_amount, - premium_amount_usd, - COALESCE ( - complete_lending_flashloans_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_lending_flashloans_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__complete_lending_flashloans') }} \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_flashloans.yml b/models/gold/defi/lending/defi__ez_lending_flashloans.yml deleted file mode 100644 index 3e26134e..00000000 --- a/models/gold/defi/lending/defi__ez_lending_flashloans.yml +++ /dev/null @@ -1,54 +0,0 @@ -version: 2 -models: - - name: defi__ez_lending_flashloans - description: '{{ doc("evm_complete_lending_flashloans_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: PLATFORM - description: '{{ doc("evm_complete_lending_platform") }}' - - name: INITIATOR - description: '{{ doc("evm_complete_lending_initiator_address") }}' - - name: TARGET - description: '{{ doc("evm_complete_lending_target_address") }}' - - name: PROTOCOL_MARKET - description: '{{ doc("evm_complete_lending_protocol_token") }}' - - name: FLASHLOAN_TOKEN - description: '{{ doc("evm_complete_lending_flashloan_token") }}' - - name: FLASHLOAN_TOKEN_SYMBOL - description: '{{ doc("evm_complete_lending_flashloan_token_symbol") }}' - - name: FLASHLOAN_AMOUNT_UNADJ - description: '{{ doc("evm_complete_lending_flashloan_amount_unadj") }}' - - name: FLASHLOAN_AMOUNT - description: '{{ doc("evm_complete_lending_flashloan_amount") }}' - - name: FLASHLOAN_AMOUNT_USD - description: '{{ doc("evm_complete_lending_flashloan_amount_usd") }}' - - name: PREMIUM_AMOUNT_UNADJ - description: '{{ doc("evm_complete_lending_premium_amount_unadj") }}' - - name: PREMIUM_AMOUNT - description: '{{ doc("evm_complete_lending_premium_amount") }}' - - name: PREMIUM_AMOUNT_USD - description: '{{ doc("evm_complete_lending_premium_amount_usd") }}' - - name: EZ_LENDING_FLASHLOANS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.sql b/models/gold/defi/lending/defi__ez_lending_liquidations.sql deleted file mode 100644 index a1412a74..00000000 --- a/models/gold/defi/lending/defi__ez_lending_liquidations.sql +++ /dev/null @@ -1,52 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'SONNE, AAVE, GRANARY, TAROT, EXACTLY', - 'PURPOSE': 'LENDING, LIQUIDATIONS' - } - } - }, - tags = ['gold','defi','lending','curated','ez'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - platform, - liquidator, - borrower, - protocol_market, - collateral_token, - collateral_token_symbol, - amount_unadj, - amount, - amount_usd, - debt_token, - debt_token_symbol, - COALESCE ( - complete_lending_liquidations_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_lending_liquidations_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__complete_lending_liquidations') }} \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.yml b/models/gold/defi/lending/defi__ez_lending_liquidations.yml deleted file mode 100644 index d8b189a3..00000000 --- a/models/gold/defi/lending/defi__ez_lending_liquidations.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: 2 -models: - - name: defi__ez_lending_liquidations - description: '{{ doc("evm_complete_lending_liquidations_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: PLATFORM - description: '{{ doc("evm_complete_lending_platform") }}' - - name: LIQUIDATOR - description: '{{ doc("evm_complete_lending_liquidator") }}' - - name: BORROWER - description: '{{ doc("evm_complete_lending_borrower") }}' - - name: PROTOCOL_MARKET - description: '{{ doc("evm_complete_lending_protocol_token") }}' - - name: COLLATERAL_TOKEN - description: '{{ doc("evm_complete_lending_collateral_asset") }}' - - name: COLLATERAL_TOKEN_SYMBOL - description: '{{ doc("evm_complete_lending_token_symbol") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("evm_complete_lending_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("evm_complete_lending_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("evm_complete_lending_amount_usd") }}' - - name: DEBT_TOKEN - description: '{{ doc("evm_complete_lending_debt_asset") }}' - - name: DEBT_TOKEN_SYMBOL - description: '{{ doc("evm_complete_lending_token_symbol") }}' - - name: EZ_LENDING_LIQUDATIONS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_repayments.sql b/models/gold/defi/lending/defi__ez_lending_repayments.sql deleted file mode 100644 index 77a0f61f..00000000 --- a/models/gold/defi/lending/defi__ez_lending_repayments.sql +++ /dev/null @@ -1,50 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'SONNE, AAVE, GRANARY, TAROT, EXACTLY', - 'PURPOSE': 'LENDING, REPAYMENTS' - } - } - }, - tags = ['gold','defi','lending','curated','ez'] -) }} - -SELECT - block_number, - block_timestamp, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_hash, - event_index, - contract_address, - event_name, - platform, - payer, - borrower, - protocol_market, - token_address, - token_symbol, - amount_unadj, - amount, - amount_usd, - COALESCE ( - complete_lending_repayments_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_lending_repayments_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__complete_lending_repayments') }} \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_repayments.yml b/models/gold/defi/lending/defi__ez_lending_repayments.yml deleted file mode 100644 index 01c40dbf..00000000 --- a/models/gold/defi/lending/defi__ez_lending_repayments.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 2 -models: - - name: defi__ez_lending_repayments - description: '{{ doc("evm_complete_lending_repayments_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: PLATFORM - description: '{{ doc("evm_complete_lending_platform") }}' - - name: PAYER - description: '{{ doc("evm_complete_lending_payer") }}' - - name: BORROWER - description: '{{ doc("evm_complete_lending_borrower") }}' - - name: PROTOCOL_MARKET - description: '{{ doc("evm_complete_lending_protocol_token") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("evm_complete_lending_token_address") }}' - - name: TOKEN_SYMBOL - description: '{{ doc("evm_complete_lending_token_symbol") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("evm_complete_lending_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("evm_complete_lending_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("evm_complete_lending_amount_usd") }}' - - name: EZ_LENDING_REPAYMENTS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_withdraws.sql b/models/gold/defi/lending/defi__ez_lending_withdraws.sql deleted file mode 100644 index 6d594815..00000000 --- a/models/gold/defi/lending/defi__ez_lending_withdraws.sql +++ /dev/null @@ -1,49 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'SONNE, AAVE, GRANARY, TAROT, EXACTLY', - 'PURPOSE': 'LENDING, WITHDRAWS' - } - } - }, - tags = ['gold','defi','lending','curated','ez'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - platform, - depositor, - protocol_market, - token_address, - token_symbol, - amount_unadj, - amount, - amount_usd, - COALESCE ( - complete_lending_withdraws_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_lending_withdraws_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__complete_lending_withdraws') }} \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_withdraws.yml b/models/gold/defi/lending/defi__ez_lending_withdraws.yml deleted file mode 100644 index 1c088169..00000000 --- a/models/gold/defi/lending/defi__ez_lending_withdraws.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2 -models: - - name: defi__ez_lending_withdraws - description: '{{ doc("evm_complete_lending_withdraws_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("evm_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: PLATFORM - description: '{{ doc("evm_complete_lending_platform") }}' - - name: DEPOSITOR - description: '{{ doc("evm_borrower") }}' - - name: PROTOCOL_MARKET - description: '{{ doc("evm_complete_lending_protocol_token") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("evm_complete_lending_token_address") }}' - - name: TOKEN_SYMBOL - description: '{{ doc("evm_complete_lending_token_symbol") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("evm_complete_lending_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("evm_complete_lending_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("evm_complete_lending_amount_usd") }}' - - name: EZ_LENDING_WITHDRAWS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/governance/gov__fact_delegations.yml b/models/gold/governance/gov__fact_delegations.yml index 615d3639..b757e125 100644 --- a/models/gold/governance/gov__fact_delegations.yml +++ b/models/gold/governance/gov__fact_delegations.yml @@ -4,13 +4,13 @@ models: description: 'This table contains the details of the OP Delegations made by users on the Optimism network.' columns: - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' + description: '{{ doc("general_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' + description: '{{ doc("general_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("evm_tx_hash") }}' + description: '{{ doc("general_tx_hash") }}' - name: STATUS - description: '{{ doc("evm_tx_status") }}' + description: 'The status of the tx, can be "Success" or "Failed"' - name: DELEGATOR description: 'The address of the delegator' - name: DELEGATE @@ -30,8 +30,8 @@ models: - name: FROM_DELEGATE description: 'The address of the delegate from which the delegator has delegated their votes' - name: FACT_DELEGATIONS_ID - description: '{{ doc("evm_pk") }}' + description: '{{ doc("general_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' + description: '{{ doc("general_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("general_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/nft__ez_nft_sales.yml b/models/gold/nft/nft__ez_nft_sales.yml deleted file mode 100644 index a4003b15..00000000 --- a/models/gold/nft/nft__ez_nft_sales.yml +++ /dev/null @@ -1,70 +0,0 @@ -version: 2 -models: - - name: nft__ez_nft_sales - description: '{{ doc("evm_ez_nft_sales_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_nft_block_no") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_nft_blocktime") }}' - - name: TX_HASH - description: '{{ doc("evm_nft_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_nft_event_index") }}' - - name: EVENT_TYPE - description: '{{ doc("evm_nft_event_type") }}' - - name: PLATFORM_ADDRESS - description: '{{ doc("evm_nft_platform_address") }}' - - name: PLATFORM_NAME - description: '{{ doc("evm_nft_platform_name") }}' - - name: PLATFORM_EXCHANGE_VERSION - description: '{{ doc("evm_nft_platform_exchange_version") }}' - - name: AGGREGATOR_NAME - description: '{{ doc("evm_nft_aggregator_name") }}' - - name: SELLER_ADDRESS - description: '{{ doc("evm_nft_seller_address") }}' - - name: BUYER_ADDRESS - description: '{{ doc("evm_nft_buyer_address") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_nft_address") }}' - - name: NAME - description: '{{ doc("evm_nft_project_name") }}' - - name: TOKEN_ID - description: '{{ doc("evm_nft_tokenid") }}' - - name: QUANTITY - description: '{{ doc("evm_nft_quantity") }}' - - name: TOKEN_STANDARD - description: '{{ doc("evm_token_standard") }}' - - name: CURRENCY_SYMBOL - description: '{{ doc("evm_nft_currency_symbol") }}' - - name: CURRENCY_ADDRESS - description: '{{ doc("evm_nft_currency_address") }}' - - name: PRICE - description: '{{ doc("evm_nft_price") }}' - - name: PRICE_USD - description: '{{ doc("evm_nft_price_usd") }}' - - name: TOTAL_FEES - description: '{{ doc("evm_nft_total_fees") }}' - - name: PLATFORM_FEE - description: '{{ doc("evm_nft_platform_fee") }}' - - name: CREATOR_FEE - description: '{{ doc("evm_nft_creator_fee") }}' - - name: TOTAL_FEES_USD - description: '{{ doc("evm_nft_total_fees_usd") }}' - - name: PLATFORM_FEE_USD - description: '{{ doc("evm_nft_platform_fee_usd") }}' - - name: CREATOR_FEE_USD - description: '{{ doc("evm_nft_creator_fee_usd") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_nft_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_nft_origin_to") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: EZ_NFT_SALES_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml index 2d778d59..6c55a3a8 100644 --- a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml +++ b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml @@ -8,7 +8,6 @@ models: - _log_id columns: - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +15,6 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: @@ -27,7 +25,6 @@ models: - TIMESTAMP_NTZ - TIMESTAMP_LTZ - name: TX_HASH - description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: @@ -65,7 +62,6 @@ models: - STRING - VARCHAR - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: diff --git a/packages.yml b/packages.yml index 5debcd7e..06db1f38 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: v4.5.7 \ No newline at end of file + revision: v4.6.0 \ No newline at end of file From c3e03a1111cd24fd516d7d3316c54faeea6031a2 Mon Sep 17 00:00:00 2001 From: Austin <93135983+austinFlipside@users.noreply.github.com> Date: Tue, 15 Jul 2025 18:38:33 -0400 Subject: [PATCH 2/3] new assets (#367) --- ...ilver_bridge__complete_bridge_activity.sql | 47 +++++++++++++++ .../dex/silver_dex__complete_dex_swaps.sql | 59 +++++++++++++++++++ packages.yml | 2 +- 3 files changed, 107 insertions(+), 1 deletion(-) diff --git a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql index 2f40646d..94097f99 100644 --- a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql +++ b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql @@ -1,4 +1,5 @@ -- depends_on: {{ ref('silver__complete_token_prices') }} +-- depends_on: {{ ref('price__ez_asset_metadata') }} {{ config( materialized = 'incremental', incremental_strategy = 'delete+insert', @@ -980,6 +981,47 @@ heal_model AS ( GROUP BY 1 ) + newly_verified_tokens as ( + select token_address + from {{ ref('price__ez_asset_metadata') }} + where ifnull(is_verified_modified_timestamp, '1970-01-01' :: TIMESTAMP) > dateadd('day', -10, SYSDATE()) + ), + heal_newly_verified_tokens as ( + SELECT + t0.block_number, + t0.block_timestamp, + t0.origin_from_address, + t0.origin_to_address, + t0.origin_function_signature, + t0.tx_hash, + t0.event_index, + t0.bridge_address, + t0.event_name, + t0.platform, + t0.version, + t0.sender, + t0.receiver, + t0.destination_chain_receiver, + t0.destination_chain_id, + t0.destination_chain, + t0.token_address, + t0.token_symbol, + t0.token_decimals, + t0.amount_unadj, + t0.amount, + CASE + WHEN t0.token_decimals IS NOT NULL THEN t0.amount * p.price + ELSE NULL + END AS amount_usd_heal, + p.is_verified AS token_is_verified, + t0._id, + t0._inserted_timestamp + from {{ this }} t0 + join newly_verified_tokens nv + on t0.token_address = nv.token_address + left join {{ ref('price__ez_prices_hourly')}} p + on t0.token_address = p.token_address + and date_trunc('hour', t0.block_timestamp) = p.hour ), {% endif %} @@ -1021,6 +1063,11 @@ SELECT _inserted_timestamp FROM heal_model +UNION ALL +SELECT + * +FROM + heal_newly_verified_tokens {% endif %} ) SELECT diff --git a/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql b/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql index 59c57c3d..27819a75 100644 --- a/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql +++ b/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql @@ -1,4 +1,5 @@ -- depends_on: {{ ref('silver__complete_token_prices') }} +-- depends_on: {{ ref('price__ez_asset_metadata') }} {{ config( materialized = 'incremental', incremental_strategy = 'delete+insert', @@ -995,6 +996,59 @@ heal_model AS ( GROUP BY 1 ) + ), newly_verified_tokens as ( + select token_address + from {{ ref('price__ez_asset_metadata') }} + where ifnull(is_verified_modified_timestamp, '1970-01-01' :: TIMESTAMP) > dateadd('day', -10, SYSDATE()) + ), + heal_newly_verified_tokens as ( + select + t0.block_number, + t0.block_timestamp, + t0.tx_hash, + t0.origin_function_signature, + t0.origin_from_address, + t0.origin_to_address, + t0.contract_address, + t0.event_name, + t0.token_in, + p1.is_verified AS token_in_is_verified, + t0.decimals_in, + t0.symbol_in, + t0.amount_in_unadj, + t0.amount_in, + CASE + WHEN decimals_in IS NOT NULL THEN amount_in * p1.price + ELSE NULL + END AS amount_in_usd_heal, + token_out, + p2.is_verified AS token_out_is_verified, + t0.decimals_out, + t0.symbol_out, + t0.amount_out_unadj, + t0.amount_out, + CASE + WHEN decimals_out IS NOT NULL THEN amount_out * p2.price + ELSE NULL + END AS amount_out_usd_heal, + t0.pool_name, + t0.sender, + t0.tx_to, + t0.event_index, + t0.platform, + t0.protocol, + t0.version, + t0._log_id, + t0._inserted_timestamp + from {{ this }} t0 + join newly_verified_tokens nv + on (t0.token_in = nv.token_address or t0.token_out = nv.token_address) + left join {{ ref('price__ez_prices_hourly')}} p1 + on t0.token_in = p1.token_address + and date_trunc('hour', t0.block_timestamp) = p1.hour + left join {{ ref('price__ez_prices_hourly')}} p2 + on t0.token_out = p2.token_address + and date_trunc('hour', t0.block_timestamp) = p2.hour ), {% endif %} @@ -1042,6 +1096,11 @@ SELECT _inserted_timestamp FROM heal_model +UNION ALL +SELECT + * +FROM + heal_newly_verified_tokens {% endif %} ) SELECT diff --git a/packages.yml b/packages.yml index 06db1f38..4da60721 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: v4.6.0 \ No newline at end of file + revision: v4.8.0 \ No newline at end of file From 37a0c502ceb1185650029f10f05a3181f6597760 Mon Sep 17 00:00:00 2001 From: Austin <93135983+austinFlipside@users.noreply.github.com> Date: Tue, 15 Jul 2025 18:48:10 -0400 Subject: [PATCH 3/3] typo (#368) --- .../defi/bridge/silver_bridge__complete_bridge_activity.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql index 94097f99..a457bb8f 100644 --- a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql +++ b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql @@ -981,6 +981,7 @@ heal_model AS ( GROUP BY 1 ) + ), newly_verified_tokens as ( select token_address from {{ ref('price__ez_asset_metadata') }}