Blockchain Wallet Credit Score Analysis

This project was completed to assign a credit score between 0 and 1000 to each blockchain wallet that interacted with the lending protocol, using only on-chain transaction behaviour.

Tags:Python,Pandas,NumPy,SK Learn,Blockchain Wallet,Machine Learning,Data Analysis

Repo

Overview

Using raw transaction-level data from lending platforms on the blockchain, I:

Methodology

I used heuristic scoring based on engineered behavioral features. Each wallet is scored between 0 and 1000 based on how reliably and responsibly it interacted with the lending protocol.

Processing Flow

  1. Load & Parse: Read the raw transaction JSON file, convert timestamps, and extract the action and amount fields.
  2. Group by Wallet: Aggregate transactions by userWallet to compute wallet-level features.
  3. Feature Engineering: Extract behavioral metrics such as number of deposits, borrowing behavior, liquidations, action diversity, etc.
  4. Normalize Features: Apply MinMaxScaler to ensure features are on the same scale.
  5. Score Computation: Multiply normalized features by defined weights and scale to range [0, 1000].
  6. Export Results: Save credit scores as a CSV and generate a score distribution plot.

Features Engineered

These are engineered by grouping the transaction data per wallet and calculating metrics that indicate responsible DeFi behavior

Technologies Used

Outcome