Is there a way to find all transfers of a specific token mint? Say I want to find all USDC transfers which happened on blockchain.
Can it be done efficiently?
For some function of "efficient", yes. You'd need to walk getSignaturesForAddress
for the mint address. This answer is a good place to start.
EDIT: Given that the Transfer
instruction doesn't reference the mint address, this solution would be incomplete. You'd probably have to do some awful graph walk to each account from each MintTo
instruction on the mint
transfer
function doesn't accept Mint
as an account, will getSignaturesForAddress
find it anyway?
Commented
Aug 2, 2022 at 4:42
Transfer
instruction makes no reference to the mint, instead just ensuring that the mints in the sender and recipient accounts match. these transactions won't be reflected on the mint's history. probably have to do something awful instead (edited)
Commented
Aug 2, 2022 at 6:30
Transfer
instruction was what prompted the question in the first place.
Commented
Aug 2, 2022 at 6:39