Skip to content

Commit

Permalink
Stablecoin V2: Polygon Address Credits and Ethereum (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMelendez01 authored Jul 24, 2024
1 parent e1842d2 commit ef54ee8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions macros/address_balances/address_credits.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% macro address_credits(chain, wrapped_native_token_address, native_token_address) %}

select
to_address as address,
contract_address,
Expand All @@ -17,7 +18,6 @@
>= (select dateadd('day', -3, max(block_timestamp)) from {{ this }})
{% endif %}


union all

select
Expand All @@ -38,7 +38,7 @@
>= (select dateadd('day', -3, max(block_timestamp)) from {{ this }})
{% endif %}

{% if wrapped_native_token_address is defined %}
{% if wrapped_native_token_address is defined and chain not in ('polygon')%}
union all
select
decoded_log:"dst"::string as address,
Expand Down Expand Up @@ -77,6 +77,7 @@
-1 as event_index
from ethereum_flipside.core.ez_native_transfers
where to_address = lower('0x011B6E24FfB0B5f5fCc564cf4183C5BBBc96D515')

{% endif %}

-- Some EVM Chains has a specific contract address for their native token (polygon)
Expand All @@ -94,7 +95,7 @@
null as credit_usd,
tx_hash,
-1 as trace_index,
-1 as event_index
event_index
from {{ chain }}_flipside.core.ez_decoded_event_logs
where
event_name = 'Deposit'
Expand All @@ -105,6 +106,7 @@
and block_timestamp
>= (select dateadd('day', -3, max(block_timestamp)) from {{ this }})
{% endif %}

{% endif %}
-- Not included is staking fees (need to do more research and would be chains specific)
{% endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ with
ref("ez_optimism_stablecoin_metrics_by_address"),
ref("ez_avalanche_stablecoin_metrics_by_address"),
ref("ez_ethereum_stablecoin_metrics_by_address"),
ref("ez_polygon_stablecoin_metrics_by_address"),
ref("ez_tron_stablecoin_metrics_by_address"),
]
)
}}
Expand Down

0 comments on commit ef54ee8

Please sign in to comment.