labels seed

This commit is contained in:
Jack Forgash 2022-07-29 16:49:22 -06:00
parent b17372ba3d
commit 2eefd48018
2 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,12 @@
token,symbol,token_contract
NEAR,NEAR,wrap.near
Wrapped Ether,wETH,c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.factory.bridge.near
Wrapped Bitcoin,wBTC,2260fac5e5542a773aa44fbcfedf7c193bc2c599.factory.bridge.near
Tether USD,USDT,dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near
USN,USN,usn
Bridged Aurora,AURORA,aaaaaa20d9e0e2461697782ef11675f668207961.factory.bridge.near
USD Coin,USDC,a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near
Meta Pool Liquid Staking Token,stNEAR,meta-pool.near
Dai Stablecoin,DAI,6b175474e89094c44da98b954eedeac495271d0f.factory.bridge.near
Aurora,AURORA,aurora
LiNEAR,LiNEAR,linear-protocol.near
1 token symbol token_contract
2 NEAR NEAR wrap.near
3 Wrapped Ether wETH c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.factory.bridge.near
4 Wrapped Bitcoin wBTC 2260fac5e5542a773aa44fbcfedf7c193bc2c599.factory.bridge.near
5 Tether USD USDT dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near
6 USN USN usn
7 Bridged Aurora AURORA aaaaaa20d9e0e2461697782ef11675f668207961.factory.bridge.near
8 USD Coin USDC a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near
9 Meta Pool Liquid Staking Token stNEAR meta-pool.near
10 Dai Stablecoin DAI 6b175474e89094c44da98b954eedeac495271d0f.factory.bridge.near
11 Aurora AURORA aurora
12 LiNEAR LiNEAR linear-protocol.near

View File

@ -14,6 +14,12 @@ WITH txs AS (
WHERE
{{ incremental_load_filter('_inserted_timestamp') }}
),
token_labels AS (
SELECT
*
FROM
{{ ref('seeds__token_labels') }}
),
oracle_msgs AS (
SELECT
block_id,
@ -45,7 +51,7 @@ prices AS (
tx_receiver,
actions_len,
INDEX,
VALUE :asset_id :: STRING AS asset_id,
VALUE :asset_id :: STRING AS token_contract,
CASE
WHEN asset_id = 'aurora' THEN VALUE :price :multiplier :: DOUBLE / pow (
10,
@ -62,8 +68,25 @@ prices AS (
LATERAL FLATTEN(
input => response :prices
)
),
add_labels AS (
SELECT
p.block_id,
p.tx_hash,
p.block_timestamp,
p.actions_len,
p.index,
l.token,
l.symbol,
p.token_contract,
p.price_usd,
p.tx_receiver AS source,
p._inserted_timestamp
FROM
prices p
LEFT JOIN token_labels l USING (token_contract)
)
SELECT
*
FROM
prices
add_labels