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
7 changes: 0 additions & 7 deletions models/thorchain/thorchain__pool_balance_change_events.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
version: 2
models:
- name: thorchain__pool_balance_change_events
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- BLOCK_ID
- ASSET
- RUNE_AMOUNT
- ASSET_AMOUNT
columns:
- name: BLOCK_TIMESTAMP::DATE
tests:
Expand Down
5 changes: 2 additions & 3 deletions models/thorchain/thorchain__pool_block_statistics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ pool_status AS (
FROM (
SELECT
date(block_timestamp) AS day,
block_id,
ASSET AS pool_name,
status,
MAX(block_id) OVER (PARTITION BY pool_name, date(block_timestamp)) AS max_block_id
ROW_NUMBER() OVER (PARTITION BY pool_name, date(block_timestamp) ORDER BY block_timestamp DESC, status) AS rn
FROM {{ ref("thorchain__pool_events") }}
)
WHERE block_id = max_block_id
WHERE rn = 1
),

add_liquidity_tbl AS (
Expand Down