Design a real-time fraud-detection system for Square’s payments platform. Every card swipe, chip dip, or online checkout must be scored for fraud risk in <100 ms; if the score exceeds a configurable threshold the transaction is blocked before money moves. The system must also support nightly batch jobs that retrain models and detect new fraud rings. Your design should handle 50 k payments per second at peak, with 99.99 % availability, and must gracefully degrade (allow more false positives) rather than block legitimate traffic when overloaded. You need to choose the features, model architecture, data pipeline, and serving infrastructure; justify latency budgets, fault-tolerance choices, and how you would A/B test new models without increasing risk.