-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'op-velodrome' of https://github.com/LamprosLabsDAO/spel…
…lbook into op-velodrome
- Loading branch information
Showing
33 changed files
with
1,292 additions
and
14 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
dbt_subprojects/daily_spellbook/models/aave/base/aave_base_interest_rates.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{ config( | ||
schema = 'aave_base' | ||
, alias = 'interest_rates' | ||
, post_hook='{{ expose_spells(blockchains = \'["base"]\', | ||
spell_type = "project", | ||
spell_name = "aave", | ||
contributors = \'["mikeghen1","batwayne", "chuxin"]\') }}' | ||
) | ||
}} | ||
|
||
SELECT * | ||
FROM | ||
( | ||
SELECT | ||
reserve, | ||
symbol, | ||
hour, | ||
deposit_apy, | ||
stable_borrow_apy, | ||
variable_borrow_apy | ||
FROM {{ ref('aave_v3_base_interest_rates') }} | ||
/* | ||
UNION ALL | ||
< add new version as needed | ||
*/ | ||
) |
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
28 changes: 28 additions & 0 deletions
28
dbt_subprojects/daily_spellbook/models/aave/base/aave_v3_base_interest_rates.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{ config( | ||
schema = 'aave_v3_base' | ||
, alias = 'interest_rates' | ||
, materialized = 'incremental' | ||
, file_format = 'delta' | ||
, incremental_strategy = 'merge' | ||
, unique_key = ['reserve', 'symbol', 'hour'] | ||
, post_hook='{{ expose_spells(blockchains = \'["base"]\', | ||
spell_type = "project", | ||
spell_name = "aave_v3", | ||
contributors = \'["mikeghen1","batwayne", "chuxin"]\') }}' | ||
) | ||
}} | ||
|
||
select | ||
a.reserve, | ||
t.symbol, | ||
date_trunc('hour',a.evt_block_time) as hour, | ||
avg(CAST(a.liquidityRate AS DOUBLE)) / 1e27 as deposit_apy, | ||
avg(CAST(a.stableBorrowRate AS DOUBLE)) / 1e27 as stable_borrow_apy, | ||
avg(CAST(a.variableBorrowRate AS DOUBLE)) / 1e27 as variable_borrow_apy | ||
from {{ source('aave_v3_base', 'L2Pool_evt_ReserveDataUpdated') }} a | ||
left join {{ source('tokens', 'erc20') }} t | ||
on a.reserve = t.contract_address and t.blockchain = 'base' | ||
{% if is_incremental() %} | ||
WHERE {{ incremental_predicate('evt_block_time') }} | ||
{% endif %} | ||
group by 1,2,3 |
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
25 changes: 25 additions & 0 deletions
25
dbt_subprojects/daily_spellbook/tests/aave/base/aave_base_interests_test.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
with unit_test1 | ||
as (select case | ||
when abs(variable_borrow_apy - 0.10808360395679557) / 0.10808360395679557 < 0.001 | ||
then true | ||
else false | ||
end as test | ||
from {{ ref('aave_v3_base_interest_rates' )}} | ||
where reserve = 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 -- USDC | ||
and hour = TIMESTAMP '2025-01-02 20:00'), | ||
unit_test2 | ||
as (select case | ||
when abs(deposit_apy - 0.015712521763084) / 0.015712521763084 < 0.001 | ||
then true | ||
else false | ||
end as test | ||
from {{ ref('aave_v3_base_interest_rates' )}} | ||
where symbol = 'WETH' -- 0x4200000000000000000000000000000000000006 | ||
and hour = TIMESTAMP '2024-08-21 03:00') | ||
select * | ||
from (select * | ||
from unit_test1 | ||
union | ||
select * | ||
from unit_test2) | ||
where test = false |
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
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 |
---|---|---|
|
@@ -188,6 +188,7 @@ models: | |
version: | ||
- 2 | ||
- mmpool | ||
- pcsx | ||
|
||
- name: shibaswap_v1_ethereum_base_trades | ||
meta: | ||
|
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
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
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
2 changes: 1 addition & 1 deletion
2
dbt_subprojects/dex/seeds/trades/saddle_finance_optimism_base_trades_seed.csv
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,2 +1,2 @@ | ||
blockchain,project,version,block_month,block_date,block_time,block_number,token_sold_amount_raw,token_bought_amount_raw,token_sold_address,token_bought_address,maker,taker,project_contract_address,tx_hash,evt_index | ||
optimism,saddle_finance,1,2022-08-01 00:00,2022-08-05 00:00,2022-08-05 19:11,17943155,74907384,74857799085655995549,0x0000000000000000000000000000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000000000000000000000000001,0xd131f1bcdd547e067af447dd3c36c99d6be9fdeb,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xbccdcd4ab61e5ad3384eb173156c3c0507d3bb3f2d2f5a406379e74aafbec38d,3 | ||
optimism,saddle_finance,1,2022-08-01 00:00,2022-08-05 00:00,2022-08-05 19:11,17943155,74907384,74857799085655995549,0xda10009cbd5d07dd0cecc66161fc93d7c9000da1,0x7f5c764cbc14f9669b88837ca1490cca17c31607,0xd131f1bcdd547e067af447dd3c36c99d6be9fdeb,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xbccdcd4ab61e5ad3384eb173156c3c0507d3bb3f2d2f5a406379e74aafbec38d,3 |
2 changes: 1 addition & 1 deletion
2
dbt_subprojects/dex/seeds/trades/stablebase_base_base_trades_seed.csv
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,2 +1,2 @@ | ||
blockchain,project,version,block_month,block_date,block_time,block_number,token_sold_amount_raw,token_bought_amount_raw,token_sold_address,token_bought_address,maker,taker,project_contract_address,tx_hash,evt_index | ||
base,stablebase,1,2023-08-01,2023-08-28,2023-08-28 19:18:00.000,3230470,129976172599579374396,135180385,0x0000000000000000000000000000000000000000000000000000000000000001,0x0000000000000000000000000000000000000000000000000000000000000000,0x19fbc29d72476365a62151ffdbf4764e54774a81,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0xc2dec669877f4edfcb7debd2eb23288a0fba8cd57d6f3fb3e45e8b15a6458d43,31 | ||
base,stablebase,1,2023-08-01,2023-08-28,2023-08-28 19:18:00.000,3230470,129976172599579374396,135180385,0x50c5725949a6f0c72e6c4a641f24049a917db0cb,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x19fbc29d72476365a62151ffdbf4764e54774a81,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0xc2dec669877f4edfcb7debd2eb23288a0fba8cd57d6f3fb3e45e8b15a6458d43,31 |
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
Oops, something went wrong.