Given a stream of transactions, write a function to detect potentially fraudulent patterns in real-time for Mercari.