From 76bc61e09ec87e967c5e2820d18b57742a533ff3 Mon Sep 17 00:00:00 2001 From: soispoke <66172107+soispoke@users.noreply.github.com> Date: Wed, 7 Sep 2022 10:23:54 +0200 Subject: [PATCH] add balances --- .../labels/balances/labels_balances_erc20.sql | 20 +++++++++++++++++++ .../balances/labels_balances_schema.yml | 15 ++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 models/labels/balances/labels_balances_erc20.sql create mode 100644 models/labels/balances/labels_balances_schema.yml diff --git a/models/labels/balances/labels_balances_erc20.sql b/models/labels/balances/labels_balances_erc20.sql new file mode 100644 index 00000000000..04161f1d789 --- /dev/null +++ b/models/labels/balances/labels_balances_erc20.sql @@ -0,0 +1,20 @@ +{{config(alias='balances_erc20')}} + +WITH erc20_balances AS +(SELECT + 'ethereum' as blockchain, + wallet_address as address, + amount_usd as latest_balance_usd +FROM {{ ref('balances_ethereum_erc20_latest') }}) + +SELECT + collect_set(blockchain) as blockchain, + address, + latest_balance_usd, + 'balances' AS category, + 'soispoke' AS contributor, + 'query' AS source, + timestamp('2022-10-04') as created_at, + now() as updated_at +FROM erc20_balances +GROUP BY address, latest_balance_usd \ No newline at end of file diff --git a/models/labels/balances/labels_balances_schema.yml b/models/labels/balances/labels_balances_schema.yml new file mode 100644 index 00000000000..2a86cd09f36 --- /dev/null +++ b/models/labels/balances/labels_balances_schema.yml @@ -0,0 +1,15 @@ +version: 2 + +models: + - name: labels_balances + meta: + blockchain: ethereum + sector: labels + category: balances + project: ['erc20'] + contibutors: soispoke + config: + tags: ['labels', 'balances', 'ethereum', 'erc20', 'latest'] + description: "Token millionaires and billionaires query labels on Ethereum" + + \ No newline at end of file