-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update profiles, payment calculations and add new tables
Updated the profiles.yml to use environment variables for passwords. Enhanced payment calculations to include USD equivalents by joining with the prices table. Added a new incremental table for mints and simplified the mint per month query. Added a basic index.html file with an iframe for embedding a dashboard.
- Loading branch information
Showing
5 changed files
with
99 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{ | ||
config( | ||
materialized='incremental', | ||
indexes=[ | ||
{'columns': ['block_number']}, | ||
{'columns': ['block_time']}, | ||
{'columns': ['trx_hash']}, | ||
{'columns': ['to_address']}, | ||
] | ||
) | ||
}} | ||
|
||
select b.timestamp as block_time, m.amount, m.to_address, t.hash as trx_hash, b.number as block_number | ||
from hivemapper.mints m | ||
inner join hivemapper.transactions t on t.id = m.transaction_id | ||
inner join hivemapper.blocks b on b.id = t.block_id | ||
{% if is_incremental() %} | ||
where b.number > (select max(block_number) from {{ this }}) | ||
and date_bin('5 minutes', b.timestamp , TIMESTAMP '2001-01-01') <= (select p.timestamp from "hivemapper"."hivemapper"."prices" p order by p.timestamp desc limit 1) | ||
{% endif %} |
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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
{{ config(materialized='incremental') }} | ||
{{ config(materialized='table') }} | ||
|
||
select DATE_TRUNC('month', b.timestamp) as month, COALESCE(SUM(br.amount), 0) as total | ||
from hivemapper.mints br | ||
inner join hivemapper.transactions t on t.id = br.transaction_id | ||
inner join hivemapper.blocks b on b.id = t.block_id | ||
{% if is_incremental() %} | ||
where b.timestamp >= (select coalesce(max(month),'1900-01-01') from {{ this }} ) | ||
{% endif %} | ||
|
||
group by DATE_TRUNC('month', b.timestamp) | ||
select | ||
DATE_TRUNC('month', p.block_time) as month, | ||
sum(p.amount) as total | ||
from hivemapper.dbt_all_mints p | ||
group by DATE_TRUNC('month', p.block_time) |
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,15 @@ | ||
<html> | ||
<body> | ||
|
||
<iframe | ||
src="charless-macbook-pro-2.local:3000/public/dashboard/3e029abe-66bf-4cad-895c-e39922f03927?fleet_address=" | ||
frameborder="0" | ||
width="800" | ||
height="600" | ||
allowtransparency | ||
style="background: olive" | ||
></iframe> | ||
|
||
</body> | ||
|
||
</html> |