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

Update _schema for balancer models #7331

Merged
merged 6 commits into from
Dec 13, 2024
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 @@ -7,7 +7,7 @@ models:
project: balancer
contributors: viniabussafi
config:
tags: ['ethereum', 'gnosis', 'static', 'token', 'mapping']
tags: ['ethereum', 'gnosis', 'token', 'mapping']
description: >
Mapping of ERC4626 tokens, including aTokens and MetaMorpho tokens, and their corresponding underlying tokens.
data_tests:
Expand Down Expand Up @@ -36,7 +36,7 @@ models:
project: balancer
contributors: viniabussafi
config:
tags: ['ethereum', 'gnosis', 'static', 'token', 'pricing']
tags: ['ethereum', 'gnosis', 'token', 'pricing']
description: >
Pricing information for ERC4626 tokens. Prices are derived from the ratio of underlying tokens deposited or withdrawn to shares issued or burned, multiplied by the underlying token price.
data_tests:
Expand All @@ -62,4 +62,4 @@ models:
- name: median_price
description: "Median price of the static token, computed over the dataset."
- name: next_change
description: "Timestamp of the next expected pricing change or event affecting the price."
description: "Timestamp of the next expected pricing change or event affecting the price."
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
}}


{% set balancer_models = [
ref('balancer_v3_ethereum_erc4626_token_prices'),
ref('balancer_v3_gnosis_erc4626_token_prices')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ models:
project: balancer
contributors: viniabussafi
config:
tags: ['ethereum', 'static', 'token', 'mapping']
tags: ['ethereum', 'token', 'mapping']
description: >
Mapping of ERC4626 tokens on Ethereum, including aTokens and MetaMorpho tokens, and their corresponding underlying tokens.
data_tests:
Expand Down Expand Up @@ -36,7 +36,7 @@ models:
project: balancer
contributors: viniabussafi
config:
tags: ['ethereum', 'static', 'token', 'prices']
tags: ['ethereum', 'token', 'prices']
description: >
Pricing information for ERC4626 tokens on Ethereum. Prices are derived from the ratio of underlying tokens deposited or withdrawn to shares issued or burned, multiplied by the underlying token price.
data_tests:
Expand All @@ -62,4 +62,4 @@ models:
- name: median_price
description: "Median price of the static token, computed over the dataset."
- name: next_change
description: "Timestamp of the next expected pricing change or event affecting the price."
description: "Timestamp of the next expected pricing change or event affecting the price."
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
)
}}


WITH wrap_unwrap AS(
SELECT
evt_block_time,
Expand Down Expand Up @@ -62,4 +63,5 @@ SELECT
APPROX_PERCENTILE(adjusted_price, 0.5) AS median_price,
LEAD(p.evt_block_time, 1, CURRENT_DATE + INTERVAL '1' day) OVER (PARTITION BY wrappedToken ORDER BY p.evt_block_time) AS next_change
FROM price_join p
GROUP BY 1, 2, 3, 4, 5, 6, 7
GROUP BY 1, 2, 3, 4, 5, 6, 7

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ models:
project: balancer
contributors: viniabussafi
config:
tags: ['gnosis', 'static', 'token', 'mapping']
tags: ['gnosis', 'token', 'mapping']
description: >
Mapping of ERC4626 tokens on gnosis, including aTokens and MetaMorpho tokens, and their corresponding underlying tokens.
data_tests:
Expand Down Expand Up @@ -36,7 +36,7 @@ models:
project: balancer
contributors: viniabussafi
config:
tags: ['gnosis', 'static', 'token', 'prices']
tags: ['gnosis', 'token', 'prices']
description: >
Pricing information for ERC4626 tokens on gnosis. Prices are derived from the ratio of underlying tokens deposited or withdrawn to shares issued or burned, multiplied by the underlying token price.
data_tests:
Expand All @@ -62,4 +62,4 @@ models:
- name: median_price
description: "Median price of the static token, computed over the dataset."
- name: next_change
description: "Timestamp of the next expected pricing change or event affecting the price."
description: "Timestamp of the next expected pricing change or event affecting the price."
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
)
}}


WITH wrap_unwrap AS(
SELECT
evt_block_time,
Expand Down Expand Up @@ -62,4 +63,4 @@ SELECT
APPROX_PERCENTILE(adjusted_price, 0.5) AS median_price,
LEAD(p.evt_block_time, 1, CURRENT_DATE + INTERVAL '1' day) OVER (PARTITION BY wrappedToken ORDER BY p.evt_block_time) AS next_change
FROM price_join p
GROUP BY 1, 2, 3, 4, 5, 6, 7
GROUP BY 1, 2, 3, 4, 5, 6, 7
Loading