decimals in transactions

This commit is contained in:
jhuhnke 2022-10-13 08:47:04 -05:00
parent 9dc43e98a5
commit 8fa7c37536
6 changed files with 23 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,8 @@ SELECT
transfer_type,
sender,
amount,
currency,
currency,
decimal,
receiver
FROM {{ ref('silver__transfers') }}

View File

@ -43,6 +43,10 @@ models:
description: "{{ doc('currency') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: DECIMAL
description: Divide the raw amount of currency as provided in the amount column by the decimal to get the actual amount in AXL or other currency.
tests:
- dbt_expectations.expect_column_to_exist
- name: RECEIVER
description: "{{ doc('receiver') }}"
tests:

View File

@ -12,9 +12,9 @@ WITH axelar_txs AS (
FROM
{{ ref('silver__msg_attributes') }}
WHERE
attribute_value in (
'/cosmos.bank.v1beta1.MsgSend'
,'/cosmos.bank.v1beta1.MsgMultiSend'
attribute_value IN (
'/cosmos.bank.v1beta1.MsgSend',
'/cosmos.bank.v1beta1.MsgMultiSend'
)
{% if is_incremental() %}
@ -203,7 +203,7 @@ AND _partition_by_block_id <= (
SELECT
block_id,
block_timestamp,
blockchain,
t.blockchain,
chain_id,
r.tx_id,
tx_succeeded,
@ -212,6 +212,10 @@ SELECT
sender,
amount,
currency,
COALESCE(
l.raw_metadata [1] :exponent,
6
) AS DECIMAL,
receiver,
_partition_by_block_id,
concat_ws(
@ -230,6 +234,9 @@ FROM
LEFT OUTER JOIN {{ ref('silver__transactions') }}
t
ON r.tx_id = t.tx_id
LEFT OUTER JOIN {{ ref('core__dim_labels') }}
l
ON currency = l.address
{% if is_incremental() %}
WHERE

View File

@ -59,6 +59,10 @@ models:
description: "{{ doc('currency') }}"
tests:
- not_null
- name: DECIMAL
description: Divide the raw amount of currency as provided in the amount column by the decimal to get the actual amount in AXL or other currency.
tests:
- not_null
- name: RECEIVER
description: "{{ doc('receiver') }}"
tests: