Skip to main content

Overview

Build custom scoring logic tailored to your application’s specific needs and user behaviors.

Implementation

class CustomScoring {
  async calculateCustomScore(user, weights) {
    const breakdown = await zkScore.getScoreBreakdown(user);
    
    let customScore = 0;
    for (const [category, weight] of Object.entries(weights)) {
      customScore += breakdown[category] * weight;
    }
    
    return Math.min(customScore, 1000);
  }
}

// Usage
const customScore = await scoring.calculateCustomScore(user, {
  defi: 0.4,
  nft: 0.3,
  social: 0.3
});