Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement for balancer erc4626 tokens #7595

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ FROM {{ source('metamorpho_factory_ethereum', 'MetaMorphoV1_1Factory_evt_CreateM
JOIN {{ source('tokens', 'erc20') }} t
ON t.blockchain = 'ethereum'
AND a.asset = t.contract_address
AND a.metaMorpho != 0xbeefc011e94f43b8b7b455ebab290c7ab4e216f1

UNION

SELECT
erc4626_token,
erc4626_token_name,
erc4626_token_symbol,
underlying_token,
underlying_token_symbol,
decimals
FROM (VALUES
(0xbeefc011e94f43b8b7b455ebab290c7ab4e216f1, 'Coinshift USDL', 'csUDL', 0xbdC7c08592Ee4aa51D06C27Ee23D5087D65aDbcD, 'USDL', 18)
) AS temp_table (erc4626_token, erc4626_token_name, erc4626_token_symbol, underlying_token, underlying_token_symbol, decimals)
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ WITH wrap_unwrap AS(
m.erc4626_token_symbol,
m.underlying_token_symbol,
m.decimals,
ratio * price AS adjusted_price
ratio * price * POWER(10, (m.decimals - p.decimals)) AS adjusted_price
FROM wrap_unwrap w
JOIN {{ref('balancer_v3_ethereum_erc4626_token_mapping')}} m ON m.erc4626_token = w.wrappedToken
JOIN {{ source('prices', 'usd') }} p ON m.underlying_token = p.contract_address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ WITH wrap_unwrap AS(
m.erc4626_token_symbol,
m.underlying_token_symbol,
m.decimals,
ratio * price AS adjusted_price
ratio * price * POWER(10, (m.decimals - p.decimals)) AS adjusted_price
FROM wrap_unwrap w
JOIN {{ref('balancer_v3_gnosis_erc4626_token_mapping')}} m ON m.erc4626_token = w.wrappedToken
JOIN {{ source('prices', 'usd') }} p ON m.underlying_token = p.contract_address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ WITH wrap_unwrap AS(
m.erc4626_token_symbol,
m.underlying_token_symbol,
m.decimals,
ratio * price AS adjusted_price
ratio * price * POWER(10, (m.decimals - p.decimals)) AS adjusted_price
FROM wrap_unwrap w
JOIN {{ref('balancer_v3_sonic_erc4626_token_mapping')}} m ON m.erc4626_token = w.wrappedToken
JOIN {{ source('prices', 'usd') }} p ON m.underlying_token = p.contract_address
Expand Down