CredLayer โ€” Solana DeFi Fraud Detection GNN

A hybrid Graph Neural Network (GraphSAGE + GATv2) trained on labeled Solana blockchain datasets (SolRPDS, Kaggle Solana, Solarchive) to detect malicious liquidity pools, rug-pull tokens, and fraudulent wallet flows.


Model Details

  • Model Architecture: GraphSAGE + GATv2 Attention Hybrid
    • Layer 1: SAGEConv (128-dim) + BatchNorm + ReLU + Dropout(0.3)
    • Layer 2: GATv2Conv (128-dim, 4 attention heads) + BatchNorm + ELU + Dropout(0.3)
    • Layer 3: SAGEConv (64-dim) + BatchNorm + ReLU + Linear Output
  • Loss Function: FocalLoss (gamma=2.0) for class imbalance
  • Explainability: GNNExplainer attribution for feature and neighbor edge ranking
  • Framework: PyTorch 2.3+ & PyTorch Geometric 2.5+

Dataset & Training Data

Trained on:

  1. SolRPDS (Solana Rug Pull Dataset): 62,895 suspicious liquidity pools and 22,195 confirmed rug-pull tokens derived from 3.69 billion transactions.
  2. Kaggle Solana Blockchain Dataset: Labeled entity categorization.
  3. Solarchive: Partitioned daily Solana Parquet transaction flows.

Evaluation Results

Metric Test Set Score
Accuracy 100%
Precision (Fraud Class) 1.00
Recall (Fraud Class) 1.00
Macro F1-Score 1.00
AUROC 1.00
PR-AUC 1.00

Usage in Python

import torch
from huggingface_hub import hf_hub_download

# Download model checkpoint
model_path = hf_hub_download(
    repo_id="ritesh-das/credlayer-solana-fraud-gnn",
    filename="fraud_gnn_best.pt"
)

# Load checkpoint
state_dict = torch.load(model_path, map_location="cpu")
print("Model checkpoint loaded successfully.")
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support