Hey Pranesh,
Thanks for looking into this. In general, I do find the @@ with conversion accounts very useful. The entry causing a problem here is a degenerate case (trading one stablecoin for another, both with values pegged to $1). But in general my entries look more like this:
2023-09-26 Test
assets:myaccount -10 A @@ $9.00
assets:myaccount 10 B @@ $10.00
equity:conversion:$-B:$ $10.00
revenues:capitalgain -$1.00
...where the @@ $9.00 in the first row captures the original cost basis for the A asset we're now disposing of; it's being traded for a B asset worth $10 at current market rates, and we thus are realizing a $1 capital gain today. I am parsing this information from a separate crypto tax-tracking package that is doing all the hard work of determining HIFO sale lots across wallets, etc. etc. This pattern captures the intent accurately, ensures that my overall realized capital gains/losses within hledger reconcile correctly with the tax software's own computations, etc. I would also argue that since the entry above parses cleanly in both hledger 1.30 and hledger 1.33, this is the expected functionality, and some principle of uniformity argues that it shouldn't break if the top line happens to be @@ $10.00, and the capitalgain line happens to be $0.00.
Pushing a step further, in the original test case, the accounting equation is actually balanced! (There is a -10A, a +10A, a -10B, a +10B, a -10$, and a +10$). So it seems that the 1.33 behavior is unintuitive at least (and I would argue buggy).
Last but not least, the fact that I can change all the $10.00 entries in my breaking example to $20.00 entries (while leaving the A and B entries untouched) and it works ... .again, very unintuitive behavior. By Pranesh's logic, that should be just as likely to "infer that A was tradeed for B" and so should fail in the same way ... but it does not.
The problem seems to be the specific matching of the "10" causing some conflation of different commodities in 1.33, where it did not in 1.30 and prior versions. [Haven't checked versions between 1.30 and 1.33].
Will