Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
184faec
update the balance to repoint to the bronze model
XYGUAN Jan 21, 2022
86466f4
Update terra_dbt__balances.sql
XYGUAN Jan 27, 2022
4619f66
Merge branch 'main' into origin/AN-500/refactor_terra_balance
XYGUAN Feb 18, 2022
6277c9a
Merge branch 'main' into origin/AN-500/refactor_terra_balance
XYGUAN Feb 22, 2022
c27049b
update the terra balance source table
XYGUAN Feb 23, 2022
d0661ec
test and model updates
austinFlipside Feb 24, 2022
46fdd28
update the table
XYGUAN Feb 24, 2022
52fec94
more tests!
austinFlipside Feb 24, 2022
a639d49
improve incremental
austinFlipside Feb 24, 2022
b5371ca
update the daily balance table to use the bronze only
XYGUAN Feb 25, 2022
6437112
Merge branch 'main' into origin/AN-500/refactor_terra_balance
XYGUAN Feb 25, 2022
c12a915
Update ethereum__erc20_balances.yml
xiuy001 Feb 25, 2022
d8e4540
swaps updates
austinFlipside Feb 25, 2022
f9da63d
more recent
austinFlipside Feb 25, 2022
ffeb59e
more aave tests
austinFlipside Feb 25, 2022
74fe60b
Update silver_terra__daily_balances.sql
XYGUAN Feb 25, 2022
8472ceb
Merge branch 'origin/AN-500/refactor_terra_balance' of https://github…
XYGUAN Feb 25, 2022
c5cfce7
Update terra_dbt__balances.sql
XYGUAN Feb 25, 2022
53b6af0
updated the incremental logic
XYGUAN Feb 25, 2022
804ff59
Update terra_dbt__balances.sql
XYGUAN Feb 25, 2022
d3ee16f
updated unique key
XYGUAN Feb 25, 2022
692a659
updated unique key
XYGUAN Feb 25, 2022
cdda27d
Merge pull request #266 from FlipsideCrypto/origin/AN-500/refactor_te…
xiuy001 Feb 28, 2022
058fa21
curve change
austinFlipside Feb 28, 2022
bc88322
Merge pull request #360 from FlipsideCrypto/AN-787/Eth-Tests
austinFlipside Feb 28, 2022
598898c
AN-763/oracle_prices_unique_key (#361)
amasucci13 Feb 28, 2022
bf7c3ba
quick fix the issue
XYGUAN Feb 28, 2022
b86e069
Merge pull request #362 from FlipsideCrypto/origin/terra_balance_fix_1
James-Mission Feb 28, 2022
d598d17
rewrite jupyter swaps (#366)
desmond-hui Mar 2, 2022
c133c9c
gold swaps name change update
Mar 2, 2022
f24789e
updates
Mar 2, 2022
9534f9e
Merge pull request #367 from FlipsideCrypto/goldswaps
desmond-hui Mar 2, 2022
324dcdd
remove to_amt null records (#369)
desmond-hui Mar 2, 2022
1d2d825
created astroport table and the yml testing file (#363)
xiuy001 Mar 2, 2022
55c4a6e
make position collected fees full refresh
Mar 2, 2022
ada674b
Merge pull request #371 from FlipsideCrypto/AN-44/make-uniswap-full-load
James-Mission Mar 2, 2022
ed345c4
An 665/tx from to terra updated (#365)
Ryan-Loofy Mar 3, 2022
882965a
Fixes typo that allowed null program ids (#372)
jhuhnke Mar 3, 2022
1410814
An 758/orca swaps (#373)
desmond-hui Mar 3, 2022
8b89510
An 758/orca swaps (#375)
desmond-hui Mar 3, 2022
e4ae5a5
- persist_docs turned on
juls858 Mar 3, 2022
ec316b0
- desired changes
juls858 Mar 4, 2022
8859c37
- added back missing columns that were in main
juls858 Mar 5, 2022
4101207
- removed extraneous colon
juls858 Mar 5, 2022
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
2 changes: 1 addition & 1 deletion data/silver__ethereum_contracts_backfill.csv
Original file line number Diff line number Diff line change
Expand Up @@ -34870,4 +34870,4 @@ block_id,block_timestamp,creator_address,contract_address,logic_address,symbol,d
14039499,2022-01-20T01:25:54Z,,0x63cbD1858BD79DE1A06C3C26462DB360b834912D,0xfCF1aBC45A264D1172AF928ff04D3413bbC11A9f,eDOUGH,18,PProxy,,"{'MAX_VESTING_ENTRIES': 260, 'STAKE_DURATION': 36, 'decimals': 18, 'dough': '0xad32A8e6220741182940c5aBF610bDE99E737b2D', 'name': 'PieDAO Escrowed DOUGH', 'owner': '0x6458A23B020f489651f2777Bd849ddEd34DfCcd2', 'sharesTimeLock': '0x6Bd0D8c8aD8D3F1f97810d5Cc57E9296db73DC45', 'symbol': 'eDOUGH', 'totalEscrowedBalance': 9322667155262482001200519, 'totalSupply': 9322667155262482001200519}"
14039499,2022-01-20T01:25:54Z,,0x8D1ce361eb68e9E05573443C407D4A3Bed23B033,0x706F00ea85a71EB5d7C2ce2aD61DbBE62b616435,DEFI++,18,PProxyPausable,,"{'decimals': 18, 'getBPool': '0xd485e6a0389A42D75f4b00EcE91fc02340B73938', 'getCap': 10000000000000000000000000, 'getCircuitBreaker': '0x0000000000000000000000000000000000000000', 'getController': '0x6458A23B020f489651f2777Bd849ddEd34DfCcd2', 'getDenormalizedWeights': [35000000000000000000, 15000000000000000000], 'getFeeRecipient': '0x0000000000000000000000000000000000000000', 'getNewToken': ['0x0000000000000000000000000000000000000000', False, 0, 0, 0], 'getPublicSwapSetter': '0x6458A23B020f489651f2777Bd849ddEd34DfCcd2', 'getSwapFee': 10000000000000000, 'getTokenBinder': '0x6458A23B020f489651f2777Bd849ddEd34DfCcd2', 'getTokens': ['0x78F225869c08d478c34e5f645d07A87d3fe8eb78', '0xaD6A626aE2B43DCb1B39430Ce496d2FA0365BA9C'], 'name': 'PieDAO DEFI++', 'symbol': 'DEFI++', 'totalSupply': 365425429397430428382145}"
14039499,2022-01-20T01:25:54Z,,0xaD6A626aE2B43DCb1B39430Ce496d2FA0365BA9C,0x706F00ea85a71EB5d7C2ce2aD61DbBE62b616435,DEFI+S,18,PProxyPausable,,"{'decimals': 18, 'getAnnualFee': 7000000000000000, 'getBPool': '0x94743cfAa3FDC62e9693572314B5ee377EBa5d11', 'getCap': 5000000000000000000000000, 'getCircuitBreaker': '0x0000000000000000000000000000000000000000', 'getController': '0x6458A23B020f489651f2777Bd849ddEd34DfCcd2', 'getDenormalizedWeights': [6875825858394830000, 10755714301882800000, 13555533842553300000, 15000000000000000000, 1604619455069070000, 2208306542100000000], 'getFeeRecipient': '0xAF2fE0d4fe879066B2BaA68d9e56cC375DF22815', 'getNewToken': ['0x0000000000000000000000000000000000000000', False, 0, 0, 0], 'getPublicSwapSetter': '0x6458A23B020f489651f2777Bd849ddEd34DfCcd2', 'getSwapFee': 1000000000000, 'getTokenBinder': '0x6458A23B020f489651f2777Bd849ddEd34DfCcd2', 'getTokens': ['0xba100000625a3754423978a60c9317c58a424e3D', '0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD', '0x408e41876cCCDC0F92210600ef50372656052a38', '0x04Fa0d235C4abf4BcF4787aF4CF447DE572eF828', '0xec67005c4E498Ec7f55E092bd1d35cbC47C91892', '0x89Ab32156e46F46D02ade3FEcbe5Fc4243B9AAeD'], 'name': 'PieDAO DEFI Small Cap', 'symbol': 'DEFI+S', 'totalSupply': 260875387716765753838868}"
13811226,2021-12-15T17:59:33Z,,0x9BE89D2a4cd102D8Fecc6BF9dA793be995C22541,0x9F344834752cb3a8C54c3DdCd41Da4042b10D0b9,BBTC,8,AdminUpgradeabilityProxy,,"{'name': 'Binance Wrapped BTC', 'totalSupply': 990000000000, 'decimals': 8, 'owner': '0xD183F2BBF8b28d9fec8367cb06FE72B88778C86B', 'symbol': 'BBTC', 'pendingOwner': '0x0000000000000000000000000000000000000000'}"
13811226,2021-12-15T17:59:33Z,,0x9BE89D2a4cd102D8Fecc6BF9dA793be995C22541,0x9F344834752cb3a8C54c3DdCd41Da4042b10D0b9,BBTC,8,AdminUpgradeabilityProxy,,"{'name': 'Binance Wrapped BTC', 'totalSupply': 990000000000, 'decimals': 8, 'owner': '0xD183F2BBF8b28d9fec8367cb06FE72B88778C86B', 'symbol': 'BBTC', 'pendingOwner': '0x0000000000000000000000000000000000000000'}"
3 changes: 3 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ clean-targets: # directories to be removed by `dbt clean`
# using the `{{ config(...) }}` macro.
models:
+copy_grants: true
+persist_docs:
relation: true
columns: true
sql_models:
ethereum:
materialized: incremental
Expand Down
20 changes: 0 additions & 20 deletions macros/uniswapv3/uniswapv3_position_collected_fees.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
token1
FROM {{ src_pools_table }} p
WHERE
{% if is_incremental() %}
p.block_timestamp >= getdate() - interval '7 days'
{% else %}
p.block_timestamp >= getdate() - interval '9 months'
{% endif %}
),
pool_txs as (
SELECT
Expand All @@ -25,11 +21,7 @@
INNER JOIN pools p ON p.pool_address = ee.contract_address
WHERE
event_name = 'Collect'
{% if is_incremental() %}
AND ee.block_timestamp >= getdate() - interval '7 days'
{% else %}
AND ee.block_timestamp >= getdate() - interval '9 months'
{% endif %}
),
burns as (
SELECT
Expand All @@ -43,11 +35,7 @@
ee.tx_id IN (SELECT tx_id FROM pool_txs)
AND event_name = 'Burn'
AND (ee.event_inputs:amount0 > 0 or ee.event_inputs:amount1 > 0)
{% if is_incremental() %}
AND ee.block_timestamp >= getdate() - interval '7 days'
{% else %}
AND ee.block_timestamp >= getdate() - interval '9 months'
{% endif %}
),
-- Get nf position info by looking at corresponding nf pos event
nf_positions as (
Expand All @@ -62,11 +50,7 @@
AND contract_address NOT IN (SELECT pool_address FROM pool_txs)
AND event_inputs:tokenId is not null
AND event_name = 'Collect'
{% if is_incremental() %}
AND ee.block_timestamp >= getdate() - interval '7 days'
{% else %}
AND ee.block_timestamp >= getdate() - interval '9 months'
{% endif %}
),
lp_providers as (
SELECT * FROM (
Expand Down Expand Up @@ -152,11 +136,7 @@
-- in a tx, and there are burn events we want to ensure we're pairing up the burns against collect
-- events with actual amounts. Otherwise we end up with negative collects.
and (ee.event_inputs:amount0 > 0 or ee.event_inputs:amount1 > 0)
{% if is_incremental() %}
AND ee.block_timestamp >= getdate() - interval '7 days'
{% else %}
AND ee.block_timestamp >= getdate() - interval '9 months'
{% endif %}
HAVING (amount0_adjusted >= 0 or amount1_adjusted >= 0)

{%- endmacro %}
2 changes: 1 addition & 1 deletion models/algorand/gold/algorand__account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ models:
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: WALLET_TYPE
tests:
Expand Down
2 changes: 1 addition & 1 deletion models/algorand/gold/algorand__account_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ models:
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: APP_INFO
tests:
Expand Down
2 changes: 1 addition & 1 deletion models/algorand/gold/algorand__account_asset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ models:
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: FROZEN
tests:
Expand Down
4 changes: 2 additions & 2 deletions models/algorand/gold/algorand__app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ models:
- not_null
- name: CREATED_AT
tests:
- not_null
- not_null
- name: CREATED_AT_TIMESTAMP
tests:
- not_null
- not_null
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ models:
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: block_id
tests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ models:
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- name: BLOCK_ID
tests:
- not_null
Expand Down
3 changes: 1 addition & 2 deletions models/algorand/gold/algorand__asset_freeze_transaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ models:
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- name: BLOCK_ID
tests:
- not_null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ models:
- not_null:
enabled: False
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: BLOCK_ID
tests:
Expand Down
5 changes: 2 additions & 3 deletions models/algorand/gold/algorand__block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ models:
- not_null
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: REWARDSLEVEL
tests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ models:
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- name: BLOCK_ID
tests:
- not_null
Expand Down
7 changes: 2 additions & 5 deletions models/algorand/gold/algorand__payment_transaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ models:
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: BLOCK_ID
tests:
Expand All @@ -28,8 +27,6 @@ models:
- name: SENDER
tests:
- not_null
- dbt_expectations.expect_column_value_lengths_to_equal:
value: 58
- name: TX_TYPE
tests:
- not_null
Expand Down
5 changes: 2 additions & 3 deletions models/algorand/gold/algorand__transaction_participation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ models:
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: BLOCK_ID
tests:
Expand Down
7 changes: 3 additions & 4 deletions models/algorand/gold/algorand__transactions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ models:
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null:
enabled: False
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: BLOCK_ID
tests:
Expand All @@ -22,7 +21,7 @@ models:
- name: INNER_TX
tests:
- not_null
- name: SENDER
- name: SENDER
tests:
- not_null
- dbt_expectations.expect_column_value_lengths_to_equal:
Expand Down
14 changes: 11 additions & 3 deletions models/algorand/silver/silver_algorand__account.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ SELECT
ab.block_timestamp AS created_at_timestamp,
aa.keytype AS wallet_type,
aa.account_data AS account_data,
aa._FIVETRAN_SYNCED
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ source(
'algorand',
Expand All @@ -41,10 +45,14 @@ WHERE
1 = 1

{% if is_incremental() %}
AND aa._FIVETRAN_SYNCED >= (
AND DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) >= (
SELECT
MAX(
_FIVETRAN_SYNCED
_INSERTED_TIMESTAMP
)
FROM
{{ this }}
Expand Down
4 changes: 2 additions & 2 deletions models/algorand/silver/silver_algorand__account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ models:
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: WALLET_TYPE
tests:
- accepted_values:
values: ["sig", "msig", "lsig", "", null]
enabled: False # unhandled deletions causes this test to fail
- name: _FIVETRAN_SYNCED
- name: _INSERTED_TIMESTAMP::DATE
tests:
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
Expand Down
15 changes: 11 additions & 4 deletions models/algorand/silver/silver_algorand__account_app.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,31 @@ SELECT
b.addr :: STRING,
b.app :: STRING
) AS _unique_key,
b._FIVETRAN_SYNCED
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ source(
'algorand',
'ACCOUNT_APP'
) }}
b
LEFT JOIN {{ ref('silver_algorand__block') }}
ab
ON b.created_at = ab.block_id
WHERE
1 = 1

{% if is_incremental() %}
AND b._FIVETRAN_SYNCED >= (
AND DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) >= (
SELECT
MAX(
_FIVETRAN_SYNCED
_INSERTED_TIMESTAMP
)
FROM
{{ this }}
Expand Down
4 changes: 2 additions & 2 deletions models/algorand/silver/silver_algorand__account_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ models:
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: APP_INFO
tests:
- not_null:
where: APP_CLOSED = FALSE
- name: _FIVETRAN_SYNCED
- name: _INSERTED_TIMESTAMP::DATE
tests:
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
Expand Down
14 changes: 11 additions & 3 deletions models/algorand/silver/silver_algorand__account_asset.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ SELECT
address :: STRING,
asset_id :: STRING
) AS _unique_key,
aa._FIVETRAN_SYNCED
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ source(
'algorand',
Expand All @@ -49,10 +53,14 @@ WHERE
1 = 1

{% if is_incremental() %}
AND aa._FIVETRAN_SYNCED >= (
AND DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) >= (
SELECT
MAX(
_FIVETRAN_SYNCED
_INSERTED_TIMESTAMP
)
FROM
{{ this }}
Expand Down
4 changes: 2 additions & 2 deletions models/algorand/silver/silver_algorand__account_asset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ models:
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
datepart: hour
interval: 50
- name: FROZEN
tests:
- not_null
- name: ASSET_CLOSED
tests:
- not_null
- name: _FIVETRAN_SYNCED
- name: _INSERTED_TIMESTAMP::DATE
tests:
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
Expand Down
Loading