Skip to content
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_arbitrum', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_arbitrum_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_arbitrum_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_arbitrum', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_arbitrum', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_avalanche_c', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_avalanche_c_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_avalanche_c_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_avalanche_c', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_avalanche_c', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_base', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_base_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_base_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_base', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_base', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_blast', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_blast_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_blast_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_blast', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_blast', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_bnb', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_bnb_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_bnb_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_bnb', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_bnb', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_ethereum', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_ethereum_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_ethereum_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_ethereum', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_ethereum', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_ink', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_ink_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_ink_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_ink', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_ink', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_optimism', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_optimism_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_optimism_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_optimism', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_optimism', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_polygon', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_polygon_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_polygon_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_polygon', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_polygon', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_unichain', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_unichain_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_unichain_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_unichain', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_unichain', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{{ config(
schema = 'uniswap'
, alias = 'base_liquidity_events'
, partition_by = ['block_month', 'blockchain', 'project']
, materialized = 'incremental'
, file_format = 'delta'
, incremental_strategy = 'merge'
, unique_key = ['blockchain', 'project', 'version', 'tx_hash', 'evt_index', 'event_type']
, incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
schema = 'uniswap',
alias = 'base_liquidity_events'
)
}}

{% set models = [
Expand Down Expand Up @@ -56,9 +50,6 @@ with base_union as (
, salt
FROM
{{ model }}
{% if is_incremental() %}
WHERE {{ incremental_predicate('block_time') }}
{% endif %}
{% if not loop.last %}
UNION ALL
{% endif %}
Expand All @@ -68,5 +59,4 @@ with base_union as (
select
*
from
base_union
-- comment to refresh
base_union
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ select
, token1
, token0_symbol
, token1_symbol
, sum(amount0_raw) as amount0_raw
, sum(amount1_raw) as amount1_raw
, sum(amount0) as amount0
, sum(amount1) as amount1
, sum(case when event_type = 'fees_accrued' then 2 * amount0_raw else amount0_raw end) as amount0_raw
, sum(case when event_type = 'fees_accrued' then 2 * amount1_raw else amount1_raw end) as amount1_raw
, sum(case when event_type = 'fees_accrued' then 2 * amount0 else amount0 end) as amount0
, sum(case when event_type = 'fees_accrued' then 2 * amount1 else amount1 end) as amount1
from
{{ ref('uniswap_liquidity_events') }}
{% if is_incremental() %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ WITH dexes AS (
{{ incremental_predicate('block_time') }}
{% endif %}

-- refresh
-- refreshing
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,4 @@ prices_day as (
and tl.blockchain = pd_b.blockchain
{% endif %}

-- refresh
-- trigger refresh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_worldchain', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_worldchain_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_worldchain_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_worldchain', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_worldchain', 'PoolManager_call_ModifyLiquidity')
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
, PoolManager_evt_Swap = source('uniswap_v4_zora', 'PoolManager_evt_Swap')
, liquidity_pools = ref('uniswap_v4_zora_pools')
, liquidity_sqrtpricex96 = ref('uniswap_v4_zora_sqrtpricex96')
, PoolManager_call_Take = source('uniswap_v4_zora', 'poolmanager_call_take')
, PoolManager_call_ModifyLiquidity = source ('uniswap_v4_zora', 'PoolManager_call_ModifyLiquidity')
)
}}
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/arbitrum/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_arbitrum
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/avalanche_c/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_avalanche_c
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/base/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_base
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/blast/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_blast
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/bnb/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_bnb
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/ethereum/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sources:
- name: uniswap_v4_ethereum
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity

- name: ekubo_ethereum
tables:
Expand Down
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/ink/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_ink
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/optimism/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_optimism
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/polygon/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_polygon
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/unichain/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_unichain
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/worldchain/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_worldchain
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
2 changes: 1 addition & 1 deletion sources/_sector/dex/liquidity/zora/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sources:
- name: uniswap_v4_zora
tables:
- name: PoolManager_evt_ModifyLiquidity
- name: poolmanager_call_take
- name: PoolManager_call_ModifyLiquidity
Loading