DeFi Transaction Risk API
Scores an Ethereum transaction from 0 to 1 and lets the user decide where the alert line sits. Built for my MSc research on leakage-aware risk modelling.
How a transaction becomes a score
- TransactionOne Ethereum transfer
- FeaturesAbout 46 behavioural signals, built only from the past
- XGBoostTrained on earlier blocks
- CalibrationIsotonic, so 0.8 means about 80%
- ThresholdPolicy set outside the model
- ResponseScore, label, latency
Results on the held-out test window
| Model said low risk | Model said high risk | |
|---|---|---|
| Actually legitimate | 30,209correctly passed | 995false alarms |
| Actually fraud | 3,724missed | 23,751caught |
58,679 test transactions. Counts are read from the confusion matrix in the repository.
- Precisionof flagged transactions, how many were fraud
- 96.0%
- Recallof all fraud, how much was flagged
- 86.4%
- False alarm ratelegitimate transactions flagged
- 3.2%
- ROC-AUC and PR-AUCoffline, as reported in the repository
- 0.95 and 0.94
What this does not show
- All results come from offline experiments on a public phishing dataset. There is no live blockchain connection.
- The model uses tabular behaviour features only, with no transaction graph or contract analysis.
- Ranking quality drops under strict time-based splits, so I present it as a triage prototype and not a fraud verdict.