mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 11:47:00 +00:00
Delete Untitled-2
This commit is contained in:
parent
d054e7bd99
commit
894ee6fad0
33
Untitled-2
33
Untitled-2
@ -1,33 +0,0 @@
|
|||||||
-- let's hone in on native NEAR balances for this user
|
|
||||||
with
|
|
||||||
user_native_transfers as (
|
|
||||||
select
|
|
||||||
block_timestamp,
|
|
||||||
from_address,
|
|
||||||
to_address,
|
|
||||||
amount,
|
|
||||||
iff(
|
|
||||||
from_address = 'b6be88ce9708a743d073d3571ee08fa61fbbd33d84b184ce64c7d5bcc855d358',
|
|
||||||
-amount,
|
|
||||||
amount
|
|
||||||
) as amount_signed
|
|
||||||
from near.core.ez_token_transfers
|
|
||||||
where
|
|
||||||
(from_address = 'b6be88ce9708a743d073d3571ee08fa61fbbd33d84b184ce64c7d5bcc855d358'
|
|
||||||
OR to_address = 'b6be88ce9708a743d073d3571ee08fa61fbbd33d84b184ce64c7d5bcc855d358')
|
|
||||||
and contract_address = 'wrap.near'
|
|
||||||
and transfer_type = 'native'
|
|
||||||
),
|
|
||||||
monthly_sums as (
|
|
||||||
select
|
|
||||||
date_trunc('month', block_timestamp) as month,
|
|
||||||
sum(amount_signed) as monthly_amount
|
|
||||||
from user_native_transfers
|
|
||||||
group by month
|
|
||||||
)
|
|
||||||
select
|
|
||||||
month,
|
|
||||||
sum(monthly_amount) over (order by month) as cumulative_balance
|
|
||||||
from monthly_sums
|
|
||||||
order by month
|
|
||||||
;
|
|
||||||
Loading…
Reference in New Issue
Block a user