tx table changes (#10)

This commit is contained in:
Austin 2022-07-28 12:53:44 -04:00 committed by GitHub
parent 976bf50476
commit 2b2f393e60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 16 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

@ -0,0 +1,5 @@
{% docs arb_tx_gas_bid %}
The gas bid, in Gwei.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs arb_tx_gas_paid %}
The gas paid, in Gwei.
{% enddocs %}

View File

@ -16,7 +16,8 @@ SELECT
to_address,
eth_value,
tx_fee,
gas_price,
gas_price_bid,
gas_price_paid,
gas_limit,
gas_used,
cumulative_Gas_Used,

View File

@ -24,8 +24,10 @@ models:
description: '{{ doc("arb_value") }}'
- name: TX_FEE
description: '{{ doc("arb_tx_fee") }}'
- name: GAS_PRICE
description: '{{ doc("arb_tx_gas_price") }}'
- name: GAS_PRICE_PAID
description: '{{ doc("arb_tx_gas_paid") }}'
- name: GAS_PRICE_BID
description: '{{ doc("arb_tx_gas_bid") }}'
- name: GAS_LIMIT
description: '{{ doc("arb_tx_gas_limit") }}'
- name: GAS_USED

View File

@ -32,7 +32,7 @@ WITH base_table AS (
10,
9
)
) :: FLOAT AS gas_price,
) :: FLOAT AS gas_price_bid,
udf_hex_to_int(
tx :gas :: STRING
) :: INTEGER AS gas_limit,
@ -47,11 +47,16 @@ WITH base_table AS (
udf_hex_to_int(
tx :receipt :cumulativeGasUsed :: STRING
) :: INTEGER AS cumulative_Gas_Used,
udf_hex_to_int(
tx :receipt :effectiveGasPrice :: STRING
) :: INTEGER AS effective_Gas_Price,
(
gas_price * gas_used
udf_hex_to_int(
tx :receipt :effectiveGasPrice :: STRING
) / pow(
10,
9
)
) :: FLOAT AS gas_price_paid,
(
gas_price_paid * gas_used
) / pow(
10,
9
@ -92,13 +97,13 @@ SELECT
to_address,
eth_value,
block_hash,
gas_price,
gas_price_bid,
gas_limit,
DATA AS input_data,
status,
gas_used,
cumulative_Gas_Used,
effective_Gas_Price,
gas_price_paid,
tx_fee,
ingested_at,
tx_json,

View File

@ -63,7 +63,14 @@ models:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: GAS_PRICE
- name: GAS_PRICE_PAID
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: GAS_PRICE_BID
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
@ -102,9 +109,6 @@ models:
column_type_list:
- NUMBER
- FLOAT
- name: EFFECTIVE_GAS_PRICE
tests:
- not_null
- name: TX_JSON
tests:
- not_null