-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from Synthetixio/finish-l1
Complete L1 Additions
- Loading branch information
Showing
7 changed files
with
89 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ duckdb==0.10.2 | |
polars-lts-cpu==1.1.0 | ||
pandas | ||
numpy | ||
synthetix==0.1.13 | ||
synthetix==0.1.13 | ||
web3==6.20.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 28 additions & 24 deletions
52
transformers/synthetix/models/raw/base/mainnet/core/core_vault_debt_base_mainnet.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
with base as ( | ||
select | ||
WITH base AS ( | ||
SELECT | ||
block_number, | ||
contract_address, | ||
chain_id, | ||
pool_id, | ||
collateral_type, | ||
cast( | ||
value_1 as numeric | ||
) as debt | ||
from | ||
CAST( | ||
value_1 AS numeric | ||
) AS debt | ||
FROM | ||
{{ source( | ||
'raw_base_mainnet', | ||
"core_get_vault_debt" | ||
) }} | ||
where | ||
value_1 is not null | ||
WHERE | ||
value_1 IS NOT NULL | ||
) | ||
|
||
select | ||
to_timestamp(blocks.timestamp) as ts, | ||
cast( | ||
blocks.block_number as integer | ||
) as block_number, | ||
SELECT | ||
TO_TIMESTAMP( | ||
blocks.timestamp | ||
) AS ts, | ||
CAST( | ||
blocks.block_number AS INTEGER | ||
) AS block_number, | ||
base.contract_address, | ||
cast( | ||
base.pool_id as integer | ||
) as pool_id, | ||
cast( | ||
base.collateral_type as varchar | ||
) as collateral_type, | ||
{{ convert_wei('base.debt') }} as debt | ||
from | ||
CAST( | ||
base.pool_id AS INTEGER | ||
) AS pool_id, | ||
CAST( | ||
base.collateral_type AS VARCHAR | ||
) AS collateral_type, | ||
{{ convert_wei('base.debt') }} AS debt | ||
FROM | ||
base | ||
inner join {{ source('raw_base_mainnet', 'blocks_parquet') }} as blocks | ||
on base.block_number = blocks.block_number | ||
INNER JOIN {{ source( | ||
'raw_base_mainnet', | ||
'blocks_parquet' | ||
) }} AS blocks | ||
ON base.block_number = blocks.block_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters