fix: usdc mint transfers (#247)

* fix: usdc mint transfers

* format

* refactor
This commit is contained in:
WHYTEWYLL 2023-12-18 11:57:18 -03:00 committed by GitHub
parent 5c4e7bfdf8
commit 50962af5a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,11 @@ withdraws AS (
_inserted_timestamp,
block_timestamp,
tx_id,
event_data :from :: STRING AS sender,
CASE
WHEN event_type = 'FiatTokenDeposited'
AND event_contract = 'A.b19436aae4d94622.FiatToken' THEN event_data :to :: STRING
ELSE event_data :from :: STRING
END AS sender,
event_contract AS token_contract,
event_data :amount :: FLOAT AS amount,
tx_succeeded
@ -69,7 +73,12 @@ withdraws AS (
FROM
transfers
)
AND event_type = 'TokensWithdrawn'
AND (
event_type IN (
'TokensWithdrawn',
'FiatTokenDeposited'
)
)
GROUP BY
block_height,
_inserted_timestamp,