diff --git a/models/doc_descriptions/fsc_evm/blocks.md b/models/doc_descriptions/fsc_evm/blocks.md new file mode 100644 index 0000000..2f2f846 --- /dev/null +++ b/models/doc_descriptions/fsc_evm/blocks.md @@ -0,0 +1,143 @@ +{% docs evm_blocks_table_doc %} + +This table contains block level data for this EVM blockchain. This table can be used to analyze trends at a block level, for example gas fees vs. total transactions over time. For more information, please see [Etherscan Resources](https://etherscan.io/directory/Learning_Resources/Ethereum) or [The Ethereum Organization](https://ethereum.org/en/developers/docs/blocks/) + +{% enddocs %} + +{% docs evm_block_header_json %} + +This JSON column contains the block header details. + +{% enddocs %} + +{% docs evm_blockchain %} + +The blockchain on which transactions are being confirmed. + +{% enddocs %} + +{% docs evm_blocks_hash %} + +The hash of the block header for a given block. + +{% enddocs %} + +{% docs evm_blocks_nonce %} + +Block nonce is a value used during mining to demonstrate proof of work for a given block. + +{% enddocs %} + +{% docs evm_difficulty %} + +The effort required to mine the block. + +{% enddocs %} + +{% docs evm_extra_data %} + +Any data included by the miner for a given block. + +{% enddocs %} + +{% docs evm_gas_limit %} + +Total gas limit provided by all transactions in the block. + +{% enddocs %} + +{% docs evm_gas_used %} + +Total gas used in the block. + +{% enddocs %} + +{% docs evm_network %} + +The network on the blockchain used by a transaction. + +{% enddocs %} + +{% docs evm_parent_hash %} + +The hash of the block from which a given block is generated. Also known as the parent block. + +{% enddocs %} + +{% docs evm_receipts_root %} + +The root of the state trie. + +{% enddocs %} + +{% docs evm_sha3_uncles %} + +The mechanism which Ethereum Javascript RLP encodes an empty string. + +{% enddocs %} + +{% docs evm_size %} + +Block size, which is determined by a given block's gas limit. + +{% enddocs %} + +{% docs evm_total_difficulty %} + +Total difficulty of the chain at a given block. + +{% enddocs %} + +{% docs evm_tx_count %} + +Total number of transactions within a block. + +{% enddocs %} + +{% docs evm_uncle_blocks %} + +Uncle blocks occur when two blocks are mined and broadcasted at the same time, with the same block number. The block validated across the most nodes will be added to the primary chain, and the other one becomes an uncle block. Miners do receive rewards for uncle blocks. + +{% enddocs %} + +{% docs evm_miner %} + +The address of the beneficiary to whom the mining rewards were given + +{% enddocs %} + +{% docs evm_state_root %} + +The root of the final state trie of the block + +{% enddocs %} + +{% docs evm_transactions_root %} + +The root of the transaction trie of the block + +{% enddocs %} + +{% docs evm_logs_bloom %} + +The bloom filter for the logs of the block. + +{% enddocs %} + +{% docs evm_mix_hash %} + +A string of a 256-bit hash encoded as a hexadecimal + +{% enddocs %} + +{% docs evm_base_fee_per_gas %} + +A string of the base fee encoded in hexadecimal format. Please note that this response field will not be included in a block requested before the EIP-1559 upgrade + +{% enddocs %} + +{% docs evm_withdrawals_root %} + +The root of the withdrawals trie. + +{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/complete_general.md b/models/doc_descriptions/fsc_evm/complete_general.md new file mode 100644 index 0000000..77e2b35 --- /dev/null +++ b/models/doc_descriptions/fsc_evm/complete_general.md @@ -0,0 +1,65 @@ +{% docs evm_block_number %} + +Also known as block height. The block number, which indicates the length of the blockchain, increases after the addition of each new block. + +{% enddocs %} + +{% docs evm_block_timestamp %} + +The date and time at which the block was produced. + +{% enddocs %} + +{% docs evm_from_address %} + +The sending address of this transaction. + +{% enddocs %} + +{% docs evm_ingested_at %} + +Internal column. + +{% enddocs %} + +{% docs evm_to_address %} + +The receiving address of this transaction. This can be a contract address. + +{% enddocs %} + +{% docs evm_pk %} + +The unique identifier for each row in the table. + +{% enddocs %} + +{% docs evm_inserted_timestamp %} + +The UTC timestamp at which the row was inserted into the table. + +{% enddocs %} + +{% docs evm_modified_timestamp %} + +The UTC timestamp at which the row was last modified. + +{% enddocs %} + +{% docs evm_precise_amount_unadjusted %} + +The precise, unadjusted amount of the transaction. This is returned as a string to avoid precision loss. + +{% enddocs %} + +{% docs evm_precise_amount_adjusted %} + +The precise, adjusted amount of the transaction. This is returned as a string to avoid precision loss. + +{% enddocs %} + +{% docs evm_value_hex %} + +The value of the transaction in hexadecimal format. + +{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/event_logs.md b/models/doc_descriptions/fsc_evm/event_logs.md new file mode 100644 index 0000000..8880f5c --- /dev/null +++ b/models/doc_descriptions/fsc_evm/event_logs.md @@ -0,0 +1,83 @@ +{% docs evm_logs_table_doc %} + +This table contains flattened event logs from transactions on this EVM blockchain. Transactions may have multiple events, which are denoted by the event index for a transaction hash. Therefore, this table is unique on the combination of transaction hash and event index. Please see `fact_decoded_event_logs` or `ez_decoded_event_logs` for the decoded event logs. + +{% enddocs %} + +{% docs evm_event_index %} + +Event number within a transaction. + +{% enddocs %} + +{% docs evm_event_inputs %} + +The decoded event inputs for a given event. + +{% enddocs %} + +{% docs evm_event_removed %} + +Whether the event has been removed from the transaction. + +{% enddocs %} + +{% docs evm_log_id_events %} + +This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the event occurred. This field can be used within other event based tables such as `fact_transfers` & `ez_token_transfers`. + +{% enddocs %} + +{% docs evm_logs_contract_address %} + +The address interacted with for a given event. + +{% enddocs %} + +{% docs evm_logs_contract_name %} + +The name of the contract or token, where possible. + +{% enddocs %} + +{% docs evm_logs_data %} + +The un-decoded event data. + +{% enddocs %} + +{% docs evm_logs_tx_hash %} + +Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This field will not be unique in this table, as a given transaction can include multiple events. + +{% enddocs %} + +{% docs evm_topics %} + +The un-decoded event input topics. + +{% enddocs %} + +{% docs evm_topic_0 %} + +The first topic of the event, which is a unique identifier for the event. + +{% enddocs %} + +{% docs evm_topic_1 %} + +The second topic of the event, if applicable. + +{% enddocs %} + +{% docs evm_topic_2 %} + +The third topic of the event, if applicable. + +{% enddocs %} + +{% docs evm_topic_3 %} + +The fourth topic of the event, if applicable. + +{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/evm_deprecations.md b/models/doc_descriptions/fsc_evm/evm_deprecations.md new file mode 100644 index 0000000..a2ea628 --- /dev/null +++ b/models/doc_descriptions/fsc_evm/evm_deprecations.md @@ -0,0 +1,185 @@ +{% docs evm_column_deprecation_notice %} + +This column is being deprecated for standardization purposes. Please update your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_hash %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `block_hash` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_block_hash %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_position %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `tx_position` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_tx_status %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `tx_succeeded` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_chain_id %} + +This column is being removed for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_identifier %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `trace_address` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_trace_status %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `trace_succeeded` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_log_id %} + +This column is being removed for standardization purposes. Please remove or update your queries with `CONCAT(tx_hash, '_', event_index)` to reconstruct `_log_id` by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_inserted_timestamp %} + +This column is being removed for standardization purposes. Please remove or update your queries with `_inserted_timestamp` by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_blockchain %} + +This column is being removed for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_block_header_json %} + +This column is being removed for standardization purposes and will be replaced with new columns associated with the keys extracted from this json. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_full_decoded_log %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `full_decoded_data` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_table_deprecation_notice %} + +This table is being deprecated for standardization purposes. Please update your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_table_deprecation_notice_fact_decoded_event_logs %} + +This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_event_logs` instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_table_deprecation_notice_fact_decoded_traces %} + +This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_traces` instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_l1_state_root_tx_hash %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_l1_state_root_batch_index %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_l1_submission_tx_hash %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_l1_submission_batch_index %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_l1_submission_details %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_data %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_deposit_nonce %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_deposit_receipt_version %} + +This column is being deprecated for standardization purposes. Please remove from your queries by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_tokenid %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `token_id` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_erc1155_value %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `quantity` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_event_type %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `is_mint` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_nft_from_address %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `from_address` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_nft_to_address %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `to_address` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_nft_address %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `contract_address` column instead by February 3, 2025. + +{% enddocs %} + +{% docs evm_column_deprecation_notice_nft_project_name %} + +This column is being deprecated for standardization purposes. Please update your queries to use the `name` column instead by February 3, 2025. + +{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/traces.md b/models/doc_descriptions/fsc_evm/traces.md new file mode 100644 index 0000000..4ba93a6 --- /dev/null +++ b/models/doc_descriptions/fsc_evm/traces.md @@ -0,0 +1,131 @@ +{% docs evm_traces_table_doc %} + +This table contains flattened trace data for internal contract calls. User-defined functions (UDFs) are available to decode hex encoded fields, including `utils.udf_hex_to_int()`. + +{% enddocs %} + +{% docs evm_traces_block_no %} + +The block number of this transaction. + +{% enddocs %} + +{% docs evm_traces_blocktime %} + +The block timestamp of this transaction. + +{% enddocs %} + +{% docs evm_traces_call_data %} + +The raw JSON data for this trace. + +{% enddocs %} + +{% docs evm_traces_value %} + +The amount of the native asset transferred in this trace. + +{% enddocs %} + +{% docs evm_traces_from %} + +The sending address of this trace. This is not necessarily the from address of the transaction. + +{% enddocs %} + +{% docs evm_traces_gas %} + +The gas supplied for this trace. + +{% enddocs %} + +{% docs evm_traces_gas_used %} + +The gas used for this trace. + +{% enddocs %} + +{% docs evm_traces_identifier %} + +This field represents the position and type of the trace within the transaction. + +{% enddocs %} + +{% docs evm_trace_index %} + +The index of the trace within the transaction. + +{% enddocs %} + +{% docs evm_traces_input %} + +The input data for this trace. + +{% enddocs %} + +{% docs evm_traces_output %} + +The output data for this trace. + +{% enddocs %} + +{% docs evm_sub_traces %} + +The amount of nested sub traces for this trace. + +{% enddocs %} + +{% docs evm_traces_to %} + +The receiving address of this trace. This is not necessarily the to address of the transaction. + +{% enddocs %} + +{% docs evm_traces_tx_hash %} + +The transaction hash for the trace. Please note, this is not necessarily unique in this table as transactions frequently have multiple traces. + +{% enddocs %} + +{% docs evm_traces_type %} + +The type of internal transaction. Common trace types are `CALL`, `DELEGATECALL`, and `STATICCALL`. + +{% enddocs %} + +{% docs evm_trace_succeeded %} + +The boolean value representing if the trace succeeded. + +{% enddocs %} + +{% docs evm_trace_error_reason %} + +The reason for the trace failure, if any. + +{% enddocs %} + +{% docs evm_trace_address %} + +The trace address for this trace. + +{% enddocs %} + +{% docs evm_revert_reason %} + +The reason for the revert, if available. + +{% enddocs %} + +{% docs evm_before_evm_transfers %} + +The state of all ETH transfers to be executed for a given transaction. + +{% enddocs %} + +{% docs evm_after_evm_transfers %} + +The state of all ETH transfers executed for a given transaction. + +{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/transactions.md b/models/doc_descriptions/fsc_evm/transactions.md new file mode 100644 index 0000000..69ef924 --- /dev/null +++ b/models/doc_descriptions/fsc_evm/transactions.md @@ -0,0 +1,212 @@ +{% docs evm_tx_table_doc %} + +This table contains transaction level data for this EVM blockchain. Each transaction will have a unique transaction hash, along with transaction fees and a value transferred in the native asset when applicable. Transactions may be native asset transfers or interactions with contract addresses. For more information, please see [The Ethereum Organization - Transactions](https://ethereum.org/en/developers/docs/transactions/) + +Below are the specific native tokens that correspond to each EVM chain: + +| Status | Description | +| --------- | ----------- | +| ETHEREUM | ETH | +| BINANCE | BNB | +| POLYGON | POL | +| AVALANCHE | AVAX | +| ARBITRUM | ETH | +| OPTIMISM | ETH | +| GNOSIS | xDAI | +| KAIA | KLAY | +| SEI | SEI | +| CORE | CORE | + +{% enddocs %} + +{% docs evm_cumulative_gas_used %} + +The total amount of gas used when this transaction was executed in the block. + +{% enddocs %} + +{% docs evm_tx_block_hash %} + +Block hash is a unique 66-character identifier that is generated when a block is produced. + +{% enddocs %} + +{% docs evm_tx_fee %} + +Amount paid to validate the transaction in the native asset. + +{% enddocs %} + +{% docs evm_tx_gas_limit %} + +Maximum amount of gas allocated for the transaction. + +{% enddocs %} + +{% docs evm_tx_gas_price %} + +Cost per unit of gas in Gwei. + +{% enddocs %} + +{% docs evm_tx_gas_used %} + +Gas used by the transaction. + +{% enddocs %} + +{% docs evm_tx_gas_price_bid %} + +The gas bid, in Gwei. + +{% enddocs %} + +{% docs evm_tx_gas_price_paid %} + +The gas paid, in Gwei. + +{% enddocs %} + +{% docs evm_tx_l1_block_number %} + +The block number of the transaction on Ethereum Mainnet. + +{% enddocs %} + +{% docs evm_tx_gas_used_for_l1 %} + +The gas used by the transaction on Ethereum Mainnet. + +{% enddocs %} + +{% docs evm_tx_hash %} + +Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. + +{% enddocs %} + +{% docs evm_tx_input_data %} + +This column contains additional data for this transaction, and is commonly used as part of a contract interaction or as a message to the recipient. + +{% enddocs %} + +{% docs evm_tx_json %} + +This JSON column contains the transaction details, including event logs. + +{% enddocs %} + +{% docs evm_tx_nonce %} + +The number of transactions sent from a given address. + +{% enddocs %} + +{% docs evm_tx_origin_sig %} + +The function signature of the call that triggered this transaction. + +{% enddocs %} + +{% docs evm_origin_sig %} + +The function signature of the contract call that triggered this transaction. + +{% enddocs %} + +{% docs evm_tx_position %} + +The position of the transaction within the block. + +{% enddocs %} + +{% docs evm_tx_status %} + +Status of the transaction. + +{% enddocs %} + +{% docs evm_value %} + +The value transacted in the native asset. + +{% enddocs %} + +{% docs evm_effective_gas_price %} + +The total base charge plus tip paid for each unit of gas, in Gwei. + +{% enddocs %} + +{% docs evm_max_fee_per_gas %} + +The maximum fee per gas of the transaction, in Gwei. + +{% enddocs %} + +{% docs evm_max_priority_fee_per_gas %} + +The maximum priority fee per gas of the transaction, in Gwei. + +{% enddocs %} + +{% docs evm_r %} + +The r value of the transaction signature. + +{% enddocs %} + +{% docs evm_s %} + +The s value of the transaction signature. + +{% enddocs %} + +{% docs evm_v %} + +The v value of the transaction signature. + +{% enddocs %} + +{% docs evm_tx_succeeded %} + +Whether the transaction was successful, returned as a boolean. + +{% enddocs %} + +{% docs evm_tx_fee_precise %} + +The precise amount of the transaction fee. This is returned as a string to avoid precision loss. + +{% enddocs %} + +{% docs evm_tx_type %} + +The type of transaction. + +{% enddocs %} + +{% docs evm_mint %} + +The minting event associated with the transaction + +{% enddocs %} + +{% docs evm_source_hash %} + +The hash of the source transaction that created this transaction + +{% enddocs %} + +{% docs evm_eth_value %} + +The eth value for the transaction + +{% enddocs %} + +{% docs evm_chain_id %} + +The unique identifier for the chain the transaction was executed on. + +{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/transfers.md b/models/doc_descriptions/fsc_evm/transfers.md new file mode 100644 index 0000000..454d38b --- /dev/null +++ b/models/doc_descriptions/fsc_evm/transfers.md @@ -0,0 +1,174 @@ +{% docs evm_transfers_table_doc %} + +This table contains all native asset transfers, including equivalent USD amounts. The origin addresses correspond to the to and from addresses from the `fact_transactions` table. The `identifier` and `tx_hash` columns relate this table back to `fact_traces`, which contains more details on the transfers. + +Below are the specific native tokens that correspond to each EVM chain: + +| Status | Description | +| --------- | ----------- | +| ETHEREUM | ETH | +| BINANCE | BNB | +| POLYGON | POL | +| AVALANCHE | AVAX | +| ARBITRUM | ETH | +| OPTIMISM | ETH | +| GNOSIS | xDAI | +| KAIA | KLAY | + +{% enddocs %} + +{% docs evm_transfer_table_doc %} + +This table contains all events in the `fact_token_transfers` table, along with joined columns such as token price, symbol, and decimals where possible that allow for easier analysis of token transfer events. Please note native asset transfers are not included here. + +{% enddocs %} + +{% docs evm_fact_token_transfers_table_doc %} + +This fact-based table contains emitted event logs for ERC-20 Token Transfers (e.g. `Transfer`: topic_0 = `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`). The contract address is the token transferred, and the raw amount field is the amount of tokens transferred. The values in this table are not decimal adjusted, instead please use `core.dim_contracts` or `core.ez_token_transfers` to reference decimals or decimal adjusted values. This table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. Additionally, this table does not contain transfers of the chain's native asset, instead please use `core.ez_native_transfers`. + +{% enddocs %} + +{% docs evm_ez_token_transfers_table_doc %} + +This convenience table contains emitted event logs for ERC-20 Token Transfers (e.g. `Transfer`: topic_0 = `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`), including decimal adjusted values, USD values, and other helpful token metadata where available for each transfer event. The contract address is the token transferred, and the raw amount field is the amount of tokens transferred. Note, this table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. Additionally, this table does not contain transfers of the chain's native asset, instead please use `core.ez_native_transfers`. + +{% enddocs %} + +{% docs evm_ez_native_transfers_table_doc %} + +This convenience table contains all transfers for the chain's native asset, sourced from internal traces (`core.fact_traces`), and includes decimal adjusted and USD values where available. The origin addresses correspond to the to and from addresses in the `core.fact_transactions` table. Note, this table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. + +{% enddocs %} + +{% docs evm_amount %} + +Native asset value transferred, this is imported from the fsc-evm package. + +{% enddocs %} + +{% docs evm_amount_usd %} + +Native asset value transferred, in USD. + +{% enddocs %} + +{% docs evm_log_id_transfers %} + +This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the transfer event occurred. This field can be used to find more details on the event within the `fact_event_logs` table. + +{% enddocs %} + +{% docs evm_origin_from %} + +The from address at the transaction level. + +{% enddocs %} + +{% docs evm_origin_to %} + +The to address at the transaction level. + +{% enddocs %} + +{% docs evm_transfer_amount %} + +The decimal transformed amount for this token. Tokens without a decimal adjustment will be nulled out here. + +{% enddocs %} + +{% docs evm_transfer_amount_precise %} + +The decimal transformed amount for this token returned as a string to preserve precision. Tokens without a decimal adjustment will be nulled out here. + +{% enddocs %} + +{% docs evm_transfer_amount_usd %} + +The amount in US dollars for this transfer at the time of the transfer. Tokens without a decimal adjustment or price will be nulled out here. + +{% enddocs %} + +{% docs evm_transfer_contract_address %} + +Contract address of the token being transferred. + +{% enddocs %} + +{% docs evm_transfer_from_address %} + +The sending address of this transfer. + +{% enddocs %} + +{% docs evm_transfer_has_decimal %} + +Whether or not our contracts model contains the necessary decimal adjustment for this token. + +{% enddocs %} + +{% docs evm_transfer_has_price %} + +Whether or not our prices model contains this hourly token price. + +{% enddocs %} + +{% docs evm_transfer_raw_amount %} + +The amount of tokens transferred. This value is not decimal adjusted. + +{% enddocs %} + +{% docs evm_transfer_raw_amount_precise %} + +The amount of tokens transferred returned as a string to preserve precision. This value is not decimal adjusted. + +{% enddocs %} + +{% docs evm_transfer_to_address %} + +The receiving address of this transfer. This can be a contract address. + +{% enddocs %} + +{% docs evm_transfer_token_price %} + +The price, if available, for this token at the transfer time. + +{% enddocs %} + +{% docs evm_transfer_tx_hash %} + +Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This will not be unique in this table as a transaction could include multiple transfer events. + +{% enddocs %} + +{% docs evm_transfer_token_standard %} + +The token standard of the token being transferred. + +{% enddocs %} + +{% docs evm_transfer_name %} + +The name of the token being transferred. + +{% enddocs %} + +{% docs evm_transfer_token_transfer_type %} + +The type of token transfer based on the token standard. + +{% enddocs %} + +{% docs evm_transfer_is_mint %} + +Whether or not the transfer is a mint. + +{% enddocs %} + +{% docs evm_transfer_quantity %} + +The quantity of the token being transferred. + +{% enddocs %} diff --git a/models/gold/core/core__ez_decoded_event_logs.sql b/models/gold/core/core__ez_decoded_event_logs.sql index 0e8035d..91ae01a 100644 --- a/models/gold/core/core__ez_decoded_event_logs.sql +++ b/models/gold/core/core__ez_decoded_event_logs.sql @@ -25,25 +25,23 @@ SELECT origin_from_address, origin_to_address, origin_function_signature, - tx_succeeded, - {# CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE -END AS tx_succeeded, -#} -event_name, -decoded_data AS full_decoded_log, -decoded_flat AS decoded_log, -token_name AS contract_name, -COALESCE ( - decoded_logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} -) AS ez_decoded_event_logs_id, -GREATEST(COALESCE(l.inserted_timestamp, '2000-01-01'), COALESCE(C.inserted_timestamp, '2000-01-01')) AS inserted_timestamp, -GREATEST(COALESCE(l.modified_timestamp, '2000-01-01'), COALESCE(C.modified_timestamp, '2000-01-01')) AS modified_timestamp, -tx_status -- deprecate + CASE + WHEN tx_status = 'SUCCESS' THEN TRUE + ELSE FALSE + END AS tx_succeeded, + event_name, + decoded_data AS full_decoded_log, + decoded_flat AS decoded_log, + token_name AS contract_name, + COALESCE ( + decoded_logs_id, + {{ dbt_utils.generate_surrogate_key( + ['tx_hash', 'event_index'] + ) }} + ) AS ez_decoded_event_logs_id, + GREATEST(COALESCE(l.inserted_timestamp, '2000-01-01'), COALESCE(C.inserted_timestamp, '2000-01-01')) AS inserted_timestamp, + GREATEST(COALESCE(l.modified_timestamp, '2000-01-01'), COALESCE(C.modified_timestamp, '2000-01-01')) AS modified_timestamp, + tx_status -- deprecate FROM {{ ref('silver__decoded_logs') }} l diff --git a/models/gold/core/core__ez_decoded_event_logs.yml b/models/gold/core/core__ez_decoded_event_logs.yml index 7e85733..3b77cd3 100644 --- a/models/gold/core/core__ez_decoded_event_logs.yml +++ b/models/gold/core/core__ez_decoded_event_logs.yml @@ -9,7 +9,7 @@ models: The `full_decoded_logs` column contains the same information, as well as additional fields such as the datatype of the decoded data. You may need to laterally flatten this column to query the data. Sample query for USDC Transfer events: - + ```sql select tx_hash, @@ -23,7 +23,7 @@ models: and block_number between 16400000 and 16405000 and event_name = 'Transfer' limit 50```' - + columns: - name: BLOCK_NUMBER description: '{{ doc("base_block_number") }}' @@ -36,13 +36,13 @@ models: - name: CONTRACT_ADDRESS description: '{{ doc("base_logs_contract_address") }}' - name: CONTRACT_NAME - description: 'The name of the contract, if the contract has a name() function.' + description: "The name of the contract, if the contract has a name() function." - name: EVENT_NAME - description: 'The name of the event, as defined in the contract ABI.' + description: "The name of the event, as defined in the contract ABI." - name: DECODED_LOG - description: 'The flattened decoded log, where the keys are the names of the event parameters, and the values are the values of the event parameters.' + description: "The flattened decoded log, where the keys are the names of the event parameters, and the values are the values of the event parameters." - name: FULL_DECODED_LOG - description: 'The full decoded log, including the event name, the event parameters, and the data type of the event parameters.' + description: "The full decoded log, including the event name, the event parameters, and the data type of the event parameters." - name: ORIGIN_FUNCTION_SIGNATURE description: '{{ doc("base_tx_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS @@ -51,15 +51,25 @@ models: description: '{{ doc("base_origin_to") }}' - name: TOPICS description: '{{ doc("base_topics") }}' + - name: TOPIC_0 + description: '{{ doc("evm_topic_0") }}' + - name: TOPIC_1 + description: '{{ doc("evm_topic_1") }}' + - name: TOPIC_2 + description: '{{ doc("evm_topic_2") }}' + - name: TOPIC_3 + description: '{{ doc("evm_topic_3") }}' - name: DATA description: '{{ doc("base_logs_data") }}' - name: EVENT_REMOVED - description: '{{ doc("base_event_removed") }}' + description: '{{ doc("base_event_removed") }}' - name: TX_STATUS - description: '{{ doc("base_tx_status") }}' + description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' + - name: TX_SUCCEEDED + description: '{{ doc("evm_tx_succeeded") }}' - name: EZ_DECODED_EVENT_LOGS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("modified_timestamp") }}' diff --git a/models/gold/core/core__ez_native_transfers.sql b/models/gold/core/core__ez_native_transfers.sql index 8e6c7cc..b54f3a2 100644 --- a/models/gold/core/core__ez_native_transfers.sql +++ b/models/gold/core/core__ez_native_transfers.sql @@ -5,42 +5,26 @@ ) }} SELECT - tx_hash, - -- should we rearrange the order? block_number, block_timestamp, + tx_hash, tx_position, trace_index, - '0x' AS TYPE, - '0x' AS trace_address, - concat_ws( - '-', - block_number, - tx_position, - CONCAT( - TYPE, - '_', - trace_address - ) - ) AS _call_id, - --deprecate - CONCAT( - TYPE, - '_', - trace_address - ) AS identifier, + identifier, --deprecate trace_address, --new column - origin_from_address, - origin_to_address, - origin_function_signature, + TYPE, + --new column from_address, to_address, amount, amount_precise_raw, amount_precise, amount_usd, + origin_from_address, + origin_to_address, + origin_function_signature, COALESCE ( native_transfers_id, {{ dbt_utils.generate_surrogate_key( diff --git a/models/gold/core/core__ez_native_transfers.yml b/models/gold/core/core__ez_native_transfers.yml index 941f0c2..1e61c84 100644 --- a/models/gold/core/core__ez_native_transfers.yml +++ b/models/gold/core/core__ez_native_transfers.yml @@ -2,7 +2,7 @@ version: 2 models: - name: core__ez_native_transfers description: '{{ doc("evm_ez_native_transfers_table_doc") }}' - + columns: - name: TX_HASH description: '{{ doc("base_transfer_tx_hash") }}' @@ -15,7 +15,11 @@ models: - name: TRACE_INDEX description: '{{ doc("base_trace_index") }}' - name: IDENTIFIER - description: '{{ doc("base_traces_identifier") }}' + description: '{{ doc("evm_column_deprecation_notice_identifier") }}' + - name: TRACE_ADDRESS + description: '{{ doc("evm_trace_address") }}' + - name: TYPE + description: '{{ doc("evm_traces_type") }}' - name: ORIGIN_FROM_ADDRESS description: '{{ doc("base_origin_from") }}' - name: ORIGIN_TO_ADDRESS @@ -33,10 +37,10 @@ models: - name: AMOUNT_PRECISE description: '{{ doc("precise_amount_adjusted") }}' - name: AMOUNT_USD - description: '{{ doc("base_eth_amount_usd") }}' + description: '{{ doc("base_eth_amount_usd") }}' - name: EZ_NATIVE_TRANSFERS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__ez_token_transfers.sql b/models/gold/core/core__ez_token_transfers.sql index 23ae4c5..faa623c 100644 --- a/models/gold/core/core__ez_token_transfers.sql +++ b/models/gold/core/core__ez_token_transfers.sql @@ -26,7 +26,7 @@ SELECT has_decimal, has_price, _log_id, - -- needs to be deprecated + -- deprecate _inserted_timestamp, COALESCE ( transfers_id, diff --git a/models/gold/core/core__ez_token_transfers.yml b/models/gold/core/core__ez_token_transfers.yml index c1b1b90..ec3e83e 100644 --- a/models/gold/core/core__ez_token_transfers.yml +++ b/models/gold/core/core__ez_token_transfers.yml @@ -2,10 +2,10 @@ version: 2 models: - name: core__ez_token_transfers description: '{{ doc("evm_ez_token_transfers_table_doc") }}' - + columns: - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' + description: '{{ doc("base_block_number") }}' - name: BLOCK_TIMESTAMP description: '{{ doc("base_block_timestamp") }}' - name: TX_HASH @@ -45,12 +45,12 @@ models: - name: HAS_PRICE description: '{{ doc("base_transfer_has_price") }}' - name: _LOG_ID - description: '{{ doc("internal_column") }}' + description: '{{ doc("evm_column_deprecation_notice_log_id") }}' - name: _INSERTED_TIMESTAMP - description: '{{ doc("internal_column") }}' + description: '{{ doc("evm_column_deprecation_notice_inserted_timestamp") }}' - name: EZ_TOKEN_TRANSFERS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__fact_blocks.sql b/models/gold/core/core__fact_blocks.sql index 225d4d6..c620590 100644 --- a/models/gold/core/core__fact_blocks.sql +++ b/models/gold/core/core__fact_blocks.sql @@ -53,7 +53,7 @@ SELECT '2000-01-01' ) ) AS modified_timestamp, - 'blast' AS blockchain, + 'base' AS blockchain, --deprecate HASH, --deprecate , diff --git a/models/gold/core/core__fact_decoded_event_logs.yml b/models/gold/core/core__fact_decoded_event_logs.yml index 8b61ee6..a77d76f 100644 --- a/models/gold/core/core__fact_decoded_event_logs.yml +++ b/models/gold/core/core__fact_decoded_event_logs.yml @@ -1,49 +1,4 @@ version: 2 models: - name: core__fact_decoded_event_logs - description: > - 'For information on how to submit a contract for decoding, as well as how ABIs are sourced, please visit [here](https://science.flipsidecrypto.xyz/abi-requestor/). - This model contains decoded event logs for contracts that we have an ABI for. Please note, this table does not include all event logs, only those that we have an ABI for. - This table will perform better than the `core__ez_decoded_event_logs` table, but does not include as many columns. - The `decoded_log` column is the easiest place to query decoded data. It is a JSON object, where the keys are the names of the event parameters, and the values are the values of the event parameters. - You can select from this column using the following sample format, `decoded_log:from::string` or more generally, `decoded_log:::datatype`. See below for a full sample query. - The `full_decoded_logs` column contains the same information, as well as additional fields such as the datatype of the decoded data. You may need to laterally flatten this column to query the data. - - Sample query for USDC Transfer events: - ```sql - select - tx_hash, - block_number, - contract_address, - decoded_log:from::string as from_address, - decoded_log:to::string as to_address, - decoded_log:value::integer as value - from ethereum.core.fact_decoded_event_logs - where contract_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') - and block_number between 16400000 and 16405000 - and event_name = 'Transfer' - limit 50```' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' - - name: EVENT_NAME - description: 'The name of the event, as defined in the contract ABI.' - - name: DECODED_LOG - description: 'The flattened decoded log, where the keys are the names of the event parameters, and the values are the values of the event parameters.' - - name: FULL_DECODED_LOG - description: 'The full decoded log, including the event name, the event parameters, and the data type of the event parameters.' - - name: FACT_DECODED_EVENT_LOGS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_table_deprecation_notice_fact_decoded_event_logs") }}' diff --git a/models/gold/core/core__fact_event_logs.sql b/models/gold/core/core__fact_event_logs.sql index 9e24df1..10880d2 100644 --- a/models/gold/core/core__fact_event_logs.sql +++ b/models/gold/core/core__fact_event_logs.sql @@ -29,6 +29,7 @@ SELECT WHEN tx_status = 'SUCCESS' THEN TRUE ELSE FALSE END AS tx_succeeded, + -- new column logs_id AS fact_event_logs_id, inserted_timestamp, modified_timestamp, diff --git a/models/gold/core/core__fact_event_logs.yml b/models/gold/core/core__fact_event_logs.yml index 858e88c..7d0a84f 100644 --- a/models/gold/core/core__fact_event_logs.yml +++ b/models/gold/core/core__fact_event_logs.yml @@ -1,38 +1,48 @@ version: 2 models: - name: core__fact_event_logs - description: '{{ doc("base_logs_table_doc") }}' + description: '{{ doc("evm_logs_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_logs_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: TOPICS - description: '{{ doc("base_topics") }}' + description: '{{ doc("evm_logs_topics") }}' + - name: TOPIC_0 + description: '{{ doc("evm_topic_0") }}' + - name: TOPIC_1 + description: '{{ doc("evm_topic_1") }}' + - name: TOPIC_2 + description: '{{ doc("evm_topic_2") }}' + - name: TOPIC_3 + description: '{{ doc("evm_topic_3") }}' - name: DATA - description: '{{ doc("base_logs_data") }}' + description: '{{ doc("evm_logs_data") }}' - name: EVENT_REMOVED - description: '{{ doc("base_event_removed") }}' + description: '{{ doc("evm_event_removed") }}' - name: _LOG_ID - description: '{{ doc("internal_column") }}' + description: '{{ doc("evm_column_deprecation_notice_log_id") }}' - name: TX_STATUS - description: '{{ doc("base_tx_status") }}' + description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' + - name: TX_SUCCEEDED + description: '{{ doc("evm_tx_succeeded") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("base_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: FACT_EVENT_LOGS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__fact_token_transfers.yml b/models/gold/core/core__fact_token_transfers.yml index 7dfa523..5d4d61e 100644 --- a/models/gold/core/core__fact_token_transfers.yml +++ b/models/gold/core/core__fact_token_transfers.yml @@ -2,10 +2,10 @@ version: 2 models: - name: core__fact_token_transfers description: '{{ doc("evm_fact_token_transfers_table_doc") }}' - + columns: - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' + description: '{{ doc("base_block_number") }}' - name: BLOCK_TIMESTAMP description: '{{ doc("base_block_timestamp") }}' - name: TX_HASH @@ -29,10 +29,10 @@ models: - name: RAW_AMOUNT_PRECISE description: '{{ doc("base_transfer_raw_amount_precise") }}' - name: _LOG_ID - description: '{{ doc("internal_column") }}' + description: '{{ doc("evm_column_deprecation_notice_log_id") }}' - name: FACT_TOKEN_TRANSFERS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__fact_traces.sql b/models/gold/core/core__fact_traces.sql index 6736ded..267d1a9 100644 --- a/models/gold/core/core__fact_traces.sql +++ b/models/gold/core/core__fact_traces.sql @@ -8,7 +8,7 @@ SELECT block_number, block_timestamp, tx_hash, - 1 AS tx_position, + tx_position, -- new column trace_index, from_address, @@ -16,29 +16,29 @@ SELECT input, output, TYPE, - '0x' AS trace_address, + trace_address, --new column sub_traces, DATA, VALUE, value_precise_raw, value_precise, - '0x' AS value_hex, + value_hex, --new column gas, gas_used, - '0x' AS origin_from_address, + origin_from_address, -- new column - '0x' AS origin_to_address, + origin_to_address, -- new column - '0x' AS origin_function_signature, + origin_function_signature, -- new column TRUE AS trace_succeeded, -- new column error_reason, - '0x' AS revert_reason, + revert_reason, -- new column - TRUE AS tx_succeeded, + tx_succeeded, -- new column fact_traces_id, COALESCE( diff --git a/models/gold/core/core__fact_traces.yml b/models/gold/core/core__fact_traces.yml index cb7b08f..aaa637f 100644 --- a/models/gold/core/core__fact_traces.yml +++ b/models/gold/core/core__fact_traces.yml @@ -1,56 +1,56 @@ version: 2 models: - name: core__fact_traces - description: '{{ doc("base_traces_table_doc") }}' + description: '{{ doc("evm_traces_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("base_traces_block_no") }}' + description: '{{ doc("evm_traces_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_traces_blocktime") }}' + description: '{{ doc("evm_traces_blocktime") }}' - name: TX_HASH - description: '{{ doc("base_traces_tx_hash") }}' + description: '{{ doc("evm_traces_tx_hash") }}' - name: FROM_ADDRESS - description: '{{ doc("base_traces_from") }}' + description: '{{ doc("evm_traces_from") }}' - name: TO_ADDRESS - description: '{{ doc("base_traces_to") }}' + description: '{{ doc("evm_traces_to") }}' - name: VALUE - description: '{{ doc("base_traces_value") }}' + description: '{{ doc("evm_traces_value") }}' - name: VALUE_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' + description: '{{ doc("evm_precise_amount_unadjusted") }}' - name: VALUE_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' + description: '{{ doc("evm_precise_amount_adjusted") }}' - name: GAS - description: '{{ doc("base_traces_gas") }}' + description: '{{ doc("evm_traces_gas") }}' - name: GAS_USED - description: '{{ doc("base_traces_gas_used") }}' + description: '{{ doc("evm_traces_gas_used") }}' - name: INPUT - description: '{{ doc("base_traces_input") }}' + description: '{{ doc("evm_traces_input") }}' - name: OUTPUT - description: '{{ doc("base_traces_output") }}' + description: '{{ doc("evm_traces_output") }}' - name: TYPE - description: '{{ doc("base_traces_type") }}' + description: '{{ doc("evm_traces_type") }}' - name: IDENTIFIER - description: '{{ doc("base_traces_identifier") }}' + description: '{{ doc("evm_column_deprecation_notice_identifier") }}' - name: DATA - description: '{{ doc("base_traces_call_data") }}' + description: '{{ doc("evm_column_deprecation_notice_data") }}' - name: TX_STATUS - description: '{{ doc("base_tx_status") }}' + description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' + - name: TX_SUCCEEDED + description: '{{ doc("evm_tx_succeeded") }}' - name: SUB_TRACES - description: '{{ doc("base_traces_sub") }}' + description: '{{ doc("evm_traces_sub") }}' - name: TRACE_STATUS - description: The status of the trace, either `SUCCESS` or `FAIL` + description: '{{ doc("evm_column_deprecation_notice_trace_status") }}' + - name: TRACE_SUCCEEDED + description: '{{ doc("evm_trace_succeeded") }}' - name: ERROR_REASON - description: The reason for the trace failure, if any. + description: '{{ doc("evm_traces_error_reason") }}' - name: TRACE_INDEX - description: The index of the trace within the transaction. + description: '{{ doc("evm_revert_reason") }}' - name: FACT_TRACES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - - - - \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__fact_transactions.sql b/models/gold/core/core__fact_transactions.sql index d2e2fb3..6db7d2a 100644 --- a/models/gold/core/core__fact_transactions.sql +++ b/models/gold/core/core__fact_transactions.sql @@ -51,12 +51,20 @@ SELECT r, s, v, - transactions_id AS fact_transactions_id, - {# GREATEST(COALESCE(A.inserted_timestamp, '2000-01-01'), COALESCE(b.inserted_timestamp, '2000-01-01')) AS inserted_timestamp, - GREATEST(COALESCE(A.modified_timestamp, '2000-01-01'), COALESCE(b.modified_timestamp, '2000-01-01')) AS modified_timestamp, - #} - A.inserted_timestamp, - A.modified_timestamp, + COALESCE ( + transactions_id, + {{ dbt_utils.generate_surrogate_key( + ['tx_hash'] + ) }} + ) AS fact_transactions_id, + COALESCE( + A.inserted_timestamp, + '2000-01-01' + ) AS inserted_timestamp, + COALESCE( + A.modified_timestamp, + '2000-01-01' + ) AS modified_timestamp, tx_status AS status, --deprecate POSITION, diff --git a/models/gold/core/core__fact_transactions.yml b/models/gold/core/core__fact_transactions.yml index 9ea2059..5e1325b 100644 --- a/models/gold/core/core__fact_transactions.yml +++ b/models/gold/core/core__fact_transactions.yml @@ -1,80 +1,86 @@ version: 2 models: - name: core__fact_transactions - description: '{{ doc("base_tx_table_doc") }}' + description: '{{ doc("evm_tx_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: BLOCK_HASH - description: '{{ doc("base_tx_block_hash") }}' + description: '{{ doc("evm_tx_block_hash") }}' - name: TX_HASH - description: '{{ doc("base_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' - name: NONCE - description: '{{ doc("base_tx_nonce") }}' + description: '{{ doc("evm_tx_nonce") }}' - name: POSITION - description: '{{ doc("base_tx_position") }}' + description: '{{ doc("evm_column_deprecation_notice_position") }}' + - name: TX_POSITION + description: '{{ doc("evm_tx_position") }}' - name: FROM_ADDRESS - description: '{{ doc("base_from_address") }}' + description: '{{ doc("evm_from_address") }}' - name: TO_ADDRESS - description: '{{ doc("base_to_address") }}' + description: '{{ doc("evm_to_address") }}' - name: VALUE - description: '{{ doc("base_value") }}' + description: '{{ doc("evm_value") }}' - name: VALUE_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' + description: '{{ doc("evm_precise_amount_unadjusted") }}' - name: VALUE_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' + description: '{{ doc("evm_precise_amount_adjusted") }}' - name: TX_FEE - description: '{{ doc("base_tx_fee") }}' + description: '{{ doc("evm_tx_fee") }}' - name: TX_FEE_PRECISE description: '{{ doc("tx_fee_precise") }}' - name: GAS_PRICE - description: '{{ doc("base_tx_gas_price") }}' + description: '{{ doc("evm_tx_gas_price") }}' - name: EFFECTIVE_GAS_PRICE description: The total base charge plus tip paid for each unit of gas, in Gwei. - name: GAS_LIMIT - description: '{{ doc("base_tx_gas_limit") }}' + description: '{{ doc("evm_tx_gas_limit") }}' - name: GAS_USED - description: '{{ doc("base_tx_gas_used") }}' + description: '{{ doc("evm_tx_gas_used") }}' - name: L1_GAS_PRICE - description: '{{ doc("base_l1_gas_price") }}' + description: '{{ doc("evm_l1_gas_price") }}' - name: L1_GAS_USED - description: '{{ doc("base_l1_gas_used") }}' + description: '{{ doc("evm_l1_gas_used") }}' - name: L1_FEE_SCALAR - description: '{{ doc("base_l1_fee_scalar") }}' + description: '{{ doc("evm_l1_fee_scalar") }}' - name: L1_FEE description: The L1 portion of fees paid. - name: L1_FEE_PRECISE - description: '{{ doc("tx_fee_precise") }}' + description: '{{ doc("evm_tx_fee_precise") }}' - name: L1_SUBMISSION_DETAILS description: Variant column that includes details regarding state root, index and tx_hash information for when the block is submitted to Ethereum Mainnet. - name: CUMULATIVE_GAS_USED - description: '{{ doc("base_cumulative_gas_used") }}' + description: '{{ doc("evm_cumulative_gas_used") }}' - name: MAX_FEE_PER_GAS description: The maximum fee per gas of the transaction, in Gwei. - name: MAX_PRIORITY_FEE_PER_GAS description: The maximum priority fee per gas of the transaction, in Gwei. - name: STATUS - description: '{{ doc("base_tx_status") }}' + description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' + - name: TX_SUCCEEDED + description: '{{ doc("evm_tx_succeeded") }}' - name: INPUT_DATA - description: '{{ doc("base_tx_input_data") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("base_tx_origin_sig") }}' + description: '{{ doc("evm_tx_input_data") }}' + - name: ORIGIN_FUNCTION_SIGNATURE + description: '{{ doc("evm_tx_origin_sig") }}' + - name: TX_TYPE + description: '{{ doc("evm_tx_type") }}' - name: R - description: The r value of the transaction signature. + description: '{{ doc("evm_r") }}' - name: S - description: The s value of the transaction signature. + description: '{{ doc("evm_s") }}' - name: V - description: The v value of the transaction signature. + description: '{{ doc("evm_v") }}' - name: FACT_TRANSACTIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' - name: DEPOSIT_NONCE description: The nonce of the deposit transaction. - name: DEPOSIT_RECEIPT_VERSION - description: The version of the deposit receipt. \ No newline at end of file + description: The version of the deposit receipt. diff --git a/models/gold/nft/nft__ez_nft_sales.sql b/models/gold/nft/nft__ez_nft_sales.sql index aa25263..c9a8695 100644 --- a/models/gold/nft/nft__ez_nft_sales.sql +++ b/models/gold/nft/nft__ez_nft_sales.sql @@ -18,9 +18,14 @@ SELECT seller_address, buyer_address, nft_address, + nft_address AS contract_address, project_name, + project_name as name, tokenId, + tokenid as token_id, erc1155_value, + coalesce(erc1155_value, '1')::STRING AS quantity, + iff(erc1155_value IS NULL, 'erc721', 'erc1155') AS token_standard, currency_symbol, currency_address, price, diff --git a/models/gold/nft/nft__ez_nft_transfers.sql b/models/gold/nft/nft__ez_nft_transfers.sql index 8759f10..b2e24e0 100644 --- a/models/gold/nft/nft__ez_nft_transfers.sql +++ b/models/gold/nft/nft__ez_nft_transfers.sql @@ -2,21 +2,23 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } -) }} + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' }} } +) }} SELECT block_timestamp, block_number, tx_hash, - 1 AS tx_position, + tx_position, -- new event_index, intra_event_index, + token_transfer_type, + -- new event_type, --deprecate IFF( - event_type = 'mint', + from_address = '0x0000000000000000000000000000000000000000', TRUE, FALSE ) AS is_mint, @@ -43,20 +45,13 @@ SELECT -- new erc1155_value, -- deprecate - erc1155_value AS quantity, + COALESCE(erc1155_value, '1') ::STRING AS quantity, -- new + IFF(erc1155_value IS NULL, 'erc721', 'erc1155') AS token_standard, -- new - IFF( - erc1155_value IS NOT NULL, - 'erc721', - 'erc1155' - ) AS token_standard, - -- new - '0x' AS origin_function_signature, - --new - '0x' AS origin_from_address, - --new - '0x' AS origin_to_address, - --new + -- origin_function_signature, + -- origin_from_address, + -- origin_to_address, + -- added later COALESCE ( nft_transfers_id, {{ dbt_utils.generate_surrogate_key(