1

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?

1 Answer 1

2

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

4
  • But transfer function doesn't accept Mint as an account, will getSignaturesForAddress find it anyway?
    – RowanStone
    Commented Aug 2, 2022 at 4:42
  • What you mean? According to docs, that method will return all transactions for a specific address, can be your address, an ATA, a mint or any address. You can use the result with getParsedTransactions to get information about each transaction. solana-labs.github.io/solana-web3.js/classes/… Commented Aug 2, 2022 at 6:19
  • 2
    @RowanStone is right. the legacy 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)
    – trent.sol
    Commented Aug 2, 2022 at 6:30
  • @trent.sol, thank you, I should've been more specific, as Transfer instruction was what prompted the question in the first place.
    – RowanStone
    Commented Aug 2, 2022 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.