I was checking out the quick alerts feature of Quicknode and tried it for USDC token on ETH mainnet (especially for receiver events).
I was receiving alerts for ETH deposits but not for tokens on ERC chain (like USDC).
Am I doing something wrongly ?
Yes, you can track USDC deposits for a specific address using the below expression.
(tx_logs_address == '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' && tx_logs_topic0 == '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' && tx_logs_topic2 =~ 'ADDRESS_OF_RECEIVER_WITHOUT_0x')
In the above expression, we track three things to get the USDC deposit for a specific address.
The USDC Ethereum Mainnet contract address
Transfer event of the smart contract,
tx_logs_topic0 takes the hashed function signature of the
Function signature `Transfer(address,address,uint256)`
Hashed function Signature `ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`
Prefixed with 0x `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`
- This will be the receiver’s address;
tx_logs_topic2 takes the receiver’s address. There are a few things to note here; since the log topics are in 32 byte format and the Ethereum address is 20 byte we’ll have to use a regex comparator
=~ to check for strings matching our address.
We will have to replace
ADDRESS_OF_RECEIVER_WITHOUT_0x with the receiver’s address without the 0x prefix, to check for
0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5 receiver address we’ll have to check for
I will try this out and then share the feedback.
What you had suggested, it had worked.
We are doing a POC with quicknode alerts functionality.
But if there are two txns from same block number, then it’s missing one event.
In total 4 deposits were done on this address and we were notified 3 times.
Following are the txns coming from same block number:
Txn 1: Amount 0.5 USDC
Txn 2: Amount 1 USDC
Screenshot of our quicknode dashboard, where we received 3 events. Block number 18393273 came only once.
So for the transactions where they were in the same block, did you check that payload? it should have both transactions in the same payload.
We forgot to check the full payload. Thanks it had worked.
thanks for confirming @akshaysoam8