mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 14:11:54 +00:00
silver yml files and tests
This commit is contained in:
parent
ed07056958
commit
fb6059c2cb
5
models/descriptions/active_day.md
Normal file
5
models/descriptions/active_day.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs active_day %}
|
||||
|
||||
Date of activity.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/inserted_timestamp.md
Normal file
5
models/descriptions/inserted_timestamp.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs inserted_timestamp %}
|
||||
|
||||
The timestamp at which the record was initially created and inserted into this table.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/invocation_id.md
Normal file
5
models/descriptions/invocation_id.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs invocation_id %}
|
||||
|
||||
A job ID to identify the run that last modified a record.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/maa.md
Normal file
5
models/descriptions/maa.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs maa %}
|
||||
|
||||
Monthly Active Accounts (wallets), as determined by transaction signers.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/modified_timestamp.md
Normal file
5
models/descriptions/modified_timestamp.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs modified_timestamp %}
|
||||
|
||||
The timestamp at which this record was last modified by an internal process.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/new_maas.md
Normal file
5
models/descriptions/new_maas.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs new_maas %}
|
||||
|
||||
Monthly Active Users, whose first tranaction occurred in the preceding 30 days.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/returning_maas.md
Normal file
5
models/descriptions/returning_maas.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs returning_maas %}
|
||||
|
||||
Monthly active accounts, who are not defined as new.
|
||||
|
||||
{% enddocs %}
|
||||
@ -1,5 +1,7 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
incremental_stratege = 'merge',
|
||||
merge_exclude_columns = ["inserted_timestamp"],
|
||||
unique_key = 'address',
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
tags = ['atlas']
|
||||
@ -22,7 +24,7 @@ WITH txs AS (
|
||||
{% if var("MANUAL_FIX") %}
|
||||
{{ partition_load_manual('no_buffer') }}
|
||||
{% else %}
|
||||
{{ incremental_load_filter('_inserted_timestamp') }}
|
||||
{{ incremental_load_filter('_inserted_timestamp') }}
|
||||
{% endif %}
|
||||
),
|
||||
FINAL AS (
|
||||
@ -37,7 +39,13 @@ FINAL AS (
|
||||
1
|
||||
)
|
||||
SELECT
|
||||
*
|
||||
address,
|
||||
first_tx_timestamp,
|
||||
first_tx_block_id,
|
||||
_inserted_timestamp,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
'{{ invocation_id }}' AS invocation_id
|
||||
FROM
|
||||
FINAL qualify ROW_NUMBER() over (
|
||||
PARTITION BY address
|
||||
|
||||
44
models/silver/atlas/silver__atlas_address_first_action.yml
Normal file
44
models/silver/atlas/silver__atlas_address_first_action.yml
Normal file
@ -0,0 +1,44 @@
|
||||
version: 2
|
||||
|
||||
models:
|
||||
- name: silver__atlas_address_first_action
|
||||
description: |-
|
||||
Parses transactions table for the block number and timestamp of a wallets first signed transaction.
|
||||
|
||||
columns:
|
||||
- name: address
|
||||
description: "{{ doc('address') }}"
|
||||
tests:
|
||||
- not_null
|
||||
- unique
|
||||
|
||||
- name: first_tx_timestamp
|
||||
description: "{{ doc('block_timestamp')}}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: first_tx_block_id
|
||||
description: "{{ doc('block_id') }}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: _inserted_timestamp
|
||||
description: "{{ doc('_inserted_timestamp') }}"
|
||||
tests:
|
||||
- name: not_null_silver__atlas_address_first_action_INSERTED_TIMESTAMP_
|
||||
test_name: not_null
|
||||
|
||||
- name: inserted_timestamp
|
||||
description: "{{ doc('inserted_timestamp') }}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: modified_timestamp
|
||||
description: "{{ doc('modified_timestamp') }}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: invocation_id
|
||||
description: "{{ doc('invocation_id') }}"
|
||||
tests:
|
||||
- not_null
|
||||
@ -27,7 +27,7 @@ WHERE
|
||||
AND date_day < SYSDATE() :: DATE
|
||||
{% else %}
|
||||
WHERE
|
||||
date_day BETWEEN '2020-07-21'
|
||||
date_day BETWEEN '2020-07-22'
|
||||
AND SYSDATE() :: DATE
|
||||
{% endif %}
|
||||
),
|
||||
|
||||
49
models/silver/atlas/silver__atlas_near_maa.yml
Normal file
49
models/silver/atlas/silver__atlas_near_maa.yml
Normal file
@ -0,0 +1,49 @@
|
||||
version: 2
|
||||
|
||||
models:
|
||||
- name: silver__atlas_near_maa
|
||||
description: |-
|
||||
Monthly Active Accounts (wallets) on NEAR, including new and returning wallets, calculated over a rolling 30 day window. An active account, here, is defined as the signing of at least one transaction.
|
||||
|
||||
columns:
|
||||
- name: active_day
|
||||
description: "{{ doc('active_day') }}"
|
||||
tests:
|
||||
- not_null
|
||||
- unique
|
||||
|
||||
- name: maa
|
||||
description: "{{ doc('maa')}}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: new_maas
|
||||
description: "{{ doc('new_maas') }}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: returning_maas
|
||||
description: "{{ doc('returning_maas') }}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: _inserted_timestamp
|
||||
description: "{{ doc('_inserted_timestamp') }}"
|
||||
tests:
|
||||
- name: not_null_silver__atlas_near_maa_INSERTED_TIMESTAMP_
|
||||
test_name: not_null
|
||||
|
||||
- name: inserted_timestamp
|
||||
description: "{{ doc('inserted_timestamp') }}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: modified_timestamp
|
||||
description: "{{ doc('modified_timestamp') }}"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: invocation_id
|
||||
description: "{{ doc('invocation_id') }}"
|
||||
tests:
|
||||
- not_null
|
||||
Loading…
Reference in New Issue
Block a user