prayank: `gettransaction` is only for in-wallet transactions.
Yes. But there is no other RPC which returns `replaced_by_txid`
darosior: Workaround that you suggested in comment is cool `debug=mempool`. Although you would have to save lot of data locally by running a node 24/7 and still miss some of the replaced transactions which got confirmed.