Skip to content

Commit

Permalink
Update _schema for balancer models (duneanalytics#7331)
Browse files Browse the repository at this point in the history
* Update _schema.yml

* Update _schema.yml

* Update _schema.yml

* Update balancer_v3_ethereum_erc4626_token_prices.sql

* Update balancer_v3_gnosis_erc4626_token_prices.sql

* Update balancer_v3_erc4626_token_prices.sql
  • Loading branch information
viniabussafi authored Dec 13, 2024
1 parent 025892f commit f0b3045
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
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

0 comments on commit f0b3045

Please sign in to comment.