This project builds a credit scoring system (range: 0 to 1000) for wallets interacting with the Aave V2 DeFi lending protocol. The score represents the historical reliability and riskiness of a wallet based on its transaction behavior.
Using raw transaction-level data (~100K records), generate a credit score for each wallet address based on activity types such as deposits, borrows, repayments, liquidations, and redemptions.
We use a rule-based (heuristic) scoring strategy in this version. The idea is to reward responsible DeFi usage (repayment, regular activity) and penalize riskier patterns (excessive borrowing, liquidations).
Each wallet's history is summarized into a set of behavioral features, scored via a simple weighted formula, and then scaled to the standard 0–1000 credit range.
| Feature | Description |
|---|---|
| total_txn | Total transactions by wallet |
| total_deposit | Number of deposit actions |
| total_borrow | Number of borrow actions |
| total_repay | Number of repay actions |
| liquidations | Number of times liquidated |
| avg_amount | Mean transaction value |
| active_days | Days active between first and last tx |
score_raw = (
2 * total_deposit +
3 * total_repay +
1 * active_days -
5 * liquidations -
1 * total_borrow
)Then scaled to [0–1000] using min-max normalization.
├── score_generator.py # One-step scoring script
├── notebook.ipynb # Step-by-step explanation & scoring in Colab
├── wallet_scores.csv # Output file with wallet + score
├── analysis.md # Score distribution + wallet behavior analysis
├── README.md # Project overview
- Upload the provided
user-transactions.jsonfile (87MB). - Run the
notebook.ipynborscore_generator.pyscript. - It will generate a
wallet_scores.csvwith user addresses and scores.
| user | score |
|---|---|
| 0x1234abcd... | 745 |
| 0xabcd5678... | 220 |
-
Python 3.7+
-
Libraries:
- pandas
- numpy
- matplotlib
- seaborn
- scikit-learn
Install via:
pip install -r requirements.txt- Add unsupervised learning (e.g., KMeans or DBSCAN)
- Model repayment ratios vs. borrow ratios over time
- Integrate DeFi protocol metadata (e.g., asset risk classes)
- Apply wallet clustering to detect bots / spam actors
MIT License. This is an open challenge submission.
Built for the Aave Credit Scoring Challenge 2025 🛠️