mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 15:51:44 +00:00
Merge pull request #341 from FlipsideCrypto/AN-5111-LENDING-DECIMAL-FIX
AN-5111/map select token contracts to 18 decimals
This commit is contained in:
commit
c8d6944ba4
@ -29,7 +29,22 @@ labels AS (
|
||||
contract_address,
|
||||
NAME,
|
||||
symbol,
|
||||
decimals
|
||||
IFF(
|
||||
contract_address IN (
|
||||
-- wbtc
|
||||
'2260fac5e5542a773aa44fbcfedf7c193bc2c599.factory.bridge.near',
|
||||
-- usdc.e
|
||||
'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near',
|
||||
-- usdc
|
||||
'17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1',
|
||||
-- usdt
|
||||
'usdt.tether-token.near',
|
||||
-- usdt.e
|
||||
'dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near'
|
||||
),
|
||||
18,
|
||||
decimals
|
||||
) AS decimals
|
||||
FROM
|
||||
{{ ref('silver__ft_contract_metadata') }}
|
||||
),
|
||||
@ -37,7 +52,7 @@ prices AS (
|
||||
SELECT
|
||||
DATE_TRUNC(
|
||||
'hour',
|
||||
hour
|
||||
HOUR
|
||||
) AS block_timestamp,
|
||||
token_address AS contract_address,
|
||||
AVG(price) AS price_usd
|
||||
@ -61,10 +76,11 @@ FINAL AS (
|
||||
lb.symbol,
|
||||
l.amount_raw,
|
||||
l.amount_adj,
|
||||
l.amount_adj/ pow(
|
||||
l.amount_adj / pow(
|
||||
10,
|
||||
lb.decimals
|
||||
) AS amount,
|
||||
p.price_usd,
|
||||
amount * p.price_usd AS amount_usd,
|
||||
l.ez_lending_id,
|
||||
l.inserted_timestamp,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user