1

I queried ma_tx_out and used the fingerprint of an asset to get its ident so I could get the tx_out_id to get the most recent tx_out for a given asset - but that asset is only in that tx_out because the UTXO has that asset in it, and was used as a part of a transaction that has nothing to do with that asset itself being transferred to another wallet, or contract etc.

How can I filter starting from ma_tx_out so I am only looking at the latest tx that involves THAT asset directly rather than indirectly?

Scenario A: Asset X is sent from Wallet Z to another wallet (this is one I want to retain as the tx involves Asset X directly)

Scenario B: Wallet Z transfers some ADA to another wallet, and Asset X is found in one of the UTXO's involved in the transaction. (this one I don't want to retain, as Asset X is only involved in the tx indirectly)

2
  • Do you mean that in latest tx_out that you currently find for an asset, it didn't actually change hands but was transferred back to the same address as it came from? Nov 22, 2023 at 15:27
  • 1
    Correct. It is on the same address in the outputs as it is on the inputs. I have resolved my "issue" by examining both inputs & outputs. Nov 28, 2023 at 7:27

1 Answer 1

0

It you join the tx (and the ma_tx_out table should reference tx) table with the block table then block.block_no increases by 1 each block. The you just need to filter by all block.block_no bigger than the one you want.

5
  • In this one for example: cardanoscan.io/transaction/… How can we tell that the "Summary" of this tx is a simple transfer of ADA, and that even though there are other assets on the UTXO's involved, those assets themselves have nothing to do with the actual tx being performed, except indirectly? The "Summary" on this one is "91 ADA moved from here to there" - but the assets on the UTXO's involved appear to be a part of the tx when I query from the perspective of ma_tx_out Oct 15, 2023 at 17:11
  • The ADA transfer and the other asset transfers are all part of the same transaction. I would not call that an "indirect" association. ADA tx_out values can be associated with multi asset tx out entries because they the ma_tx_out table will have a tx_out_id field that points back to the tx_out table. Oct 17, 2023 at 0:28
  • Agreed. However, look at this one, the summary shows it is a simple transfer of 91 ADA: cardanoscan.io/transaction/… "Summary" shows a transfer of 91 ADA. "UTXOs" has one which has several assets on it and 2 ADA. When I query ma_tx_out for latest using the fingerprint of any of those assets, I get that tx, even though the tx is about a transfer of 91 ADA as opposed to having anything to do with the transfer of any of those assets on that utxo. In my case, I'd like to ignore that tx, but not sure how. Oct 17, 2023 at 15:20
  • Put another way, for this one: cardanoscan.io/transaction/… How does Cardanoscan know to have the transfer of the 91 ADA in the "Summary" tab? How does it determine from the tx that a transfer of 91 ADA is all that tx effectively did? Oct 17, 2023 at 15:22
  • I don't know how cardanoscan does it, but if I was asked to replicate it, I would a build a query that for a transaction queries both the tx_out table and the ma_tx_out table. For a tx that only transfers ADA, the returned ma_tx_out output would be empty. Oct 17, 2023 at 19:30

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.