Skip to main content

Overview

Integrate ZKScore into DeFi applications to enable reputation-based lending, liquidity provision rewards, and protocol-specific achievements.

Use Cases

Reputation-Based Lending

Use ZKScore to offer better rates to high-reputation users:
async function calculateLendingRate(borrower) {
  const score = await zkScore.getScore(borrower);
  const baseRate = 5.0; // 5% base APR
  
  // Better rates for higher scores
  if (score.total >= 800) return baseRate * 0.7; // 30% discount
  if (score.total >= 600) return baseRate * 0.85; // 15% discount
  if (score.total >= 400) return baseRate * 0.95; // 5% discount
  
  return baseRate;
}

Liquidity Mining Rewards

Reward liquidity providers based on reputation:
async function calculateRewards(provider, liquidityAmount) {
  const score = await zkScore.getScore(provider);
  const breakdown = await zkScore.getScoreBreakdown(provider);
  
  const baseReward = liquidityAmount * 0.05; // 5% base APY
  const defiBonus = breakdown.defi / 1000; // Up to 100% bonus
  
  return baseReward * (1 + defiBonus);
}

Best Practices

  1. Fair Tiering: Create reasonable score tiers
  2. Gradual Benefits: Provide incremental benefits
  3. Clear Communication: Explain score requirements
  4. Regular Updates: Sync scores frequently
  5. Fallback Options: Support users without ZKScore