mirror of
https://github.com/FlipsideCrypto/eclipse-models.git
synced 2026-02-06 17:26:49 +00:00
log solar dex tvl
This commit is contained in:
parent
ad231bcc20
commit
8beeeb54c0
23
models/gold/defi/defi__fact_solar_dex_tvl.sql
Normal file
23
models/gold/defi/defi__fact_solar_dex_tvl.sql
Normal file
@ -0,0 +1,23 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_date"],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH lq AS (
|
||||
|
||||
SELECT
|
||||
{{ target.database }}.live.udf_api('https://api.solarstudios.co/main/info') :data :data AS response
|
||||
)
|
||||
SELECT
|
||||
SYSDATE() :: DATE AS block_date,
|
||||
response :tvl :: FLOAT AS tvl,
|
||||
response :users :: INT AS users,
|
||||
response :volume24 :: FLOAT AS volume_24,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['block_date']
|
||||
) }} AS fact_solar_dex_tvl_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp
|
||||
FROM
|
||||
lq
|
||||
11
models/gold/defi/defi__fact_solar_dex_tvl.yml
Normal file
11
models/gold/defi/defi__fact_solar_dex_tvl.yml
Normal file
@ -0,0 +1,11 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: defi__fact_solar_dex_tvl
|
||||
description: Contains tvl for solar dex - data starts as of 2024-11-25
|
||||
columns:
|
||||
- name: BLOCK_DATE
|
||||
description: "{{ doc('block_timestamp') }}"
|
||||
data_tests:
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
Loading…
Reference in New Issue
Block a user