with raw as (select
tx_hash,
decoded_log,
decoded_log:token_amounts[0]/1e6 as usdt_amount_adj,
decoded_log:token_amounts[1] as wbtc_amount,
decoded_log:token_amounts[2]/1e18 as weth_amount_adj,
decoded_log:provider::string as receiver,
decoded_log:fee::string as fee
from ethereum.core.ez_decoded_event_logs
where block_timestamp >= '2023-01-01'
and contract_address = '0xd51a44d3fae010294c616388b506acda1bfaae46' --Curve's tricrypto2 pool; https://curve.fi/#/ethereum/pools/tricrypto2/deposit
and event_name = 'AddLiquidity'
and tx_hash = '0x1224597764f7f30f6b1da84ccf2c19116dae450bc6c88579711aab62f5499393'),
amounts as (
select
tx_hash,
receiver as to_address,
usdt_amount_adj,
wbtc_amount,
weth_amount_adj,
fee / pow(10,18) as fee_adj
from raw
)
select * from amounts