new documentations

This commit is contained in:
robel91 2022-11-21 11:02:06 -05:00
parent 82a7dd19c2
commit 24cc3d6ab6
7 changed files with 73 additions and 29 deletions

View File

@ -1,4 +1,6 @@
version: 2
models:
version: 2
models:
- name: core__ez_swaps
tests:
@ -66,8 +68,8 @@ models:
column_type_list:
- boolean
- name: PROPOSER
description: "{{ doc('proposer') }}"
- name: from_currency
description: "{{ doc('from_currency') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
@ -75,22 +77,23 @@ models:
- STRING
- VARCHAR
- name: PROPOSAL_ID
description: "{{ doc('proposal_id') }}"
- name: trader
description: "{{ doc('trader') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- name: PROPOSAL_TYPE
description: "{{ doc('proposal_type') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- VARCHAR
- STRING
- VARCHAR
- name: from_amount
description: "{{ doc('from_amount') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- decimal
- float
- name: _INSERTED_TIMESTAMP
description: "{{ doc('_inserted_timestamp') }}"

View File

@ -0,0 +1,5 @@
{% docs from_amount %}
The amount that the user sent to be swapped for another currency.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs from_currency %}
The currency that the user sent to be swapped for another currency.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs from_decimal %}
Divide the swap_from_amount by POW(10, swap_from_decimal) to get the amount the user swapped.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs trader %}
The address of the user that initiated the swap
{% enddocs %}

View File

@ -29,9 +29,10 @@ SELECT
message_value:contract :: STRING as contract_address
FROM
TERRA_DEV.silver.messages
{{ ref('silver__messages')}}
where message_type ilike '%msgexecutecontract%'
and message_json:msg in ('swap')
and message_value:msg:swap is not null
and {{ incremental_load_filter("_inserted_timestamp") }}
)
,execute_swap_operations AS (
@ -127,4 +128,23 @@ SELECT u.*, t.tx_sender as trader
LEFT outer JOIN terra.core.dim_address_labels l
ON s.contract_address = l.address
)
)
SELECT
BLOCK_ID,
BLOCK_TIMESTAMP,
_inserted_timestamp,
BLOCKCHAIN,
CHAIN_ID,
tx_id,
tx_succeeded,
trader,
From_amount,
from_currency,
from_decimal,
to_amount,
to_currency,
to_decimal,
pool_id
FROM
Final

View File

@ -66,8 +66,8 @@ models:
column_type_list:
- boolean
- name: PROPOSER
description: "{{ doc('proposer') }}"
- name: from_currency
description: "{{ doc('from_currency') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
@ -75,22 +75,23 @@ models:
- STRING
- VARCHAR
- name: PROPOSAL_ID
description: "{{ doc('proposal_id') }}"
- name: trader
description: "{{ doc('trader') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- name: PROPOSAL_TYPE
description: "{{ doc('proposal_type') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- VARCHAR
- STRING
- VARCHAR
- name: from_amount
description: "{{ doc('from_amount') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- decimal
- float
- name: _INSERTED_TIMESTAMP
description: "{{ doc('_inserted_timestamp') }}"