-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
362 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: prices_flare_tokens | ||
meta: | ||
blockchain: flare | ||
sector: prices | ||
contributors: hosuke | ||
config: | ||
tags: ['prices', 'tokens', 'usd', 'flare'] | ||
description: "Price tokens on Flare Network EVM chain" | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- contract_address | ||
columns: | ||
- name: token_id | ||
description: "Id of the token at coinpaprika. This id is required to pull the price feed data. NOTE: Not all tokens are listed at coinpaprika - consider using price data from DEX sources in this case or submit a listing request at coinpaprika." | ||
- name: blockchain | ||
description: "Native blockchain of the token, if any" | ||
data_tests: | ||
- accepted_values: | ||
values: [ "flare" ] | ||
- name: contract_address | ||
description: "Contract address of the token, if any" | ||
- name: symbol | ||
description: "Token symbol" | ||
- name: decimals | ||
description: "Number of decimals for the token contract" |
22 changes: 22 additions & 0 deletions
22
dbt_subprojects/tokens/models/prices/flare/prices_flare_tokens.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% set blockchain = 'flare' %} | ||
|
||
{{ config( | ||
schema = 'prices_' + blockchain, | ||
alias = 'tokens', | ||
tags = ['static'] | ||
) | ||
}} | ||
|
||
SELECT | ||
token_id | ||
, '{{ blockchain }}' as blockchain | ||
, symbol | ||
, contract_address | ||
, decimals | ||
FROM | ||
( | ||
VALUES | ||
('flare-flare', 'WFLR', 0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d, 18) | ||
-- Note: Currently only WFLR has a reliable price feed. Other tokens will be added | ||
-- when they have established price feeds on major price aggregators. | ||
) as temp (token_id, symbol, contract_address, decimals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
dbt_subprojects/tokens/models/tokens/flare/tokens_flare_erc20.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{ | ||
config( | ||
schema = 'tokens_flare', | ||
alias = 'erc20', | ||
post_hook = '{{ expose_spells(\'["flare"]\', | ||
"sector", | ||
"tokens", | ||
\'["hosuke"]\') }}' | ||
) | ||
}} | ||
|
||
SELECT DISTINCT | ||
'flare' as blockchain, | ||
contract_address, | ||
symbol, | ||
decimals, | ||
token_name as name | ||
FROM ( | ||
VALUES | ||
-- Base tokens | ||
(0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d, 'Wrapped Flare', 'WFLR', 18), | ||
-- Other tokens | ||
(0x282b88514A52FcAdCD92b742745398f3574697d4, 'Finu', 'FINU', 18), | ||
(0x64cB9bE6323c7a2cE39773674F380da30663bae4, 'ScottyCash', 'SCOTTY', 18), | ||
(0xDE373AE127A11E756A9D1cc7743816928B239283, 'DAX.BEST', 'DAX', 18), | ||
(0x932E691aA8c8306C4bB0b19F3f00a284371be8Ba, 'Phili Inu', 'PHIL', 18), | ||
(0x22757fb83836e3F9F0F353126cACD3B1Dc82a387, 'FlareFox', 'FLX', 18), | ||
(0xa80C114A90565C03BDCAbC1fcF913cC225d2c5ab, 'F-Asset Token', 'FASSET', 18), | ||
(0xc6B19B06A92B337Cbca5f7334d29d45ec4d5E532, 'Dog on Moon', 'Moon', 18) | ||
) as temp (contract_address, token_name, symbol, decimals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{% docs flare_transactions_doc %} | ||
|
||
The `flare.transactions` table contains detailed information about transactions on the flare blockchain. It includes: | ||
|
||
- Block information: number, timestamp, hash | ||
- Transaction details: hash, from_address, to_address, value | ||
- Gas data: gas_price, gas_limit, gas_used | ||
- Status: success or failure | ||
- Input data for contract interactions | ||
- Nonce | ||
- Transaction type | ||
|
||
This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on flare. | ||
|
||
{% enddocs %} | ||
|
||
{% docs flare_traces_doc %} | ||
|
||
The `flare.traces` table contains records of execution steps for transactions on the flare blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: | ||
|
||
- Transaction hash | ||
- Block number and timestamp | ||
- From and to addresses | ||
- Value transferred | ||
- Input data | ||
- Call type (e.g., CALL, DELEGATECALL, CREATE) | ||
- Gas information | ||
- Error messages (if any) | ||
|
||
This table is essential for: | ||
- Analyzing internal transactions | ||
- Debugging smart contract interactions | ||
- Tracking value flows through complex transactions | ||
- Understanding contract creation and deployment | ||
|
||
{% enddocs %} | ||
|
||
{% docs flare_logs_doc %} | ||
|
||
The `flare.logs` table contains information about event logs emitted by smart contracts on the flare blockchain. It includes: | ||
|
||
- Block information: number, timestamp | ||
- Transaction hash | ||
- Contract address (emitting the event) | ||
- Topic0 (event signature) | ||
- Additional topics (indexed parameters) | ||
- Data field (non-indexed parameters) | ||
- Log index | ||
|
||
This table is crucial for: | ||
- Tracking on-chain events | ||
- Monitoring contract activity | ||
- Analyzing token transfers | ||
- Following protocol-specific events | ||
|
||
{% enddocs %} | ||
|
||
{% docs flare_contracts_doc %} | ||
|
||
The `flare.contracts` table tracks decoded contracts on flare, including: | ||
|
||
- Contract address | ||
- Bytecode | ||
- Contract name | ||
- Namespace | ||
- ABI | ||
- Creation details | ||
|
||
This table is used for: | ||
- Contract verification | ||
- Smart contract analysis | ||
- Protocol research | ||
- Development and debugging | ||
|
||
{% enddocs %} |
Oops, something went wrong.